diff options
Diffstat (limited to 'firmware/target/mips')
-rw-r--r-- | firmware/target/mips/mmu-mips.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/firmware/target/mips/mmu-mips.c b/firmware/target/mips/mmu-mips.c index 46094bf6b6..35c47207dd 100644 --- a/firmware/target/mips/mmu-mips.c +++ b/firmware/target/mips/mmu-mips.c | |||
@@ -222,20 +222,7 @@ void discard_dcache_range(const void *base, unsigned int size) | |||
222 | char *ptr = CACHEALIGN_DOWN((char*)base); | 222 | char *ptr = CACHEALIGN_DOWN((char*)base); |
223 | char *end = CACHEALIGN_UP((char*)base + size); | 223 | char *end = CACHEALIGN_UP((char*)base + size); |
224 | 224 | ||
225 | if(ptr != base) { | 225 | for(; ptr != end; ptr += CACHEALIGN_SIZE) |
226 | /* Start of region not cache aligned */ | ||
227 | __CACHE_OP(DCHitWBInv, ptr); | ||
228 | ptr += CACHEALIGN_SIZE; | ||
229 | } | ||
230 | |||
231 | if(base+size != end) { | ||
232 | /* End of region not cache aligned */ | ||
233 | end -= CACHEALIGN_SIZE; | ||
234 | __CACHE_OP(DCHitWBInv, end); | ||
235 | } | ||
236 | |||
237 | /* Interior of region is safe to discard */ | ||
238 | for(; ptr <= end; ptr += CACHEALIGN_SIZE) | ||
239 | __CACHE_OP(DCHitInv, ptr); | 226 | __CACHE_OP(DCHitInv, ptr); |
240 | 227 | ||
241 | SYNC_WB(); | 228 | SYNC_WB(); |