aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/cache-sh7705.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-07-22 06:20:49 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-07-22 06:20:49 -0400
commit2277ab4a1df50e05bc732fe9488d4e902bb8399a (patch)
treef41cb47f15e02bbd1f79bf08ef7762d3bba934f6 /arch/sh/mm/cache-sh7705.c
parentc0b96cf639aa1bfa8983f734d4225091aa813e00 (diff)
sh: Migrate from PG_mapped to PG_dcache_dirty.
This inverts the delayed dcache flush a bit to be more in line with other platforms. At the same time this also gives us the ability to do some more optimizations and cleanup. Now that the update_mmu_cache() callsite only tests for the bit, the implementation can gradually be split out and made generic, rather than relying on special implementations for each of the peculiar CPU types. SH7705 in 32kB mode and SH-4 still need slightly different handling, but this is something that can remain isolated in the varying page copy/clear routines. On top of that, SH-X3 is dcache coherent, so there is no need to bother with any of these tests in the PTEAEX version of update_mmu_cache(), so we kill that off too. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/cache-sh7705.c')
-rw-r--r--arch/sh/mm/cache-sh7705.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/sh/mm/cache-sh7705.c b/arch/sh/mm/cache-sh7705.c
index 22dacc778823..fa37bff306b9 100644
--- a/arch/sh/mm/cache-sh7705.c
+++ b/arch/sh/mm/cache-sh7705.c
@@ -12,6 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/mman.h> 13#include <linux/mman.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/fs.h>
15#include <linux/threads.h> 16#include <linux/threads.h>
16#include <asm/addrspace.h> 17#include <asm/addrspace.h>
17#include <asm/page.h> 18#include <asm/page.h>
@@ -128,7 +129,11 @@ static void __uses_jump_to_uncached __flush_dcache_page(unsigned long phys)
128 */ 129 */
129void flush_dcache_page(struct page *page) 130void flush_dcache_page(struct page *page)
130{ 131{
131 if (test_bit(PG_mapped, &page->flags)) 132 struct address_space *mapping = page_mapping(page);
133
134 if (mapping && !mapping_mapped(mapping))
135 set_bit(PG_dcache_dirty, &page->flags);
136 else
132 __flush_dcache_page(PHYSADDR(page_address(page))); 137 __flush_dcache_page(PHYSADDR(page_address(page)));
133} 138}
134 139