summaryrefslogtreecommitdiff
path: root/apps
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 /apps
parent64d3470541b76557dac7c6b35b15e821812b6f03 (diff)
downloadrockbox-657fdf26f298a7a01bf20140af1a2f5444b9d700.zip
rockbox-657fdf26f298a7a01bf20140af1a2f5444b9d700.tar.gz
rockbox-657fdf26f298a7a01bf20140af1a2f5444b9d700.tar.bz2
rockbox-657fdf26f298a7a01bf20140af1a2f5444b9d700.tar.xz
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
Diffstat (limited to 'apps')
-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 c00d2bd..3b6e779 100644
--- a/apps/codecs/codec.h
+++ b/apps/codecs/codec.h
@@ -21,6 +21,15 @@
#include "config.h"
+#if CONFIG_CPU == MCF5249 && !defined(SIMULATOR)
+#define ICODE_ATTR __attribute__ ((section(".icode")))
+#define IDATA_ATTR __attribute__ ((section(".idata")))
+#define USE_IRAM 1
+#else
+#define ICODE_ATTR
+#define IDATA_ATTR
+#endif
+
#include <sys/types.h>
/* 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 2d212c0..166e3d9 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,
# endif
static
-mad_fixed_t const D[17][32] __attribute__ ((section(".idata"))) = {
+mad_fixed_t const D[17][32] IDATA_ATTR = {
# include "D.dat"
};
diff --git a/apps/plugins/lib/xxx2wav.h b/apps/plugins/lib/xxx2wav.h
index 2806eab..7e3afce 100644
--- a/apps/plugins/lib/xxx2wav.h
+++ b/apps/plugins/lib/xxx2wav.h
@@ -19,6 +19,15 @@
/* Various "helper functions" common to all the xxx2wav decoder plugins */
+#if CONFIG_CPU == MCF5249 && !defined(SIMULATOR)
+#define ICODE_ATTR __attribute__ ((section(".icode")))
+#define IDATA_ATTR __attribute__ ((section(".idata")))
+#define USE_IRAM 1
+#else
+#define ICODE_ATTR
+#define IDATA_ATTR
+#endif
+
/* the main data structure of the program */
typedef struct {
int infile;
diff --git a/apps/plugins/mpa2wav.c b/apps/plugins/mpa2wav.c
index 6c28100..5ef6351 100644
--- a/apps/plugins/mpa2wav.c
+++ b/apps/plugins/mpa2wav.c
@@ -28,9 +28,9 @@
static struct plugin_api* rb;
-struct mad_stream Stream __attribute__ ((section(".idata")));
-struct mad_frame Frame __attribute__ ((section(".idata")));
-struct mad_synth Synth __attribute__ ((section(".idata")));
+struct mad_stream Stream IDATA_ATTR;
+struct mad_frame Frame IDATA_ATTR;
+struct mad_synth Synth IDATA_ATTR;
mad_timer_t Timer;
struct dither d0, d1;
@@ -130,7 +130,7 @@ unsigned char *OutputPtr=OutputBuffer;
unsigned char *GuardPtr=NULL;
const unsigned char *OutputBufferEnd=OutputBuffer+OUTPUT_BUFFER_SIZE;
-#ifndef SIMULATOR
+#ifdef USE_IRAM
extern char iramcopy[];
extern char iramstart[];
extern char iramend[];
@@ -151,7 +151,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
TEST_PLUGIN_API(api);
rb = api;
-#ifndef SIMULATOR
+#ifdef USE_IRAM
rb->memcpy(iramstart, iramcopy, iramend-iramstart);
#endif