Index: apps/codecs/libcook/cook.h =================================================================== --- apps/codecs/libcook/cook.h (revision 28569) +++ apps/codecs/libcook/cook.h (working copy) @@ -87,7 +87,7 @@ /* data buffers */ uint8_t decoded_bytes_buffer[1024]; - REAL_T mono_mdct_output[2048] __attribute__ ((aligned(16))); + REAL_T mono_mdct_output[2048] CACHEALIGN_ATTR; REAL_T mono_previous_buffer1[1024]; REAL_T mono_previous_buffer2[1024]; REAL_T decode_buffer_1[1024]; Index: apps/codecs/atrac3_rm.c =================================================================== --- apps/codecs/atrac3_rm.c (revision 28569) +++ apps/codecs/atrac3_rm.c (working copy) @@ -30,7 +30,7 @@ static RMContext rmctx; static RMPacket pkt; -static ATRAC3Context q IBSS_ATTR __attribute__ ((aligned (32))); +static ATRAC3Context q IBSS_ATTR CACHEALIGN_ATTR; static void init_rm(RMContext *rmctx) { Index: apps/codecs/libmusepack/mpc_decoder.c =================================================================== --- apps/codecs/libmusepack/mpc_decoder.c (revision 28569) +++ apps/codecs/libmusepack/mpc_decoder.c (working copy) @@ -62,10 +62,10 @@ //Decoder globals (g_Y_L and g_Y_R do not fit into iram for all targets) static mpc_decoder g_mpc_decoder IBSS_ATTR; -static MPC_SAMPLE_FORMAT g_V_L[MPC_V_MEM + 960 ] IBSS_ATTR __attribute__((aligned(16))); -static MPC_SAMPLE_FORMAT g_Y_L[MPC_FRAME_LENGTH] IBSS_ATTR_MPC_LARGE_IRAM __attribute__((aligned(16))); -static MPC_SAMPLE_FORMAT g_V_R[MPC_V_MEM + 960 ] IBSS_ATTR __attribute__((aligned(16))); -static MPC_SAMPLE_FORMAT g_Y_R[MPC_FRAME_LENGTH] IBSS_ATTR_MPC_LARGE_IRAM __attribute__((aligned(16))); +static MPC_SAMPLE_FORMAT g_V_L[MPC_V_MEM + 960 ] IBSS_ATTR CACHEALIGN_ATTR; +static MPC_SAMPLE_FORMAT g_Y_L[MPC_FRAME_LENGTH] IBSS_ATTR_MPC_LARGE_IRAM CACHEALIGN_ATTR; +static MPC_SAMPLE_FORMAT g_V_R[MPC_V_MEM + 960 ] IBSS_ATTR CACHEALIGN_ATTR; +static MPC_SAMPLE_FORMAT g_Y_R[MPC_FRAME_LENGTH] IBSS_ATTR_MPC_LARGE_IRAM CACHEALIGN_ATTR; //SV7 globals (decoding results for bundled quantizers (3- and 5-step)) static const mpc_int32_t g_sv7_idx30[] ICONST_ATTR = Index: apps/codecs/libmusepack/synth_filter.c =================================================================== --- apps/codecs/libmusepack/synth_filter.c (revision 28569) +++ apps/codecs/libmusepack/synth_filter.c (working copy) @@ -36,6 +36,7 @@ /// Synthesis functions. /// \todo document me #include +#include #include "mpcdec.h" #include "decoder.h" #include "mpcdec_math.h" @@ -68,7 +69,7 @@ #endif // Di_opt coefficients are +/- 2^17 (pre-shifted by <<16) -static const MPC_SAMPLE_FORMAT Di_opt [512] ICONST_ATTR __attribute__((aligned(16))) = { +static const MPC_SAMPLE_FORMAT Di_opt [512] ICONST_ATTR CACHEALIGN_ATTR = { /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */ /* 0 */ D( 0), -D( 29), D(213), -D( 459), D(2037), -D(5153), D( 6574), -D(37489), D(75038), D(37489), D(6574), D(5153), D(2037), D(459), D(213), D(29), /* 1 */ -D( 1), -D( 31), D(218), -D( 519), D(2000), -D(5517), D( 5959), -D(39336), D(74992), D(35640), D(7134), D(4788), D(2063), D(401), D(208), D(26), Index: apps/codecs/mp3_enc.c =================================================================== --- apps/codecs/mp3_enc.c (revision 28569) +++ apps/codecs/mp3_enc.c (working copy) @@ -2387,7 +2387,7 @@ return filed->rec_file >= 0 && (long)filed->chunk->flags >= 0; } /* is_event_ok */ -static unsigned char mp3_data[16384] __attribute__((aligned(4))); +static unsigned char mp3_data[16384] CACHEALIGN_ATTR; static unsigned int mp3_data_len; /* current data size in buffer */ /* called very often - inline */ Index: apps/codecs/lib/asm_mcf5249.h =================================================================== --- apps/codecs/lib/asm_mcf5249.h (revision 28569) +++ apps/codecs/lib/asm_mcf5249.h (working copy) @@ -22,7 +22,7 @@ #if defined(CPU_COLDFIRE) /* attribute for 16-byte alignment */ -#define LINE_ATTR __attribute__ ((aligned (16))) +#define LINE_ATTR CACHEALIGN_ATTR #ifndef _V_WIDE_MATH #define _V_WIDE_MATH Index: apps/codecs/libwma/wmadeci.c =================================================================== --- apps/codecs/libwma/wmadeci.c (revision 28569) +++ apps/codecs/libwma/wmadeci.c (working copy) @@ -55,7 +55,7 @@ VLC_TYPE vlcbuf1[VLCBUF1SIZE][2]; VLC_TYPE vlcbuf2[VLCBUF2SIZE][2]; /* This buffer gets reused for lsp tables */ -VLC_TYPE vlcbuf3[VLCBUF3SIZE][2] __attribute__((aligned (sizeof(fixed32)))); +VLC_TYPE vlcbuf3[VLCBUF3SIZE][2] CACHEALIGN_ATTR; VLC_TYPE vlcbuf4[VLCBUF4SIZE][2]; Index: apps/codecs/libatrac/atrac3.c =================================================================== --- apps/codecs/libatrac/atrac3.c (revision 28569) +++ apps/codecs/libatrac/atrac3.c (working copy) @@ -55,13 +55,9 @@ #define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0) static VLC spectral_coeff_tab[7]; -#if defined(CPU_ARM) && (ARM_ARCH >= 5) /*ARMv5e+ uses 32x16 multiplication*/ -static int16_t qmf_window[48] IBSS_ATTR __attribute__ ((aligned (32))); -#else -static int32_t qmf_window[48] IBSS_ATTR __attribute__ ((aligned (16))); -#endif -static int32_t atrac3_spectrum [2][1024] IBSS_ATTR __attribute__((aligned(16))); -static int32_t atrac3_IMDCT_buf[2][ 512] IBSS_ATTR __attribute__((aligned(16))); +static int32_t qmf_window[48] IBSS_ATTR CACHEALIGN_ATTR; +static int32_t atrac3_spectrum [2][1024] IBSS_ATTR CACHEALIGN_ATTR; +static int32_t atrac3_IMDCT_buf[2][ 512] IBSS_ATTR CACHEALIGN_ATTR; static int32_t atrac3_prevFrame[2][1024] IBSS_ATTR; static channel_unit channel_units[2] IBSS_ATTR_LARGE_IRAM; Index: apps/codecs/libtremor/asm_mcf5249.h =================================================================== --- apps/codecs/libtremor/asm_mcf5249.h (revision 28569) +++ apps/codecs/libtremor/asm_mcf5249.h (working copy) @@ -24,7 +24,7 @@ #if defined(CPU_COLDFIRE) /* attribute for 16-byte alignment */ -#define LINE_ATTR __attribute__ ((aligned (16))) +#define LINE_ATTR CACHEALIGN_ATTR #ifndef _V_WIDE_MATH #define _V_WIDE_MATH Index: apps/codecs/libtremor/oggmalloc.c =================================================================== --- apps/codecs/libtremor/oggmalloc.c (revision 28569) +++ apps/codecs/libtremor/oggmalloc.c (working copy) @@ -61,7 +61,7 @@ } /* Allocate IRAM buffer */ -static unsigned char iram_buff[IRAM_IBSS_SIZE] IBSS_ATTR __attribute__ ((aligned (16))); +static unsigned char iram_buff[IRAM_IBSS_SIZE] IBSS_ATTR CACHEALIGN_ATTR; static size_t iram_remain; void iram_malloc_init(void){ Index: apps/codecs/libwmavoice/fft.h =================================================================== --- apps/codecs/libwmavoice/fft.h (revision 28569) +++ apps/codecs/libwmavoice/fft.h (working copy) @@ -60,11 +60,11 @@ #endif #define COSTABLE(size) \ - COSTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_cos_##size)[size/2] + COSTABLE_CONST DECLARE_ALIGNED(CACHEALIGN_SIZE, FFTSample, ff_cos_##size)[size/2] #define SINTABLE(size) \ - SINTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_sin_##size)[size/2] + SINTABLE_CONST DECLARE_ALIGNED(CACHEALIGN_SIZE, FFTSample, ff_sin_##size)[size/2] #define SINETABLE(size) \ - SINETABLE_CONST DECLARE_ALIGNED(16, float, ff_sine_##size)[size] + SINETABLE_CONST DECLARE_ALIGNED(CACHEALIGN_SIZE, float, ff_sine_##size)[size] extern COSTABLE(16); extern COSTABLE(32); extern COSTABLE(64); Index: apps/codecs/libwmavoice/wmavoice.c =================================================================== --- apps/codecs/libwmavoice/wmavoice.c (revision 28569) +++ apps/codecs/libwmavoice/wmavoice.c (working copy) @@ -274,11 +274,11 @@ ///< by postfilter float denoise_filter_cache[MAX_FRAMESIZE]; int denoise_filter_cache_size; ///< samples in #denoise_filter_cache - DECLARE_ALIGNED(16, float, tilted_lpcs_pf)[0x80]; + DECLARE_ALIGNED(CACHEALIGN_SIZE, float, tilted_lpcs_pf)[0x80]; ///< aligned buffer for LPC tilting - DECLARE_ALIGNED(16, float, denoise_coeffs_pf)[0x80]; + DECLARE_ALIGNED(CACHEALIGN_SIZE, float, denoise_coeffs_pf)[0x80]; ///< aligned buffer for denoise coefficients - DECLARE_ALIGNED(16, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16]; + DECLARE_ALIGNED(CACHEALIGN_SIZE, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16]; ///< aligned buffer for postfilter speech ///< synthesis /** Index: apps/codecs/demac/libdemac/decoder.c =================================================================== --- apps/codecs/demac/libdemac/decoder.c (revision 28569) +++ apps/codecs/demac/libdemac/decoder.c (working copy) @@ -35,20 +35,20 @@ #ifdef FILTER256_IRAM static filter_int filterbuf32[(32*3 + FILTER_HISTORY_SIZE) * 2] - IBSS_ATTR_DEMAC __attribute__((aligned(16))); + IBSS_ATTR_DEMAC CACHEALIGN_ATTR; /* 2432 or 4864 bytes */ static filter_int filterbuf256[(256*3 + FILTER_HISTORY_SIZE) * 2] - IBSS_ATTR_DEMAC __attribute__((aligned(16))); + IBSS_ATTR_DEMAC CACHEALIGN_ATTR; /* 5120 or 10240 bytes */ #define FILTERBUF64 filterbuf256 #define FILTERBUF32 filterbuf32 #define FILTERBUF16 filterbuf32 #else static filter_int filterbuf64[(64*3 + FILTER_HISTORY_SIZE) * 2] - IBSS_ATTR_DEMAC __attribute__((aligned(16))); + IBSS_ATTR_DEMAC CACHEALIGN_ATTR; /* 2432 or 4864 bytes */ static filter_int filterbuf256[(256*3 + FILTER_HISTORY_SIZE) * 2] - __attribute__((aligned(16))); /* 5120 or 10240 bytes */ + CACHEALIGN_ATTR; /* 5120 or 10240 bytes */ #define FILTERBUF64 filterbuf64 #define FILTERBUF32 filterbuf64 #define FILTERBUF16 filterbuf64 @@ -57,7 +57,7 @@ /* This is only needed for "insane" files, and no current Rockbox targets can hope to decode them in realtime, except the Gigabeat S (at 528MHz). */ static filter_int filterbuf1280[(1280*3 + FILTER_HISTORY_SIZE) * 2] - IBSS_ATTR_DEMAC_INSANEBUF __attribute__((aligned(16))); + IBSS_ATTR_DEMAC_INSANEBUF CACHEALIGN_ATTR; /* 17408 or 34816 bytes */ void init_frame_decoder(struct ape_ctx_t* ape_ctx,