summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-06-27 21:23:03 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-06-27 21:23:03 +0000
commita24017f4da1be50a43bd14db607205582abc7544 (patch)
tree16e3d6a2fc27e21a44238b3b647c50546e0bb5ce /apps
parent46136596433da25f3d802d72d0d1273a229c9d9f (diff)
downloadrockbox-a24017f4da1be50a43bd14db607205582abc7544.zip
rockbox-a24017f4da1be50a43bd14db607205582abc7544.tar.gz
rockbox-a24017f4da1be50a43bd14db607205582abc7544.tar.bz2
rockbox-a24017f4da1be50a43bd14db607205582abc7544.tar.xz
Moved the codec and plugin buffer sizes to the config-*.h files instead of
having it repeated in numerous files where they all had to be updated to the same value if ever changed. This allows specific models to actually have its own buffer sizes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6901 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs.c10
-rw-r--r--apps/codecs.h4
-rw-r--r--apps/plugin.h7
-rw-r--r--apps/plugins/Makefile2
-rw-r--r--apps/plugins/plugin.lds14
-rwxr-xr-xapps/plugins/rockboy/archos.lds2
6 files changed, 10 insertions, 29 deletions
diff --git a/apps/codecs.c b/apps/codecs.c
index da4b1f8..16338c2 100644
--- a/apps/codecs.c
+++ b/apps/codecs.c
@@ -16,6 +16,8 @@
* KIND, either express or implied.
*
****************************************************************************/
+#include "config.h"
+
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
@@ -52,7 +54,7 @@
#ifdef SIMULATOR
#if CONFIG_HWCODEC == MASNONE
-static unsigned char codecbuf[CODEC_BUFFER_SIZE];
+static unsigned char codecbuf[CODEC_SIZE];
#endif
void *sim_codec_load(char *plugin, int *fd);
void sim_codec_close(int fd);
@@ -251,9 +253,9 @@ int codec_load_ram(char* codecptr, size_t size, void* ptr2, size_t bufwrap)
if ((char *)&codecbuf[0] != codecptr) {
/* zero out codec buffer to ensure a properly zeroed bss area */
- memset(codecbuf, 0, CODEC_BUFFER_SIZE);
+ memset(codecbuf, 0, CODEC_SIZE);
- size = MIN(size, CODEC_BUFFER_SIZE);
+ size = MIN(size, CODEC_SIZE);
copy_n = MIN(size, bufwrap);
memcpy(codecbuf, codecptr, copy_n);
size -= copy_n;
@@ -283,7 +285,7 @@ int codec_load_file(const char *plugin)
return fd;
}
- rc = read(fd, &codecbuf[0], CODEC_BUFFER_SIZE);
+ rc = read(fd, &codecbuf[0], CODEC_SIZE);
close(fd);
if (rc <= 0) {
logf("Codec read error");
diff --git a/apps/codecs.h b/apps/codecs.h
index c50af30..1a03139 100644
--- a/apps/codecs.h
+++ b/apps/codecs.h
@@ -72,10 +72,6 @@
#endif
-/* This size must match the one set in ../plugins/plugin.lds and
- ../../firmware/app.lds */
-#define CODEC_BUFFER_SIZE 0x40000
-
#ifdef SIMULATOR
#define PREFIX(_x_) sim_ ## _x_
#else
diff --git a/apps/plugin.h b/apps/plugin.h
index 6d2b6e5..d2253b4 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -80,13 +80,6 @@
#endif
-/* These three sizes must match the ones set in plugins/plugin.lds */
-#if MEM >= 32
-#define PLUGIN_BUFFER_SIZE 0xC0000
-#else
-#define PLUGIN_BUFFER_SIZE 0x8000
-#endif
-
#ifdef SIMULATOR
#define PREFIX(_x_) sim_ ## _x_
#else
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index fbae027..a59e33f 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -51,7 +51,7 @@ endif
all: $(BUILDDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE)
ifndef SIMVER
-$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(LINKCODEC) $(BUILDDIR)/libplugin.a
+$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(BUILDDIR)/libplugin.a
$(SILENT)(file=`basename $@`; \
echo "LD $$file"; \
$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(BUILDDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map)
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index f1b4d30..3e624d6 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -22,19 +22,9 @@ OUTPUT_FORMAT(elf32-sh)
#define DRAMORIG 0x09000000 + STUBOFFSET
#endif
-#ifdef CODEC
-#define CODEC_SIZE 0x40000
-#else
-#define CODEC_SIZE 0
-#endif
+#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
-#if MEMORYSIZE >= 32
-#define PLUGIN_LENGTH 0xC0000
-#else
-#define PLUGIN_LENGTH 0x8000
-#endif
-
-#if CODEC_SIZE > 0
+#ifdef CODEC
#define THIS_LENGTH CODEC_SIZE
#else
#define THIS_LENGTH PLUGIN_LENGTH
diff --git a/apps/plugins/rockboy/archos.lds b/apps/plugins/rockboy/archos.lds
index 23d03c6..9412c43 100755
--- a/apps/plugins/rockboy/archos.lds
+++ b/apps/plugins/rockboy/archos.lds
@@ -6,7 +6,7 @@
OUTPUT_FORMAT(elf32-sh)
#define DRAMORIG 0x09000000
-#define PLUGIN_LENGTH 0x8000
+#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
#define OVERLAY_LENGTH 0x68000
#define OVERLAY_ORIGIN (DRAMORIG + (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - OVERLAY_LENGTH)