Added macros controlling what goes to IRAM on different targets.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11483 a1c6a512-1295-4272-9138-f99709370657
diff --git a/apps/codecs/Tremor/bitwise.c b/apps/codecs/Tremor/bitwise.c
index 3e967b9..55d3712 100644
--- a/apps/codecs/Tremor/bitwise.c
+++ b/apps/codecs/Tremor/bitwise.c
@@ -49,7 +49,7 @@
                       }
 
 /* Read in bits without advancing the bitptr; bits <= 32 */
-long oggpack_look_full(oggpack_buffer *b,int bits) ICODE_ATTR;
+long oggpack_look_full(oggpack_buffer *b,int bits) ICODE_ATTR_TREMOR_NOT_MDCT;
 long oggpack_look_full(oggpack_buffer *b,int bits){
   unsigned long m=oggpack_mask[bits];
   unsigned long ret=-1;
@@ -136,7 +136,7 @@
 }
 
 /* bits <= 32 */
-long oggpack_read(oggpack_buffer *b,int bits) ICODE_ATTR;
+long oggpack_read(oggpack_buffer *b,int bits) ICODE_ATTR_TREMOR_NOT_MDCT;
 long oggpack_read(oggpack_buffer *b,int bits){
   unsigned long m=oggpack_mask[bits];
   ogg_uint32_t ret=-1;
diff --git a/apps/codecs/Tremor/block.c b/apps/codecs/Tremor/block.c
index ac19f3a..9dce13c 100644
--- a/apps/codecs/Tremor/block.c
+++ b/apps/codecs/Tremor/block.c
@@ -256,7 +256,8 @@
    block.  The time domain envelope is not yet handled at the point of
    calling (as it relies on the previous block). */
 
-int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb) ICODE_ATTR;
+int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb)
+    ICODE_ATTR_TREMOR_NOT_MDCT;
 int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
   vorbis_info *vi=v->vi;
   codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
diff --git a/apps/codecs/Tremor/config-tremor.h b/apps/codecs/Tremor/config-tremor.h
index f4a0e1c..e1ade70 100644
--- a/apps/codecs/Tremor/config-tremor.h
+++ b/apps/codecs/Tremor/config-tremor.h
@@ -13,12 +13,16 @@
 #define BIG_ENDIAN 0
 #endif
 
-/* As of 28 Dec 2005, the Tremor code is too big for IRAM on the iPod,
-   so we temporarily disable ICODE_ATTR - this needs reviewing when it comes
-   to optimising Tremor for the iPod */
-#ifdef CPU_ARM
-#undef ICODE_ATTR
-#define ICODE_ATTR
+#ifndef ICONST_ATTR_TREMOR_WINDOW
+#define ICONST_ATTR_TREMOR_WINDOW ICONST_ATTR
+#endif
+
+#ifndef ICODE_ATTR_TREMOR_MDCT
+#define ICODE_ATTR_TREMOR_MDCT ICODE_ATTR
+#endif
+
+#ifndef ICODE_ATTR_TREMOR_NOT_MDCT
+#define ICODE_ATTR_TREMOR_NOT_MDCT ICODE_ATTR
 #endif
 
 // #define _LOW_ACCURACY_
diff --git a/apps/codecs/Tremor/floor1.c b/apps/codecs/Tremor/floor1.c
index 14515c2..a66e737 100644
--- a/apps/codecs/Tremor/floor1.c
+++ b/apps/codecs/Tremor/floor1.c
@@ -312,7 +312,8 @@
   }
 }
 
-static void *floor1_inverse1(vorbis_block *vb,vorbis_look_floor *in) ICODE_ATTR;
+static void *floor1_inverse1(vorbis_block *vb,vorbis_look_floor *in)
+    ICODE_ATTR_TREMOR_NOT_MDCT;
 static void *floor1_inverse1(vorbis_block *vb,vorbis_look_floor *in){
   vorbis_look_floor1 *look=(vorbis_look_floor1 *)in;
   vorbis_info_floor1 *info=look->vi;
@@ -399,7 +400,7 @@
 }
 
 static int floor1_inverse2(vorbis_block *vb,vorbis_look_floor *in,void *memo,
-                          ogg_int32_t *out) ICODE_ATTR;
+                          ogg_int32_t *out) ICODE_ATTR_TREMOR_NOT_MDCT;
 static int floor1_inverse2(vorbis_block *vb,vorbis_look_floor *in,void *memo,
                           ogg_int32_t *out){
   vorbis_look_floor1 *look=(vorbis_look_floor1 *)in;
diff --git a/apps/codecs/Tremor/framing.c b/apps/codecs/Tremor/framing.c
index f17ad86..e444514 100644
--- a/apps/codecs/Tremor/framing.c
+++ b/apps/codecs/Tremor/framing.c
@@ -105,7 +105,8 @@
   return ob;
 }
 
-static ogg_reference *_fetch_ref(ogg_buffer_state *bs) ICODE_ATTR;
+static ogg_reference *_fetch_ref(ogg_buffer_state *bs)
+    ICODE_ATTR_TREMOR_NOT_MDCT;
 static ogg_reference *_fetch_ref(ogg_buffer_state *bs){
   ogg_reference *or;
   bs->outstanding++;
@@ -857,7 +858,7 @@
   }
 }
 
-static void _span_queued_page(ogg_stream_state *os) ICODE_ATTR;
+static void _span_queued_page(ogg_stream_state *os) ICODE_ATTR_TREMOR_NOT_MDCT;
 static void _span_queued_page(ogg_stream_state *os){ 
   while( !(os->body_fill&FINFLAG) ){
     
@@ -1016,7 +1017,8 @@
   return OGG_SUCCESS;
 }
 
-static int _packetout(ogg_stream_state *os,ogg_packet *op,int adv) ICODE_ATTR;
+static int _packetout(ogg_stream_state *os,ogg_packet *op,int adv)
+    ICODE_ATTR_TREMOR_NOT_MDCT;
 static int _packetout(ogg_stream_state *os,ogg_packet *op,int adv){
 
   ogg_packet_release(op);
diff --git a/apps/codecs/Tremor/mdct.c b/apps/codecs/Tremor/mdct.c
index 5d7f195..8334cdf 100644
--- a/apps/codecs/Tremor/mdct.c
+++ b/apps/codecs/Tremor/mdct.c
@@ -144,7 +144,8 @@
 }
 
 /* N/stage point generic N stage butterfly (in place, 4 register) */
-void mdct_butterfly_generic(DATA_TYPE *x,int points, int step) ICODE_ATTR;
+void mdct_butterfly_generic(DATA_TYPE *x,int points, int step)
+    ICODE_ATTR_TREMOR_MDCT;
 void mdct_butterfly_generic(DATA_TYPE *x,int points, int step){
   LOOKUP_T *T   = sincos_lookup0;
   DATA_TYPE *x1        = x + points      - 8;
@@ -332,7 +333,8 @@
 }
 
 
-void mdct_backward(int n, DATA_TYPE *in, DATA_TYPE *out) ICODE_ATTR;
+void mdct_backward(int n, DATA_TYPE *in, DATA_TYPE *out)
+    ICODE_ATTR_TREMOR_MDCT;
 void mdct_backward(int n, DATA_TYPE *in, DATA_TYPE *out) {
   int n2=n>>1;
   int n4=n>>2;
diff --git a/apps/codecs/Tremor/res012.c b/apps/codecs/Tremor/res012.c
index 0f4d224..fe0cf2e 100644
--- a/apps/codecs/Tremor/res012.c
+++ b/apps/codecs/Tremor/res012.c
@@ -259,7 +259,8 @@
 
 /* duplicate code here as speed is somewhat more important */
 int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
-                 ogg_int32_t **in,int *nonzero,int ch) ICODE_ATTR;
+                 ogg_int32_t **in,int *nonzero,int ch)
+    ICODE_ATTR_TREMOR_NOT_MDCT;
 int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
                  ogg_int32_t **in,int *nonzero,int ch){
   long i,k,l,s;
diff --git a/apps/codecs/Tremor/synthesis.c b/apps/codecs/Tremor/synthesis.c
index c7f0bb6..cef240e 100644
--- a/apps/codecs/Tremor/synthesis.c
+++ b/apps/codecs/Tremor/synthesis.c
@@ -35,7 +35,8 @@
 static ogg_int32_t *ipcm_vect[CHANNELS] IBSS_ATTR;
 static ogg_int32_t ipcm_buff[CHANNELS*IRAM_PCM_END] IBSS_ATTR LINE_ATTR;
 
-int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep) ICODE_ATTR;
+int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep)
+    ICODE_ATTR_TREMOR_NOT_MDCT;
 int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep){
   vorbis_dsp_state     *vd=vb->vd;
   private_state        *b=(private_state *)vd->backend_state;
diff --git a/apps/codecs/Tremor/vorbisfile.c b/apps/codecs/Tremor/vorbisfile.c
index 4d36ab3..0f39826 100644
--- a/apps/codecs/Tremor/vorbisfile.c
+++ b/apps/codecs/Tremor/vorbisfile.c
@@ -478,7 +478,7 @@
 
 static int _fetch_and_process_packet(OggVorbis_File *vf,
                                      int readp,
-                                     int spanp) ICODE_ATTR;
+                                     int spanp) ICODE_ATTR_TREMOR_NOT_MDCT;
 static int _fetch_and_process_packet(OggVorbis_File *vf,
                                      int readp,
                                      int spanp){
@@ -1458,7 +1458,7 @@
 }
 
 /* return time offset (milliseconds) of next PCM sample to be read */
-ogg_int64_t ov_time_tell(OggVorbis_File *vf) ICODE_ATTR;
+ogg_int64_t ov_time_tell(OggVorbis_File *vf) ICODE_ATTR_TREMOR_NOT_MDCT;
 ogg_int64_t ov_time_tell(OggVorbis_File *vf){
   int link=0;
   ogg_int64_t pcm_total=0;
diff --git a/apps/codecs/Tremor/window_lookup.h b/apps/codecs/Tremor/window_lookup.h
index 9fbb98f..ccf316e 100644
--- a/apps/codecs/Tremor/window_lookup.h
+++ b/apps/codecs/Tremor/window_lookup.h
@@ -51,7 +51,7 @@
   X(0x7ffdcf39), X(0x7fff6dac), X(0x7fffed01), X(0x7fffffc4),
 };
 
-static LOOKUP_T vwin256[128] ICONST_ATTR = {
+static LOOKUP_T vwin256[128] ICONST_ATTR_TREMOR_WINDOW = {
   X(0x0001f018), X(0x00117066), X(0x00306e9e), X(0x005ee5f1),
   X(0x009ccf26), X(0x00ea208b), X(0x0146cdea), X(0x01b2c87f),
   X(0x022dfedf), X(0x02b85ced), X(0x0351cbbd), X(0x03fa317f),
@@ -284,7 +284,7 @@
   X(0x7fffffdd), X(0x7ffffff7), X(0x7fffffff), X(0x7fffffff),
 };
 
-static LOOKUP_T vwin2048[1024] ICONST_ATTR = {
+static LOOKUP_T vwin2048[1024] ICONST_ATTR_TREMOR_WINDOW = {
   X(0x000007c0), X(0x000045c4), X(0x0000c1ca), X(0x00017bd3),
   X(0x000273de), X(0x0003a9eb), X(0x00051df9), X(0x0006d007),
   X(0x0008c014), X(0x000aee1e), X(0x000d5a25), X(0x00100428),
diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c
index 1e9c30f..9f2405f 100644
--- a/apps/codecs/flac.c
+++ b/apps/codecs/flac.c
@@ -34,7 +34,7 @@
 struct codec_api* ci;
 
 /* The output buffers containing the decoded samples (channels 0 and 1) */
-int32_t decoded0[MAX_BLOCKSIZE] IBSS_ATTR;
+int32_t decoded0[MAX_BLOCKSIZE] IBSS_ATTR_FLAC_DECODED0;
 int32_t decoded1[MAX_BLOCKSIZE] IBSS_ATTR;
 
 #define MAX_SUPPORTED_SEEKTABLE_SIZE 5000
diff --git a/apps/codecs/libalac/alac.c b/apps/codecs/libalac/alac.c
index 5487c68..f8e4df8 100644
--- a/apps/codecs/libalac/alac.c
+++ b/apps/codecs/libalac/alac.c
@@ -226,7 +226,7 @@
                                  int rice_kmodifier, /* arg424->d */
                                  int rice_historymult, /* arg424->c */
                                  int rice_kmodifier_mask /* arg424->e */
-                                ) ICODE_ATTR;
+                                ) ICODE_ATTR_ALAC;
 void basterdised_rice_decompress(alac_file *alac,
                                  int32_t *output_buffer,
                                  int output_size,
@@ -373,7 +373,7 @@
                                            int readsamplesize,
                                            int16_t *predictor_coef_table,
                                            int predictor_coef_num,
-                                           int predictor_quantitization) ICODE_ATTR;
+                                           int predictor_quantitization) ICODE_ATTR_ALAC;
 static void predictor_decompress_fir_adapt(int32_t *error_buffer,
                                            int32_t *buffer_out,
                                            int output_size,
@@ -645,7 +645,7 @@
                     int32_t* buffer1,
                     int numsamples,
                     uint8_t interlacing_shift,
-                    uint8_t interlacing_leftweight) ICODE_ATTR;
+                    uint8_t interlacing_leftweight) ICODE_ATTR_ALAC;
 void deinterlace_16(int32_t* buffer0,
                     int32_t* buffer1,
                     int numsamples,
diff --git a/apps/codecs/libalac/decomp.h b/apps/codecs/libalac/decomp.h
index 1628110..e4a19a7 100644
--- a/apps/codecs/libalac/decomp.h
+++ b/apps/codecs/libalac/decomp.h
@@ -1,6 +1,10 @@
 #ifndef __ALAC__DECOMP_H
 #define __ALAC__DECOMP_H
 
+#ifndef ICODE_ATTR_ALAC
+#define ICODE_ATTR_ALAC ICODE_ATTR
+#endif
+
 /* Always output samples shifted to 28 bits + sign*/
 #define ALAC_OUTPUT_DEPTH 29
 #define SCALE16 (ALAC_OUTPUT_DEPTH - 16)
@@ -31,12 +35,13 @@
     /* end setinfo stuff */
 } alac_file;
 
-void create_alac(int samplesize, int numchannels, alac_file* alac) ICODE_ATTR;
+void create_alac(int samplesize, int numchannels, alac_file* alac)
+    ICODE_ATTR_ALAC;
 int alac_decode_frame(alac_file *alac,
                       unsigned char *inbuffer,
                       int32_t outputbuffer[ALAC_MAX_CHANNELS][ALAC_BLOCKSIZE],
-                      void (*yield)(void)) ICODE_ATTR;
-void alac_set_info(alac_file *alac, char *inputbuffer) ICODE_ATTR;
+                      void (*yield)(void)) ICODE_ATTR_ALAC;
+void alac_set_info(alac_file *alac, char *inputbuffer) ICODE_ATTR_ALAC;
 
 #endif /* __ALAC__DECOMP_H */
 
diff --git a/apps/codecs/libffmpegFLAC/bitstream.h b/apps/codecs/libffmpegFLAC/bitstream.h
index 288d839..19f2b6e 100644
--- a/apps/codecs/libffmpegFLAC/bitstream.h
+++ b/apps/codecs/libffmpegFLAC/bitstream.h
@@ -18,6 +18,14 @@
   #define ICODE_ATTR
 #endif
 
+#ifndef ICODE_ATTR_FLAC
+#define ICODE_ATTR_FLAC ICODE_ATTR
+#endif
+
+#ifndef IBSS_ATTR_FLAC_DECODED0
+#define IBSS_ATTR_FLAC_DECODED0 IBSS_ATTR
+#endif
+
 /* Endian conversion routines for standalone compilation */
 #ifdef BUILD_STANDALONE
     #ifdef BUILD_BIGENDIAN
@@ -252,7 +260,7 @@
     return tmp;
 }
 
-unsigned int get_bits_long(GetBitContext *s, int n) ICODE_ATTR;
+unsigned int get_bits_long(GetBitContext *s, int n) ICODE_ATTR_FLAC;
 
 /**
  * shows 0-17 bits.
@@ -267,7 +275,7 @@
     return tmp;
 }
 
-unsigned int show_bits_long(GetBitContext *s, int n) ICODE_ATTR;
+unsigned int show_bits_long(GetBitContext *s, int n) ICODE_ATTR_FLAC;
 
 static inline void skip_bits(GetBitContext *s, int n){
  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
@@ -328,6 +336,6 @@
     }
 }
 
-void align_get_bits(GetBitContext *s) ICODE_ATTR;
+void align_get_bits(GetBitContext *s) ICODE_ATTR_FLAC;
 
 #endif /* BITSTREAM_H */
diff --git a/apps/codecs/libffmpegFLAC/decoder.c b/apps/codecs/libffmpegFLAC/decoder.c
index 3d934d9..8a1f84c 100644
--- a/apps/codecs/libffmpegFLAC/decoder.c
+++ b/apps/codecs/libffmpegFLAC/decoder.c
@@ -99,7 +99,7 @@
     0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3
 };
 
-static int64_t get_utf8(GetBitContext *gb) ICODE_ATTR;
+static int64_t get_utf8(GetBitContext *gb) ICODE_ATTR_FLAC;
 static int64_t get_utf8(GetBitContext *gb)
 {
     uint64_t val;
@@ -124,7 +124,7 @@
     return val;
 }
 
-static int get_crc8(const uint8_t *buf, int count) ICODE_ATTR;
+static int get_crc8(const uint8_t *buf, int count) ICODE_ATTR_FLAC;
 static int get_crc8(const uint8_t *buf, int count)
 {
     int crc=0;
@@ -137,7 +137,7 @@
     return crc;
 }
 
-static int decode_residuals(FLACContext *s, int32_t* decoded, int pred_order) ICODE_ATTR;
+static int decode_residuals(FLACContext *s, int32_t* decoded, int pred_order) ICODE_ATTR_FLAC;
 static int decode_residuals(FLACContext *s, int32_t* decoded, int pred_order)
 {
     int i, tmp, partition, method_type, rice_order;
@@ -177,7 +177,7 @@
     return 0;
 }    
 
-static int decode_subframe_fixed(FLACContext *s, int32_t* decoded, int pred_order) ICODE_ATTR;
+static int decode_subframe_fixed(FLACContext *s, int32_t* decoded, int pred_order) ICODE_ATTR_FLAC;
 static int decode_subframe_fixed(FLACContext *s, int32_t* decoded, int pred_order)
 {
     int i;
@@ -224,7 +224,7 @@
     return 0;
 }
 
-static int decode_subframe_lpc(FLACContext *s, int32_t* decoded, int pred_order) ICODE_ATTR;
+static int decode_subframe_lpc(FLACContext *s, int32_t* decoded, int pred_order) ICODE_ATTR_FLAC;
 static int decode_subframe_lpc(FLACContext *s, int32_t* decoded, int pred_order)
 {
     int sum, i, j;
@@ -386,7 +386,7 @@
 static int decode_frame(FLACContext *s,
                         int32_t* decoded0,
                         int32_t* decoded1,
-                        void (*yield)(void)) ICODE_ATTR;
+                        void (*yield)(void)) ICODE_ATTR_FLAC;
 static int decode_frame(FLACContext *s,
                         int32_t* decoded0,
                         int32_t* decoded1,
diff --git a/apps/codecs/libffmpegFLAC/decoder.h b/apps/codecs/libffmpegFLAC/decoder.h
index affec0a..0b148df 100644
--- a/apps/codecs/libffmpegFLAC/decoder.h
+++ b/apps/codecs/libffmpegFLAC/decoder.h
@@ -44,6 +44,6 @@
                       int32_t* decoded0,
                       int32_t* decoded1,
                       uint8_t *buf, int buf_size,
-                      void (*yield)(void)) ICODE_ATTR;
+                      void (*yield)(void)) ICODE_ATTR_FLAC;
 
 #endif
diff --git a/apps/codecs/libffmpegFLAC/shndec.c b/apps/codecs/libffmpegFLAC/shndec.c
index d7fc6a1..61b3703 100644
--- a/apps/codecs/libffmpegFLAC/shndec.c
+++ b/apps/codecs/libffmpegFLAC/shndec.c
@@ -83,7 +83,7 @@
 }
 
 #if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
-static void coldfire_lshift_samples(int n, int shift, int32_t *samples) ICODE_ATTR;
+static void coldfire_lshift_samples(int n, int shift, int32_t *samples) ICODE_ATTR_FLAC;
 static void coldfire_lshift_samples(int n, int shift, int32_t *samples)
 {
 /*
diff --git a/apps/codecs/libmad/global.h b/apps/codecs/libmad/global.h
index fc3dde8..1ecfea1 100644
--- a/apps/codecs/libmad/global.h
+++ b/apps/codecs/libmad/global.h
@@ -66,4 +66,8 @@
 #  endif
 # endif
 
+#ifndef ICONST_ATTR_MPA_HUFFMAN
+#define ICONST_ATTR_MPA_HUFFMAN ICONST_ATTR
+#endif
+
 # endif
diff --git a/apps/codecs/libmad/huffman.c b/apps/codecs/libmad/huffman.c
index 6ef2390..43216d3 100644
--- a/apps/codecs/libmad/huffman.c
+++ b/apps/codecs/libmad/huffman.c
@@ -50,7 +50,7 @@
 # endif
 
 static
-union huffquad const hufftabA[] ICONST_ATTR = {
+union huffquad const hufftabA[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 2),
   /* 0001 */ PTR(20, 2),
   /* 0010 */ PTR(24, 1),
@@ -90,7 +90,7 @@
 };
 
 static
-union huffquad const hufftabB[] ICONST_ATTR = {
+union huffquad const hufftabB[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ V(1, 1, 1, 1, 4),
   /* 0001 */ V(1, 1, 1, 0, 4),
   /* 0010 */ V(1, 1, 0, 1, 4),
@@ -126,12 +126,12 @@
 # endif
 
 static
-union huffpair const hufftab0[] ICONST_ATTR = {
+union huffpair const hufftab0[] ICONST_ATTR_MPA_HUFFMAN = {
   /*      */ V(0, 0, 0)
 };
 
 static
-union huffpair const hufftab1[] ICONST_ATTR = {
+union huffpair const hufftab1[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 000  */ V(1, 1, 3),
   /* 001  */ V(0, 1, 3),
   /* 010  */ V(1, 0, 2),
@@ -143,7 +143,7 @@
 };
 
 static
-union huffpair const hufftab2[] ICONST_ATTR = {
+union huffpair const hufftab2[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 000  */ PTR(8, 3),
   /* 001  */ V(1, 1, 3),
   /* 010  */ V(0, 1, 3),
@@ -165,7 +165,7 @@
 };
 
 static
-union huffpair const hufftab3[] ICONST_ATTR = {
+union huffpair const hufftab3[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 000  */ PTR(8, 3),
   /* 001  */ V(1, 0, 3),
   /* 010  */ V(1, 1, 2),
@@ -187,7 +187,7 @@
 };
 
 static
-union huffpair const hufftab5[] ICONST_ATTR = {
+union huffpair const hufftab5[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 000  */ PTR(8, 4),
   /* 001  */ V(1, 1, 3),
   /* 010  */ V(0, 1, 3),
@@ -221,7 +221,7 @@
 };
 
 static
-union huffpair const hufftab6[] ICONST_ATTR = {
+union huffpair const hufftab6[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 3),
   /* 0001 */ PTR(24, 1),
   /* 0010 */ PTR(26, 1),
@@ -259,7 +259,7 @@
 };
 
 static
-union huffpair const hufftab7[] ICONST_ATTR = {
+union huffpair const hufftab7[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 4),
   /* 0010 */ PTR(48, 2),
@@ -346,7 +346,7 @@
 /* this version saves 8 entries (16 bytes) at the expense of
    an extra lookup in 4 out of 36 cases */
 static
-union huffpair const hufftab8[] ICONST_ATTR = {
+union huffpair const hufftab8[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 2),
   /* 0010 */ V(1, 2, 4),
@@ -424,7 +424,7 @@
 };
 # else
 static
-union huffpair const hufftab8[] ICONST_ATTR = {
+union huffpair const hufftab8[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 4),
   /* 0010 */ V(1, 2, 4),
@@ -509,7 +509,7 @@
 # endif
 
 static
-union huffpair const hufftab9[] ICONST_ATTR = {
+union huffpair const hufftab9[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 3),
   /* 0010 */ PTR(40, 2),
@@ -581,7 +581,7 @@
 };
 
 static
-union huffpair const hufftab10[] ICONST_ATTR = {
+union huffpair const hufftab10[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 4),
   /* 0010 */ PTR(48, 2),
@@ -719,7 +719,7 @@
 };
 
 static
-union huffpair const hufftab11[] ICONST_ATTR = {
+union huffpair const hufftab11[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 4),
   /* 0010 */ PTR(48, 4),
@@ -855,7 +855,7 @@
 };
 
 static
-union huffpair const hufftab12[] ICONST_ATTR = {
+union huffpair const hufftab12[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 4),
   /* 0010 */ PTR(48, 4),
@@ -983,7 +983,7 @@
 };
 
 static
-union huffpair const hufftab13[] ICONST_ATTR = {
+union huffpair const hufftab13[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 4),
   /* 0010 */ PTR(48, 4),
@@ -1509,7 +1509,7 @@
 };
 
 static
-union huffpair const hufftab15[] ICONST_ATTR = {
+union huffpair const hufftab15[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 4),
   /* 0010 */ PTR(48, 4),
@@ -2017,7 +2017,7 @@
 };
 
 static
-union huffpair const hufftab16[] ICONST_ATTR = {
+union huffpair const hufftab16[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 4),
   /* 0010 */ PTR(48, 4),
@@ -2551,7 +2551,7 @@
 };
 
 static
-union huffpair const hufftab24[] ICONST_ATTR = {
+union huffpair const hufftab24[] ICONST_ATTR_MPA_HUFFMAN = {
   /* 0000 */ PTR(16, 4),
   /* 0001 */ PTR(32, 4),
   /* 0010 */ PTR(48, 4),
diff --git a/apps/codecs/libmusepack/musepack.h b/apps/codecs/libmusepack/musepack.h
index 549ea79..7e65c75 100644
--- a/apps/codecs/libmusepack/musepack.h
+++ b/apps/codecs/libmusepack/musepack.h
@@ -52,6 +52,10 @@
 #include "reader.h"
 #include "streaminfo.h"
     
+#ifndef IBSS_ATTR_MPC_SAMPLE_BUF
+#define IBSS_ATTR_MPC_SAMPLE_BUF IBSS_ATTR
+#endif
+
 #ifdef ROCKBOX_LITTLE_ENDIAN
 #define MPC_LITTLE_ENDIAN
 #endif
diff --git a/apps/codecs/mpc.c b/apps/codecs/mpc.c
index f9622f8..821b3ce 100644
--- a/apps/codecs/mpc.c
+++ b/apps/codecs/mpc.c
@@ -63,7 +63,8 @@
     return true;
 }
 
-MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH] IBSS_ATTR;
+MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH]
+IBSS_ATTR_MPC_SAMPLE_BUF;
 mpc_uint32_t    seek_table[10000];
 
 #ifdef USE_IRAM
diff --git a/apps/codecs/shorten.c b/apps/codecs/shorten.c
index c571df8..a7fc601 100644
--- a/apps/codecs/shorten.c
+++ b/apps/codecs/shorten.c
@@ -20,6 +20,10 @@
 #include "codeclib.h"
 #include <codecs/libffmpegFLAC/shndec.h>
 
+#ifndef IBSS_ATTR_SHORTEN_DECODED0
+#define IBSS_ATTR_SHORTEN_DECODED0 IBSS_ATTR
+#endif
+
 CODEC_HEADER
 
 #ifdef USE_IRAM
@@ -33,7 +37,7 @@
 struct codec_api* rb;
 struct codec_api* ci;
 
-int32_t decoded0[MAX_DECODE_SIZE] IBSS_ATTR;
+int32_t decoded0[MAX_DECODE_SIZE] IBSS_ATTR_SHORTEN_DECODED0;
 int32_t decoded1[MAX_DECODE_SIZE] IBSS_ATTR;
 
 int32_t offset0[MAX_OFFSET_SIZE] IBSS_ATTR;
diff --git a/apps/playback.c b/apps/playback.c
index f1589ac..892bd15 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -176,6 +176,10 @@
 #endif
 #define CODEC_IRAM_SIZE     0xc000
 
+#ifndef IBSS_ATTR_VOICE_STACK
+#define IBSS_ATTR_VOICE_STACK IBSS_ATTR
+#endif
+
 #ifndef SIMULATOR
 extern bool audio_is_initialized;
 #else
@@ -278,7 +282,7 @@
 static struct thread_entry *voice_thread_p = NULL;
 static struct event_queue voice_queue;
 static long voice_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)]
-IBSS_ATTR;
+IBSS_ATTR_VOICE_STACK;
 static const char voice_thread_name[] = "voice codec";
 
 /* Voice codec swapping control */
diff --git a/firmware/export/config-ifp7xx.h b/firmware/export/config-ifp7xx.h
index 9b8693a..b0724f6 100644
--- a/firmware/export/config-ifp7xx.h
+++ b/firmware/export/config-ifp7xx.h
@@ -97,4 +97,14 @@
 #define BOOTFILE_EXT "iriver"
 #define BOOTFILE "rockbox." BOOTFILE_EXT
 
+#define IBSS_ATTR_VOICE_STACK
+#define ICODE_ATTR_TREMOR_NOT_MDCT
+#define ICODE_ATTR_TREMOR_MDCT
+#define ICODE_ATTR_FLAC
+#define IBSS_ATTR_FLAC_DECODED0
+#define ICONST_ATTR_MPA_HUFFMAN
+#define IBSS_ATTR_MPC_SAMPLE_BUF
+#define ICODE_ATTR_ALAC
+#define IBSS_ATTR_SHORTEN_DECODED0
+
 #endif
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h
index 1cb4f88..3360904 100644
--- a/firmware/export/config-ipod3g.h
+++ b/firmware/export/config-ipod3g.h
@@ -123,4 +123,6 @@
 #define BOOTFILE_EXT "ipod"
 #define BOOTFILE "rockbox." BOOTFILE_EXT
 
+#define ICODE_ATTR_TREMOR_NOT_MDCT
+
 #endif /* SIMULATOR */
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h
index 065c653..bf8d535 100644
--- a/firmware/export/config-ipod4g.h
+++ b/firmware/export/config-ipod4g.h
@@ -128,4 +128,6 @@
 #define BOOTFILE_EXT "ipod"
 #define BOOTFILE "rockbox." BOOTFILE_EXT
 
+#define ICODE_ATTR_TREMOR_NOT_MDCT
+
 #endif
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h
index efc5726..de06b22 100644
--- a/firmware/export/config-ipodcolor.h
+++ b/firmware/export/config-ipodcolor.h
@@ -119,4 +119,6 @@
 #define BOOTFILE_EXT "ipod"
 #define BOOTFILE "rockbox." BOOTFILE_EXT
 
+#define ICODE_ATTR_TREMOR_NOT_MDCT
+
 #endif
diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h
index 2e5da2e..6ffb863 100644
--- a/firmware/export/config-ipodmini.h
+++ b/firmware/export/config-ipodmini.h
@@ -125,4 +125,6 @@
 #define BOOTFILE_EXT "ipod"
 #define BOOTFILE "rockbox." BOOTFILE_EXT
 
+#define ICODE_ATTR_TREMOR_NOT_MDCT
+
 #endif
diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h
index 8f1fc1a..c0822ba 100755
--- a/firmware/export/config-ipodmini2g.h
+++ b/firmware/export/config-ipodmini2g.h
@@ -131,4 +131,6 @@
 #define BOOTFILE_EXT "ipod"
 #define BOOTFILE "rockbox." BOOTFILE_EXT
 
+#define ICODE_ATTR_TREMOR_NOT_MDCT
+
 #endif
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index db85fa8..3dd0575 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -124,4 +124,6 @@
 #define BOOTFILE_EXT "ipod"
 #define BOOTFILE "rockbox." BOOTFILE_EXT
 
+#define ICODE_ATTR_TREMOR_NOT_MDCT
+
 #endif
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index 543bfbf..0caa2f2 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -124,4 +124,6 @@
 #define BOOTFILE_EXT "ipod"
 #define BOOTFILE "rockbox." BOOTFILE_EXT
 
+#define ICODE_ATTR_TREMOR_NOT_MDCT
+
 #endif