diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-06-22 02:47:54 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-06-22 02:47:54 +0000 |
commit | ecf2f747edae9ffc3eb0057958da41915cbfac19 (patch) | |
tree | 7aa2c608a86033351ca6eaaa3f1c00488ee59cfe /apps/plugins | |
parent | 2f2b9eab4b44f35f4aa82cd9c61255debcfa2f03 (diff) |
Daniel's fix that loads codecs in their own memory space
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6794 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/Makefile | 20 | ||||
-rw-r--r-- | apps/plugins/plugin.lds | 17 |
2 files changed, 30 insertions, 7 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile index fa0e8b8f74..44e055d2a4 100644 --- a/apps/plugins/Makefile +++ b/apps/plugins/Makefile @@ -22,6 +22,7 @@ endif LDS := plugin.lds LINKFILE := $(OBJDIR)/pluginlink.lds +LINKCODEC := $(OBJDIR)/codeclink.lds DEPFILE = $(OBJDIR)/dep-plugins # This sets up 'SRC' based on the files mentioned in SOURCES @@ -51,9 +52,16 @@ endif all: $(BUILDDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE) ifndef SIMVER -$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(BUILDDIR)/libplugin.a - @echo "LD "`basename $@` - @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(BUILDDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map +$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(LINKCODEC) $(BUILDDIR)/libplugin.a + $(SILENT)(file=`basename $@`; \ + echo "LD $$file"; \ + match=`grep $$file CODECS`; \ + if test -z "$$match"; then \ + LINKWITH=$(LINKFILE); \ + else \ + LINKWITH=$(LINKCODEC); \ + fi; \ + $(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(BUILDDIR) $(CODECLIBS) -lplugin -lgcc -T$$LINKWITH -Wl,-Map,$(OBJDIR)/$*.map) $(OBJDIR)/%.rock : $(OBJDIR)/%.elf @echo "OBJCOPY "`basename $@` @@ -104,12 +112,14 @@ $(BUILDDIR)/libplugin.a: @mkdir -p $(OBJDIR)/lib @$(MAKE) -C lib OBJDIR=$(OBJDIR)/lib -# MEM should be passed on to this makefile with the chosen memory size given -# in number of MB $(LINKFILE): $(LDS) @echo "build $@" @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P - >$@ +$(LINKCODEC): $(LDS) + @echo "build $@" + @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) -DCODEC $(INCLUDES) $(TARGET) $(DEFINES) -E -P - >$@ + $(SUBDIRS): @echo "MAKE in $@" @mkdir -p $(OBJDIR)/$@ diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds index 3b9ac8a2da..619bb0e7e8 100644 --- a/apps/plugins/plugin.lds +++ b/apps/plugins/plugin.lds @@ -22,17 +22,30 @@ OUTPUT_FORMAT(elf32-sh) #define DRAMORIG 0x09000000 + STUBOFFSET #endif +#ifdef CODEC +#define CODEC_SIZE 0x3C000 +#else +#define CODEC_SIZE 0 +#endif + #if MEMORYSIZE >= 32 #define PLUGIN_LENGTH 0xC0000 #else #define PLUGIN_LENGTH 0x8000 #endif -#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH + +#if CODEC_SIZE > 0 +#define THIS_LENGTH CODEC_SIZE +#else +#define THIS_LENGTH PLUGIN_LENGTH +#endif + +#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - CODEC_SIZE #define PLUGIN_ORIGIN (DRAMORIG + (DRAMSIZE)) MEMORY { - PLUGIN_RAM : ORIGIN = PLUGIN_ORIGIN, LENGTH = PLUGIN_LENGTH + PLUGIN_RAM : ORIGIN = PLUGIN_ORIGIN, LENGTH = THIS_LENGTH #ifdef IRIVER_H100 PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE #endif |