diff options
| author | Roman Zippel <zippel@linux-m68k.org> | 2002-05-03 00:03:30 -0700 |
|---|---|---|
| committer | Russell King <rmk@arm.linux.org.uk> | 2002-05-03 00:03:30 -0700 |
| commit | 5528f050dc6302b7f3cf66b97c5426f25ecfc6cc (patch) | |
| tree | ec3dedf4b740349f246460fcbb5e2698da1741ae /arch/sh/mm/fault.c | |
| parent | 31efb48daafb03968411eb62e456df22796a8c9e (diff) | |
[PATCH] 2.5.13: remove VALID_PAGE
This patch removes VALID_PAGE(), as the test was always too late for
discontinous memory configuration. It is replaced with pfn_valid()/
virt_addr_valid(), which are used to test the original input value.
Other helper functions:
pte_pfn() - extract the page number from a pte
pfn_to_page()/page_to_pfn() - convert a page number to/from a page struct
Diffstat (limited to 'arch/sh/mm/fault.c')
| -rw-r--r-- | arch/sh/mm/fault.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index a169b0bedca8..97c716854a97 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c @@ -290,6 +290,7 @@ void update_mmu_cache(struct vm_area_struct * vma, unsigned long vpn; #if defined(__SH4__) struct page *page; + unsigned long pfn; unsigned long ptea; #endif @@ -298,11 +299,14 @@ void update_mmu_cache(struct vm_area_struct * vma, return; #if defined(__SH4__) - page = pte_page(pte); - if (VALID_PAGE(page) && !test_bit(PG_mapped, &page->flags)) { - unsigned long phys = pte_val(pte) & PTE_PHYS_MASK; - __flush_wback_region((void *)P1SEGADDR(phys), PAGE_SIZE); - __set_bit(PG_mapped, &page->flags); + pfn = pte_pfn(pte); + if (pfn_valid(pfn)) { + page = pfn_to_page(pfn); + if (!test_bit(PG_mapped, &page->flags)) { + unsigned long phys = pte_val(pte) & PTE_PHYS_MASK; + __flush_wback_region((void *)P1SEGADDR(phys), PAGE_SIZE); + __set_bit(PG_mapped, &page->flags); + } } #endif |
