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-sh3.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-sh3.c')
-rw-r--r-- | arch/sh/mm/tlb-sh3.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c index 9b8459c74abd..425f1f23cf93 100644 --- a/arch/sh/mm/tlb-sh3.c +++ b/arch/sh/mm/tlb-sh3.c | |||
@@ -27,32 +27,16 @@ | |||
27 | #include <asm/mmu_context.h> | 27 | #include <asm/mmu_context.h> |
28 | #include <asm/cacheflush.h> | 28 | #include <asm/cacheflush.h> |
29 | 29 | ||
30 | void update_mmu_cache(struct vm_area_struct * vma, | 30 | void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte) |
31 | unsigned long address, pte_t pte) | ||
32 | { | 31 | { |
33 | unsigned long flags; | 32 | unsigned long flags, pteval, vpn; |
34 | unsigned long pteval; | ||
35 | unsigned long vpn; | ||
36 | unsigned long pfn = pte_pfn(pte); | ||
37 | struct page *page; | ||
38 | 33 | ||
39 | /* Ptrace may call this routine. */ | 34 | /* |
40 | if (vma && current->active_mm != vma->vm_mm) | 35 | * Handle debugger faulting in for debugee. |
36 | */ | ||
37 | if (current->active_mm != vma->vm_mm) | ||
41 | return; | 38 | return; |
42 | 39 | ||
43 | page = pfn_to_page(pfn); | ||
44 | if (pfn_valid(pfn) && page_mapping(page)) { | ||
45 | #if defined(CONFIG_SH7705_CACHE_32KB) | ||
46 | int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); | ||
47 | if (dirty) { | ||
48 | unsigned long addr = (unsigned long)page_address(page); | ||
49 | |||
50 | if (pages_do_alias(addr, address & PAGE_MASK)) | ||
51 | __flush_wback_region((void *)addr, PAGE_SIZE); | ||
52 | } | ||
53 | #endif | ||
54 | } | ||
55 | |||
56 | local_irq_save(flags); | 40 | local_irq_save(flags); |
57 | 41 | ||
58 | /* Set PTEH register */ | 42 | /* Set PTEH register */ |
@@ -93,4 +77,3 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page) | |||
93 | for (i = 0; i < ways; i++) | 77 | for (i = 0; i < ways; i++) |
94 | ctrl_outl(data, addr + (i << 8)); | 78 | ctrl_outl(data, addr + (i << 8)); |
95 | } | 79 | } |
96 | |||