diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-19 09:13:00 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-19 09:14:50 +0100 |
commit | fb9a90f7c674f3ddef6baf55cb1612dadd8ea752 (patch) | |
tree | f25cf2ce17449ba34cdfdfb948134eb3464e400e /arch/mn10300/mm/cache.c | |
parent | 2d7b8366ae4a9ec2183c30e432a4a9a495c82bcd (diff) | |
parent | 21c74a8ea8b47eb6c3c621e36578f6e27f65c5c7 (diff) |
Merge remote branch 'airlied/drm-core-next' into tmp
Diffstat (limited to 'arch/mn10300/mm/cache.c')
-rw-r--r-- | arch/mn10300/mm/cache.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/mn10300/mm/cache.c b/arch/mn10300/mm/cache.c index 1b76719ec1c..9261217e8d2 100644 --- a/arch/mn10300/mm/cache.c +++ b/arch/mn10300/mm/cache.c @@ -54,13 +54,30 @@ EXPORT_SYMBOL(flush_icache_page); void flush_icache_range(unsigned long start, unsigned long end) { #ifdef CONFIG_MN10300_CACHE_WBACK - unsigned long addr, size, off; + unsigned long addr, size, base, off; struct page *page; pgd_t *pgd; pud_t *pud; pmd_t *pmd; pte_t *ppte, pte; + if (end > 0x80000000UL) { + /* addresses above 0xa0000000 do not go through the cache */ + if (end > 0xa0000000UL) { + end = 0xa0000000UL; + if (start >= end) + return; + } + + /* kernel addresses between 0x80000000 and 0x9fffffff do not + * require page tables, so we just map such addresses directly */ + base = (start >= 0x80000000UL) ? start : 0x80000000UL; + mn10300_dcache_flush_range(base, end); + if (base == start) + goto invalidate; + end = base; + } + for (; start < end; start += size) { /* work out how much of the page to flush */ off = start & (PAGE_SIZE - 1); @@ -104,6 +121,7 @@ void flush_icache_range(unsigned long start, unsigned long end) } #endif +invalidate: mn10300_icache_inv(); } EXPORT_SYMBOL(flush_icache_range); |