summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-03-10 20:02:08 +0000
committerJens Arnold <amiconn@rockbox.org>2005-03-10 20:02:08 +0000
commit657fdf26f298a7a01bf20140af1a2f5444b9d700 (patch)
treeede43783a45747b318608d649f4a425ecb8302fe
parent64d3470541b76557dac7c6b35b15e821812b6f03 (diff)
downloadrockbox-657fdf26f298a7a01bf20140af1a2f5444b9d700.tar.gz
rockbox-657fdf26f298a7a01bf20140af1a2f5444b9d700.zip
Compile the simulators without special code & data sections. Fixes intermittent hangs/ crashes of mpa2wav.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6181 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/codec.h9
-rw-r--r--apps/codecs/libmad/synth.c2
-rw-r--r--apps/plugins/lib/xxx2wav.h9
-rw-r--r--apps/plugins/mpa2wav.c10
4 files changed, 24 insertions, 6 deletions
diff --git a/apps/codecs/codec.h b/apps/codecs/codec.h
index c00d2bda95..3b6e7796ee 100644
--- a/apps/codecs/codec.h
+++ b/apps/codecs/codec.h
@@ -21,6 +21,15 @@
21 21
22#include "config.h" 22#include "config.h"
23 23
24#if CONFIG_CPU == MCF5249 && !defined(SIMULATOR)
25#define ICODE_ATTR __attribute__ ((section(".icode")))
26#define IDATA_ATTR __attribute__ ((section(".idata")))
27#define USE_IRAM 1
28#else
29#define ICODE_ATTR
30#define IDATA_ATTR
31#endif
32
24#include <sys/types.h> 33#include <sys/types.h>
25 34
26/* Get these functions 'out of the way' of the standard functions. Not doing 35/* Get these functions 'out of the way' of the standard functions. Not doing
diff --git a/apps/codecs/libmad/synth.c b/apps/codecs/libmad/synth.c
index 2d212c091f..166e3d9f3a 100644
--- a/apps/codecs/libmad/synth.c
+++ b/apps/codecs/libmad/synth.c
@@ -542,7 +542,7 @@ void dct32(mad_fixed_t const in[32], unsigned int slot,
542# endif 542# endif
543 543
544static 544static
545mad_fixed_t const D[17][32] __attribute__ ((section(".idata"))) = { 545mad_fixed_t const D[17][32] IDATA_ATTR = {
546# include "D.dat" 546# include "D.dat"
547}; 547};
548 548
diff --git a/apps/plugins/lib/xxx2wav.h b/apps/plugins/lib/xxx2wav.h
index 2806eabf27..7e3afceaba 100644
--- a/apps/plugins/lib/xxx2wav.h
+++ b/apps/plugins/lib/xxx2wav.h
@@ -19,6 +19,15 @@
19 19
20/* Various "helper functions" common to all the xxx2wav decoder plugins */ 20/* Various "helper functions" common to all the xxx2wav decoder plugins */
21 21
22#if CONFIG_CPU == MCF5249 && !defined(SIMULATOR)
23#define ICODE_ATTR __attribute__ ((section(".icode")))
24#define IDATA_ATTR __attribute__ ((section(".idata")))
25#define USE_IRAM 1
26#else
27#define ICODE_ATTR
28#define IDATA_ATTR
29#endif
30
22/* the main data structure of the program */ 31/* the main data structure of the program */
23typedef struct { 32typedef struct {
24 int infile; 33 int infile;
diff --git a/apps/plugins/mpa2wav.c b/apps/plugins/mpa2wav.c
index 6c28100800..5ef6351a85 100644
--- a/apps/plugins/mpa2wav.c
+++ b/apps/plugins/mpa2wav.c
@@ -28,9 +28,9 @@
28 28
29static struct plugin_api* rb; 29static struct plugin_api* rb;
30 30
31struct mad_stream Stream __attribute__ ((section(".idata"))); 31struct mad_stream Stream IDATA_ATTR;
32struct mad_frame Frame __attribute__ ((section(".idata"))); 32struct mad_frame Frame IDATA_ATTR;
33struct mad_synth Synth __attribute__ ((section(".idata"))); 33struct mad_synth Synth IDATA_ATTR;
34mad_timer_t Timer; 34mad_timer_t Timer;
35struct dither d0, d1; 35struct dither d0, d1;
36 36
@@ -130,7 +130,7 @@ unsigned char *OutputPtr=OutputBuffer;
130unsigned char *GuardPtr=NULL; 130unsigned char *GuardPtr=NULL;
131const unsigned char *OutputBufferEnd=OutputBuffer+OUTPUT_BUFFER_SIZE; 131const unsigned char *OutputBufferEnd=OutputBuffer+OUTPUT_BUFFER_SIZE;
132 132
133#ifndef SIMULATOR 133#ifdef USE_IRAM
134extern char iramcopy[]; 134extern char iramcopy[];
135extern char iramstart[]; 135extern char iramstart[];
136extern char iramend[]; 136extern char iramend[];
@@ -151,7 +151,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
151 TEST_PLUGIN_API(api); 151 TEST_PLUGIN_API(api);
152 rb = api; 152 rb = api;
153 153
154#ifndef SIMULATOR 154#ifdef USE_IRAM
155 rb->memcpy(iramstart, iramcopy, iramend-iramstart); 155 rb->memcpy(iramstart, iramcopy, iramend-iramstart);
156#endif 156#endif
157 157