From 28f59b390659588d657c8c33ec371742d0191793 Mon Sep 17 00:00:00 2001 From: jethead71 Date: Fri, 14 May 2010 08:44:07 +0000 Subject: [PATCH] Cache align the pitch detector audiobuffer where needed. Some other misc. changes to try to make sure everything builds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26011 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/pitch_detector.c | 2 +- firmware/export/imx31l.h | 1 + firmware/export/system.h | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c index 5675cdc79..01dfef25c 100644 --- a/apps/plugins/pitch_detector.c +++ b/apps/plugins/pitch_detector.c @@ -251,7 +251,7 @@ static int audio_head = 0; /* which of the two buffers to use? */ static volatile int audio_tail = 0; /* which of the two buffers to record? */ /* It's stereo, so make the buffer twice as big */ #ifndef SIMULATOR -static int16_t audio_data[2][BUFFER_SIZE]; +static int16_t audio_data[2][BUFFER_SIZE] __attribute__((aligned(CACHEALIGN_SIZE))); static fixed yin_buffer[YIN_BUFFER_SIZE]; #endif diff --git a/firmware/export/imx31l.h b/firmware/export/imx31l.h index ea92d059c..3f3a0140c 100644 --- a/firmware/export/imx31l.h +++ b/firmware/export/imx31l.h @@ -37,6 +37,7 @@ #define FRAME_PHYS_ADDR (TTB_BASE_ADDR - FRAME_SIZE) #define FRAME ((void *)(FRAME_PHYS_ADDR+0x100000-CSD0_BASE_ADDR)) +#define CACHEALIGN_BITS 5 #define CACHEALIGN_SIZE 32 #define NOCACHE_BASE CSD0_BASE_ADDR diff --git a/firmware/export/system.h b/firmware/export/system.h index 3984ebeb1..bd31c0302 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h @@ -295,10 +295,14 @@ static inline void cpucache_flush(void) } #endif +#ifndef CACHEALIGN_SIZE /* could be elsewhere for a particular reason */ #ifdef CACHEALIGN_BITS /* 2^CACHEALIGN_BITS = the byte size */ #define CACHEALIGN_SIZE (1u << CACHEALIGN_BITS) +#else +#define CACHEALIGN_SIZE sizeof(int) #endif +#endif /* CACHEALIGN_SIZE */ #ifdef PROC_NEEDS_CACHEALIGN /* Cache alignment attributes and sizes are enabled */ -- 2.11.4.GIT