summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-05-14 08:44:07 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-05-14 08:44:07 +0000
commitd665c926528219cc01be33658e8897a1472db827 (patch)
treecffe979fed0a85e1ce59581dc4fb59fc2aad9619
parent8cce39bb9f3368ddb324f7b757a62c573d16cc55 (diff)
downloadrockbox-d665c926528219cc01be33658e8897a1472db827.tar.gz
rockbox-d665c926528219cc01be33658e8897a1472db827.zip
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
-rw-r--r--apps/plugins/pitch_detector.c2
-rw-r--r--firmware/export/imx31l.h1
-rw-r--r--firmware/export/system.h4
3 files changed, 6 insertions, 1 deletions
diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c
index 5675cdc794..01dfef25ca 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? */
251static volatile int audio_tail = 0; /* which of the two buffers to record? */ 251static volatile int audio_tail = 0; /* which of the two buffers to record? */
252/* It's stereo, so make the buffer twice as big */ 252/* It's stereo, so make the buffer twice as big */
253#ifndef SIMULATOR 253#ifndef SIMULATOR
254static int16_t audio_data[2][BUFFER_SIZE]; 254static int16_t audio_data[2][BUFFER_SIZE] __attribute__((aligned(CACHEALIGN_SIZE)));
255static fixed yin_buffer[YIN_BUFFER_SIZE]; 255static fixed yin_buffer[YIN_BUFFER_SIZE];
256#endif 256#endif
257 257
diff --git a/firmware/export/imx31l.h b/firmware/export/imx31l.h
index ea92d059cc..3f3a0140c8 100644
--- a/firmware/export/imx31l.h
+++ b/firmware/export/imx31l.h
@@ -37,6 +37,7 @@
37#define FRAME_PHYS_ADDR (TTB_BASE_ADDR - FRAME_SIZE) 37#define FRAME_PHYS_ADDR (TTB_BASE_ADDR - FRAME_SIZE)
38#define FRAME ((void *)(FRAME_PHYS_ADDR+0x100000-CSD0_BASE_ADDR)) 38#define FRAME ((void *)(FRAME_PHYS_ADDR+0x100000-CSD0_BASE_ADDR))
39 39
40#define CACHEALIGN_BITS 5
40#define CACHEALIGN_SIZE 32 41#define CACHEALIGN_SIZE 32
41#define NOCACHE_BASE CSD0_BASE_ADDR 42#define NOCACHE_BASE CSD0_BASE_ADDR
42 43
diff --git a/firmware/export/system.h b/firmware/export/system.h
index 3984ebeb11..bd31c03028 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -295,10 +295,14 @@ static inline void cpucache_flush(void)
295} 295}
296#endif 296#endif
297 297
298#ifndef CACHEALIGN_SIZE /* could be elsewhere for a particular reason */
298#ifdef CACHEALIGN_BITS 299#ifdef CACHEALIGN_BITS
299/* 2^CACHEALIGN_BITS = the byte size */ 300/* 2^CACHEALIGN_BITS = the byte size */
300#define CACHEALIGN_SIZE (1u << CACHEALIGN_BITS) 301#define CACHEALIGN_SIZE (1u << CACHEALIGN_BITS)
302#else
303#define CACHEALIGN_SIZE sizeof(int)
301#endif 304#endif
305#endif /* CACHEALIGN_SIZE */
302 306
303#ifdef PROC_NEEDS_CACHEALIGN 307#ifdef PROC_NEEDS_CACHEALIGN
304/* Cache alignment attributes and sizes are enabled */ 308/* Cache alignment attributes and sizes are enabled */