diff options
Diffstat (limited to 'arch/sh/mm/tlb-sh3.c')
-rw-r--r-- | arch/sh/mm/tlb-sh3.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c index 17cb7c3adf22..9b8459c74abd 100644 --- a/arch/sh/mm/tlb-sh3.c +++ b/arch/sh/mm/tlb-sh3.c | |||
@@ -33,25 +33,25 @@ void update_mmu_cache(struct vm_area_struct * vma, | |||
33 | unsigned long flags; | 33 | unsigned long flags; |
34 | unsigned long pteval; | 34 | unsigned long pteval; |
35 | unsigned long vpn; | 35 | unsigned long vpn; |
36 | unsigned long pfn = pte_pfn(pte); | ||
37 | struct page *page; | ||
36 | 38 | ||
37 | /* Ptrace may call this routine. */ | 39 | /* Ptrace may call this routine. */ |
38 | if (vma && current->active_mm != vma->vm_mm) | 40 | if (vma && current->active_mm != vma->vm_mm) |
39 | return; | 41 | return; |
40 | 42 | ||
43 | page = pfn_to_page(pfn); | ||
44 | if (pfn_valid(pfn) && page_mapping(page)) { | ||
41 | #if defined(CONFIG_SH7705_CACHE_32KB) | 45 | #if defined(CONFIG_SH7705_CACHE_32KB) |
42 | { | 46 | int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); |
43 | struct page *page = pte_page(pte); | 47 | if (dirty) { |
44 | unsigned long pfn = pte_pfn(pte); | 48 | unsigned long addr = (unsigned long)page_address(page); |
45 | 49 | ||
46 | if (pfn_valid(pfn) && !test_bit(PG_mapped, &page->flags)) { | 50 | if (pages_do_alias(addr, address & PAGE_MASK)) |
47 | unsigned long phys = pte_val(pte) & PTE_PHYS_MASK; | 51 | __flush_wback_region((void *)addr, PAGE_SIZE); |
48 | |||
49 | __flush_wback_region((void *)P1SEGADDR(phys), | ||
50 | PAGE_SIZE); | ||
51 | __set_bit(PG_mapped, &page->flags); | ||
52 | } | 52 | } |
53 | } | ||
54 | #endif | 53 | #endif |
54 | } | ||
55 | 55 | ||
56 | local_irq_save(flags); | 56 | local_irq_save(flags); |
57 | 57 | ||