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/tlb-sh4.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/tlb-sh4.c')
-rw-r--r-- | arch/sh/mm/tlb-sh4.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/arch/sh/mm/tlb-sh4.c b/arch/sh/mm/tlb-sh4.c index cf50082d2435..81199f1e5945 100644 --- a/arch/sh/mm/tlb-sh4.c +++ b/arch/sh/mm/tlb-sh4.c | |||
@@ -15,33 +15,16 @@ | |||
15 | #include <asm/mmu_context.h> | 15 | #include <asm/mmu_context.h> |
16 | #include <asm/cacheflush.h> | 16 | #include <asm/cacheflush.h> |
17 | 17 | ||
18 | void update_mmu_cache(struct vm_area_struct * vma, | 18 | void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte) |
19 | unsigned long address, pte_t pte) | ||
20 | { | 19 | { |
21 | unsigned long flags; | 20 | unsigned long flags, pteval, vpn; |
22 | unsigned long pteval; | ||
23 | unsigned long vpn; | ||
24 | unsigned long pfn = pte_pfn(pte); | ||
25 | struct page *page; | ||
26 | 21 | ||
27 | /* Ptrace may call this routine. */ | 22 | /* |
28 | if (vma && current->active_mm != vma->vm_mm) | 23 | * Handle debugger faulting in for debugee. |
24 | */ | ||
25 | if (current->active_mm != vma->vm_mm) | ||
29 | return; | 26 | return; |
30 | 27 | ||
31 | page = pfn_to_page(pfn); | ||
32 | if (pfn_valid(pfn) && page_mapping(page)) { | ||
33 | #ifndef CONFIG_SMP | ||
34 | int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); | ||
35 | if (dirty) { | ||
36 | |||
37 | unsigned long addr = (unsigned long)page_address(page); | ||
38 | |||
39 | if (pages_do_alias(addr, address & PAGE_MASK)) | ||
40 | __flush_wback_region((void *)addr, PAGE_SIZE); | ||
41 | } | ||
42 | #endif | ||
43 | } | ||
44 | |||
45 | local_irq_save(flags); | 28 | local_irq_save(flags); |
46 | 29 | ||
47 | /* Set PTEH register */ | 30 | /* Set PTEH register */ |