summaryrefslogtreecommitdiff
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
parent46136596433da25f3d802d72d0d1273a229c9d9f (diff)
downloadrockbox-a24017f4da1be50a43bd14db607205582abc7544.tar.gz
rockbox-a24017f4da1be50a43bd14db607205582abc7544.zip
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
-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
-rw-r--r--firmware/app.lds12
-rw-r--r--firmware/export/config-fmrecorder.h3
-rw-r--r--firmware/export/config-gmini120.h7
-rw-r--r--firmware/export/config-gminisp.h7
-rw-r--r--firmware/export/config-h100.h6
-rw-r--r--firmware/export/config-h300.h6
-rw-r--r--firmware/export/config-ondiofm.h3
-rw-r--r--firmware/export/config-ondiosp.h3
-rw-r--r--firmware/export/config-player.h3
-rw-r--r--firmware/export/config-recorder.h3
-rw-r--r--firmware/export/config-recorderv2.h3
-rw-r--r--firmware/export/config.h4
18 files changed, 60 insertions, 39 deletions
diff --git a/apps/codecs.c b/apps/codecs.c
index da4b1f8bff..16338c263c 100644
--- a/apps/codecs.c
+++ b/apps/codecs.c
@@ -16,6 +16,8 @@
16 * KIND, either express or implied. 16 * KIND, either express or implied.
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19#include "config.h"
20
19#include <stdbool.h> 21#include <stdbool.h>
20#include <string.h> 22#include <string.h>
21#include <stdio.h> 23#include <stdio.h>
@@ -52,7 +54,7 @@
52 54
53#ifdef SIMULATOR 55#ifdef SIMULATOR
54#if CONFIG_HWCODEC == MASNONE 56#if CONFIG_HWCODEC == MASNONE
55static unsigned char codecbuf[CODEC_BUFFER_SIZE]; 57static unsigned char codecbuf[CODEC_SIZE];
56#endif 58#endif
57void *sim_codec_load(char *plugin, int *fd); 59void *sim_codec_load(char *plugin, int *fd);
58void sim_codec_close(int fd); 60void sim_codec_close(int fd);
@@ -251,9 +253,9 @@ int codec_load_ram(char* codecptr, size_t size, void* ptr2, size_t bufwrap)
251 253
252 if ((char *)&codecbuf[0] != codecptr) { 254 if ((char *)&codecbuf[0] != codecptr) {
253 /* zero out codec buffer to ensure a properly zeroed bss area */ 255 /* zero out codec buffer to ensure a properly zeroed bss area */
254 memset(codecbuf, 0, CODEC_BUFFER_SIZE); 256 memset(codecbuf, 0, CODEC_SIZE);
255 257
256 size = MIN(size, CODEC_BUFFER_SIZE); 258 size = MIN(size, CODEC_SIZE);
257 copy_n = MIN(size, bufwrap); 259 copy_n = MIN(size, bufwrap);
258 memcpy(codecbuf, codecptr, copy_n); 260 memcpy(codecbuf, codecptr, copy_n);
259 size -= copy_n; 261 size -= copy_n;
@@ -283,7 +285,7 @@ int codec_load_file(const char *plugin)
283 return fd; 285 return fd;
284 } 286 }
285 287
286 rc = read(fd, &codecbuf[0], CODEC_BUFFER_SIZE); 288 rc = read(fd, &codecbuf[0], CODEC_SIZE);
287 close(fd); 289 close(fd);
288 if (rc <= 0) { 290 if (rc <= 0) {
289 logf("Codec read error"); 291 logf("Codec read error");
diff --git a/apps/codecs.h b/apps/codecs.h
index c50af3030e..1a03139be8 100644
--- a/apps/codecs.h
+++ b/apps/codecs.h
@@ -72,10 +72,6 @@
72 72
73#endif 73#endif
74 74
75/* This size must match the one set in ../plugins/plugin.lds and
76 ../../firmware/app.lds */
77#define CODEC_BUFFER_SIZE 0x40000
78
79#ifdef SIMULATOR 75#ifdef SIMULATOR
80#define PREFIX(_x_) sim_ ## _x_ 76#define PREFIX(_x_) sim_ ## _x_
81#else 77#else
diff --git a/apps/plugin.h b/apps/plugin.h
index 6d2b6e5bf0..d2253b42c6 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -80,13 +80,6 @@
80 80
81#endif 81#endif
82 82
83/* These three sizes must match the ones set in plugins/plugin.lds */
84#if MEM >= 32
85#define PLUGIN_BUFFER_SIZE 0xC0000
86#else
87#define PLUGIN_BUFFER_SIZE 0x8000
88#endif
89
90#ifdef SIMULATOR 83#ifdef SIMULATOR
91#define PREFIX(_x_) sim_ ## _x_ 84#define PREFIX(_x_) sim_ ## _x_
92#else 85#else
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index fbae027ca3..a59e33f5c6 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -51,7 +51,7 @@ endif
51all: $(BUILDDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE) 51all: $(BUILDDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE)
52 52
53ifndef SIMVER 53ifndef SIMVER
54$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(LINKCODEC) $(BUILDDIR)/libplugin.a 54$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(BUILDDIR)/libplugin.a
55 $(SILENT)(file=`basename $@`; \ 55 $(SILENT)(file=`basename $@`; \
56 echo "LD $$file"; \ 56 echo "LD $$file"; \
57 $(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(BUILDDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map) 57 $(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 f1b4d300d7..3e624d6a0b 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -22,19 +22,9 @@ OUTPUT_FORMAT(elf32-sh)
22#define DRAMORIG 0x09000000 + STUBOFFSET 22#define DRAMORIG 0x09000000 + STUBOFFSET
23#endif 23#endif
24 24
25#ifdef CODEC 25#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
26#define CODEC_SIZE 0x40000
27#else
28#define CODEC_SIZE 0
29#endif
30 26
31#if MEMORYSIZE >= 32 27#ifdef CODEC
32#define PLUGIN_LENGTH 0xC0000
33#else
34#define PLUGIN_LENGTH 0x8000
35#endif
36
37#if CODEC_SIZE > 0
38#define THIS_LENGTH CODEC_SIZE 28#define THIS_LENGTH CODEC_SIZE
39#else 29#else
40#define THIS_LENGTH PLUGIN_LENGTH 30#define THIS_LENGTH PLUGIN_LENGTH
diff --git a/apps/plugins/rockboy/archos.lds b/apps/plugins/rockboy/archos.lds
index 23d03c6297..9412c4365a 100755
--- a/apps/plugins/rockboy/archos.lds
+++ b/apps/plugins/rockboy/archos.lds
@@ -6,7 +6,7 @@
6OUTPUT_FORMAT(elf32-sh) 6OUTPUT_FORMAT(elf32-sh)
7 7
8#define DRAMORIG 0x09000000 8#define DRAMORIG 0x09000000
9#define PLUGIN_LENGTH 0x8000 9#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
10 10
11#define OVERLAY_LENGTH 0x68000 11#define OVERLAY_LENGTH 0x68000
12#define OVERLAY_ORIGIN (DRAMORIG + (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - OVERLAY_LENGTH) 12#define OVERLAY_ORIGIN (DRAMORIG + (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - OVERLAY_LENGTH)
diff --git a/firmware/app.lds b/firmware/app.lds
index 91f03955cc..ee666d8cb3 100644
--- a/firmware/app.lds
+++ b/firmware/app.lds
@@ -101,17 +101,9 @@ _pluginbuf = 0;
101 101
102#else 102#else
103 103
104#if MEMORYSIZE >= 32 104#define PLUGINSIZE PLUGIN_BUFFER_SIZE
105#define PLUGINSIZE 0xC0000 105#define CODECSIZE CODEC_SIZE
106#else
107#define PLUGINSIZE 0x8000
108#endif
109 106
110#if CONFIG_HWCODEC == MASNONE
111#define CODECSIZE 0x40000
112#else
113#define CODECSIZE 0
114#endif
115 107
116#ifdef DEBUG 108#ifdef DEBUG
117#define STUBOFFSET 0x10000 109#define STUBOFFSET 0x10000
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h
index a3f2597d5d..d566ffd7eb 100644
--- a/firmware/export/config-fmrecorder.h
+++ b/firmware/export/config-fmrecorder.h
@@ -17,6 +17,9 @@
17/* Define this if you have a software controlled poweroff */ 17/* Define this if you have a software controlled poweroff */
18#define HAVE_SW_POWEROFF 18#define HAVE_SW_POWEROFF
19 19
20/* The number of bytes reserved for loadable plugins */
21#define PLUGIN_BUFFER_SIZE 0x8000
22
20#ifndef SIMULATOR 23#ifndef SIMULATOR
21 24
22/* Define this if you have a MAS3587F */ 25/* Define this if you have a MAS3587F */
diff --git a/firmware/export/config-gmini120.h b/firmware/export/config-gmini120.h
index 93b8727b63..fa7e98eb45 100644
--- a/firmware/export/config-gmini120.h
+++ b/firmware/export/config-gmini120.h
@@ -19,6 +19,13 @@
19/* Define this if you have a software controlled poweroff */ 19/* Define this if you have a software controlled poweroff */
20#define HAVE_SW_POWEROFF 20#define HAVE_SW_POWEROFF
21 21
22/* The number of bytes reserved for loadable codecs. Although in this case
23 the codec won't be loadable... */
24#define CODEC_SIZE 0x40000
25
26/* The number of bytes reserved for loadable plugins */
27#define PLUGIN_BUFFER_SIZE 0xC0000
28
22#ifndef SIMULATOR 29#ifndef SIMULATOR
23 30
24/* Define this if you have a TCC730 (CalmRISC16) */ 31/* Define this if you have a TCC730 (CalmRISC16) */
diff --git a/firmware/export/config-gminisp.h b/firmware/export/config-gminisp.h
index 6a1105f30a..2bf97d5ef5 100644
--- a/firmware/export/config-gminisp.h
+++ b/firmware/export/config-gminisp.h
@@ -13,6 +13,13 @@
13/* Define this if you have a software controlled poweroff */ 13/* Define this if you have a software controlled poweroff */
14#define HAVE_SW_POWEROFF 14#define HAVE_SW_POWEROFF
15 15
16/* The number of bytes reserved for loadable codecs. Although in this case
17 the codec won't be loadable... */
18#define CODEC_SIZE 0x40000
19
20/* The number of bytes reserved for loadable plugins */
21#define PLUGIN_BUFFER_SIZE 0xC0000
22
16#ifndef SIMULATOR 23#ifndef SIMULATOR
17 24
18/* Define this if you have a TCC730 (CalmRISC16) */ 25/* Define this if you have a TCC730 (CalmRISC16) */
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 552eea1166..5c161ae7a0 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -27,6 +27,12 @@
27/* Define this if you have a software controlled poweroff */ 27/* Define this if you have a software controlled poweroff */
28#define HAVE_SW_POWEROFF 28#define HAVE_SW_POWEROFF
29 29
30/* The number of bytes reserved for loadable codecs */
31#define CODEC_SIZE 0x40000
32
33/* The number of bytes reserved for loadable plugins */
34#define PLUGIN_BUFFER_SIZE 0xC0000
35
30#ifndef SIMULATOR 36#ifndef SIMULATOR
31 37
32/* Define this if you have a Motorola SCF5249 */ 38/* Define this if you have a Motorola SCF5249 */
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index 015f31ad8a..f6e1e69e31 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -25,6 +25,12 @@
25/* Define this if you have a software controlled poweroff */ 25/* Define this if you have a software controlled poweroff */
26#define HAVE_SW_POWEROFF 26#define HAVE_SW_POWEROFF
27 27
28/* The number of bytes reserved for loadable codecs */
29#define CODEC_SIZE 0x40000
30
31/* The number of bytes reserved for loadable plugins */
32#define PLUGIN_BUFFER_SIZE 0xC0000
33
28#ifndef SIMULATOR 34#ifndef SIMULATOR
29 35
30/* Define this if you have a Motorola SCF5249 */ 36/* Define this if you have a Motorola SCF5249 */
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index 9436b86f1e..48f1d86128 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -14,6 +14,9 @@
14/* Define this if you have a software controlled poweroff */ 14/* Define this if you have a software controlled poweroff */
15#define HAVE_SW_POWEROFF 15#define HAVE_SW_POWEROFF
16 16
17/* The number of bytes reserved for loadable plugins */
18#define PLUGIN_BUFFER_SIZE 0x8000
19
17#ifndef SIMULATOR 20#ifndef SIMULATOR
18 21
19/* Define this if you have a SH7034 */ 22/* Define this if you have a SH7034 */
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h
index fd79d19cb7..3030c2830e 100644
--- a/firmware/export/config-ondiosp.h
+++ b/firmware/export/config-ondiosp.h
@@ -11,6 +11,9 @@
11/* Define this if you have a software controlled poweroff */ 11/* Define this if you have a software controlled poweroff */
12#define HAVE_SW_POWEROFF 12#define HAVE_SW_POWEROFF
13 13
14/* The number of bytes reserved for loadable plugins */
15#define PLUGIN_BUFFER_SIZE 0x8000
16
14#ifndef SIMULATOR 17#ifndef SIMULATOR
15 18
16/* Define this if you have a SH7034 */ 19/* Define this if you have a SH7034 */
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h
index eee9e97530..464561d90d 100644
--- a/firmware/export/config-player.h
+++ b/firmware/export/config-player.h
@@ -8,6 +8,9 @@
8/* define this if you have the Player's keyboard */ 8/* define this if you have the Player's keyboard */
9#define CONFIG_KEYPAD PLAYER_PAD 9#define CONFIG_KEYPAD PLAYER_PAD
10 10
11/* The number of bytes reserved for loadable plugins */
12#define PLUGIN_BUFFER_SIZE 0x8000
13
11#ifndef SIMULATOR 14#ifndef SIMULATOR
12 15
13/* Define this if you have a SH7034 */ 16/* Define this if you have a SH7034 */
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h
index 61c76d480d..4cc378f180 100644
--- a/firmware/export/config-recorder.h
+++ b/firmware/export/config-recorder.h
@@ -14,6 +14,9 @@
14/* define this if you have a real-time clock */ 14/* define this if you have a real-time clock */
15#define HAVE_RTC 1 15#define HAVE_RTC 1
16 16
17/* The number of bytes reserved for loadable plugins */
18#define PLUGIN_BUFFER_SIZE 0x8000
19
17#ifndef SIMULATOR 20#ifndef SIMULATOR
18 21
19/* Define this if you have a MAS3587F */ 22/* Define this if you have a MAS3587F */
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h
index c75f0e6f12..a9c8afcdd3 100644
--- a/firmware/export/config-recorderv2.h
+++ b/firmware/export/config-recorderv2.h
@@ -17,6 +17,9 @@
17/* Define this if you have a software controlled poweroff */ 17/* Define this if you have a software controlled poweroff */
18#define HAVE_SW_POWEROFF 18#define HAVE_SW_POWEROFF
19 19
20/* The number of bytes reserved for loadable plugins */
21#define PLUGIN_BUFFER_SIZE 0x8000
22
20#ifndef SIMULATOR 23#ifndef SIMULATOR
21 24
22/* Define this if you have a SH7034 */ 25/* Define this if you have a SH7034 */
diff --git a/firmware/export/config.h b/firmware/export/config.h
index e0d901b587..61c9899762 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -108,4 +108,8 @@
108/* no known platform */ 108/* no known platform */
109#endif 109#endif
110 110
111#ifndef CODEC_SIZE
112#define CODEC_SIZE 0
113#endif
114
111#endif 115#endif