diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-07-28 11:12:17 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-07-28 11:12:17 -0400 |
commit | 9cef7492696a416663b4edb953a4eade8517ebeb (patch) | |
tree | e52b19208a2197a624a7942e6c549d274a944fb0 /arch/sh/mm/pg-mmu.c | |
parent | 0dfae7d5a21901b28ec0452d71be64adf5ea323e (diff) |
sh: update_mmu_cache() consolidation.
This splits out a separate __update_cache()/__update_tlb() for
update_mmu_cache() to wrap in to. This lets us share the common
__update_cache() bits while keeping special __update_tlb() handling
broken out.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/pg-mmu.c')
-rw-r--r-- | arch/sh/mm/pg-mmu.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/sh/mm/pg-mmu.c b/arch/sh/mm/pg-mmu.c index 356d2cdcb209..8602f68af4c8 100644 --- a/arch/sh/mm/pg-mmu.c +++ b/arch/sh/mm/pg-mmu.c | |||
@@ -134,3 +134,24 @@ void clear_user_highpage(struct page *page, unsigned long vaddr) | |||
134 | kunmap_atomic(kaddr, KM_USER0); | 134 | kunmap_atomic(kaddr, KM_USER0); |
135 | } | 135 | } |
136 | EXPORT_SYMBOL(clear_user_highpage); | 136 | EXPORT_SYMBOL(clear_user_highpage); |
137 | |||
138 | void __update_cache(struct vm_area_struct *vma, | ||
139 | unsigned long address, pte_t pte) | ||
140 | { | ||
141 | struct page *page; | ||
142 | unsigned long pfn = pte_pfn(pte); | ||
143 | |||
144 | if (!boot_cpu_data.dcache.n_aliases) | ||
145 | return; | ||
146 | |||
147 | page = pfn_to_page(pfn); | ||
148 | if (pfn_valid(pfn) && page_mapping(page)) { | ||
149 | int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); | ||
150 | if (dirty) { | ||
151 | unsigned long addr = (unsigned long)page_address(page); | ||
152 | |||
153 | if (pages_do_alias(addr, address & PAGE_MASK)) | ||
154 | __flush_wback_region((void *)addr, PAGE_SIZE); | ||
155 | } | ||
156 | } | ||
157 | } | ||