diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/Makefile | 10 | ||||
-rw-r--r-- | apps/plugins/plugin.lds | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile index 4c02207016..dca7babcc6 100644 --- a/apps/plugins/Makefile +++ b/apps/plugins/Makefile | |||
@@ -13,9 +13,10 @@ OC = sh-elf-objcopy | |||
13 | FIRMWARE = ../../firmware | 13 | FIRMWARE = ../../firmware |
14 | 14 | ||
15 | INCLUDES = -I$(FIRMWARE)/include -I$(FIRMWARE)/export -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I.. | 15 | INCLUDES = -I$(FIRMWARE)/include -I$(FIRMWARE)/export -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I.. |
16 | CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) | 16 | CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEM} |
17 | 17 | ||
18 | LINKFILE = plugin.lds | 18 | LDS := plugin.lds |
19 | LINKFILE := $(OBJDIR)/pluginlink.lds | ||
19 | 20 | ||
20 | SRC := $(wildcard *.c) | 21 | SRC := $(wildcard *.c) |
21 | ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) | 22 | ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) |
@@ -41,5 +42,10 @@ $(OBJDIR)/%.o: %.c ../plugin.h Makefile | |||
41 | all: $(ROCKS) | 42 | all: $(ROCKS) |
42 | @echo done | 43 | @echo done |
43 | 44 | ||
45 | # MEM should be passed on to this makefile with the chosen memory size given | ||
46 | # in number of MB | ||
47 | $(LINKFILE): $(LDS) | ||
48 | cat $< | $(CC) -DMEMORYSIZE=$(MEM) $(DEFINES) -E -P - >$@ | ||
49 | |||
44 | clean: | 50 | clean: |
45 | -rm -f $(ROCKS) | 51 | -rm -f $(ROCKS) |
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds index bc24901dad..c8354fae11 100644 --- a/apps/plugins/plugin.lds +++ b/apps/plugins/plugin.lds | |||
@@ -1,8 +1,12 @@ | |||
1 | OUTPUT_FORMAT(elf32-sh) | 1 | OUTPUT_FORMAT(elf32-sh) |
2 | 2 | ||
3 | #define PLUGIN_LENGTH 0x8000 | ||
4 | #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH | ||
5 | #define PLUGIN_ORIGIN (0x09000000 + (DRAMSIZE)) | ||
6 | |||
3 | MEMORY | 7 | MEMORY |
4 | { | 8 | { |
5 | PLUGIN_RAM : ORIGIN = 0x091f8000, LENGTH = 0x8000 | 9 | PLUGIN_RAM : ORIGIN = PLUGIN_ORIGIN, LENGTH = PLUGIN_LENGTH |
6 | } | 10 | } |
7 | 11 | ||
8 | SECTIONS | 12 | SECTIONS |