summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg White <gwhite@rockbox.org>2007-01-06 02:48:26 +0000
committerGreg White <gwhite@rockbox.org>2007-01-06 02:48:26 +0000
commit45bef7d914918113fa9e08f440cf80f27d9b2b46 (patch)
tree49f05e45550dec2bb5b9486f1d6fbe494da0cff3
parentebcd762fb24455b58c9aab79a004e93d04a5c6cd (diff)
downloadrockbox-45bef7d914918113fa9e08f440cf80f27d9b2b46.tar.gz
rockbox-45bef7d914918113fa9e08f440cf80f27d9b2b46.tar.bz2
rockbox-45bef7d914918113fa9e08f440cf80f27d9b2b46.zip
Fix range for cache cleans
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11928 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/gigabeat/meg-fx/mmu-meg-fx.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/firmware/target/arm/gigabeat/meg-fx/mmu-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/mmu-meg-fx.c
index 1e3412b2a0..36f653a9dd 100644
--- a/firmware/target/arm/gigabeat/meg-fx/mmu-meg-fx.c
+++ b/firmware/target/arm/gigabeat/meg-fx/mmu-meg-fx.c
@@ -87,15 +87,14 @@ static void enable_mmu(void) {
/* Invalidate DCache for this range */
/* Will do write back */
void invalidate_dcache_range(const void *base, unsigned int size) {
- unsigned int addr = (int) base;
- unsigned int end = addr+size;
+ unsigned int addr = ((int) base) & ~31;
+ unsigned int end = addr+size+32;
asm volatile(
- "bic %0, %0, #31 \n"
"inv_start: \n"
"mcr p15, 0, %0, c7, c14, 1 \n" /* Clean and invalidate this line */
"add %0, %0, #32 \n"
"cmp %0, %1 \n"
- "blo inv_start \n"
+ "ble inv_start \n"
"mov %0, #0\n"
"mcr p15,0,%0,c7,c10,4\n" /* Drain write buffer */
: : "r" (addr), "r" (end));
@@ -105,7 +104,7 @@ void invalidate_dcache_range(const void *base, unsigned int size) {
/* forces DCache writeback for the specified range */
void clean_dcache_range(const void *base, unsigned int size) {
unsigned int addr = (int) base;
- unsigned int end = addr+size;
+ unsigned int end = addr+size+32;
asm volatile(
"bic %0, %0, #31 \n"
"clean_start: \n"