summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2003-07-13 22:15:19 +0000
committerBjörn Stenberg <bjorn@haxx.se>2003-07-13 22:15:19 +0000
commit13d56150b6678841a67cdca5acbb484814e78ce7 (patch)
tree0b20688a008f0037301f31945fcd5ad43b946d28 /apps/plugins
parent9cb5e0e9f94e0660682f35b7ae2d55a82f009f03 (diff)
downloadrockbox-13d56150b6678841a67cdca5acbb484814e78ce7.zip
rockbox-13d56150b6678841a67cdca5acbb484814e78ce7.tar.gz
rockbox-13d56150b6678841a67cdca5acbb484814e78ce7.tar.bz2
rockbox-13d56150b6678841a67cdca5acbb484814e78ce7.tar.xz
Added plugin support for 8MB-modified units. This bumps the plugin API version number again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3831 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/Makefile10
-rw-r--r--apps/plugins/plugin.lds6
2 files changed, 13 insertions, 3 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index 4c02207..dca7bab 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -13,9 +13,10 @@ OC = sh-elf-objcopy
FIRMWARE = ../../firmware
INCLUDES = -I$(FIRMWARE)/include -I$(FIRMWARE)/export -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I..
-CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes $(INCLUDES) $(TARGET) $(EXTRA_DEFINES)
+CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEM}
-LINKFILE = plugin.lds
+LDS := plugin.lds
+LINKFILE := $(OBJDIR)/pluginlink.lds
SRC := $(wildcard *.c)
ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
@@ -41,5 +42,10 @@ $(OBJDIR)/%.o: %.c ../plugin.h Makefile
all: $(ROCKS)
@echo done
+# MEM should be passed on to this makefile with the chosen memory size given
+# in number of MB
+$(LINKFILE): $(LDS)
+ cat $< | $(CC) -DMEMORYSIZE=$(MEM) $(DEFINES) -E -P - >$@
+
clean:
-rm -f $(ROCKS)
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index bc24901..c8354fa 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -1,8 +1,12 @@
OUTPUT_FORMAT(elf32-sh)
+#define PLUGIN_LENGTH 0x8000
+#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH
+#define PLUGIN_ORIGIN (0x09000000 + (DRAMSIZE))
+
MEMORY
{
- PLUGIN_RAM : ORIGIN = 0x091f8000, LENGTH = 0x8000
+ PLUGIN_RAM : ORIGIN = PLUGIN_ORIGIN, LENGTH = PLUGIN_LENGTH
}
SECTIONS