summaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/mm/fault.c2
-rw-r--r--arch/sparc64/mm/generic.c6
-rw-r--r--arch/sparc64/mm/init.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 63da67c8e..cd4b3365c 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -110,7 +110,7 @@ static unsigned int get_user_insn(unsigned long tpc)
if(!pte_present(pte))
goto out;
- pa = phys_base + (pte_pagenr(pte) << PAGE_SHIFT);
+ pa = phys_base + (sparc64_pte_pagenr(pte) << PAGE_SHIFT);
pa += (tpc & ~PAGE_MASK);
/* Use phys bypass so we don't pollute dtlb/dcache. */
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c
index 9a1ab1de3..c469c6062 100644
--- a/arch/sparc64/mm/generic.c
+++ b/arch/sparc64/mm/generic.c
@@ -18,14 +18,14 @@ static inline void forget_pte(pte_t page)
if (pte_none(page))
return;
if (pte_present(page)) {
- unsigned long nr = pte_pagenr(page);
- if (nr >= max_mapnr || PageReserved(mem_map+nr))
+ struct page *ptpage = pte_page(page);
+ if ((!VALID_PAGE(ptpage)) || PageReserved(ptpage))
return;
/*
* free_page() used to be able to clear swap cache
* entries. We may now have to do it manually.
*/
- free_page_and_swap_cache(mem_map+nr);
+ free_page_and_swap_cache(ptpage);
return;
}
swap_free(pte_to_swp_entry(page));
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index d3c9e5036..63994c51d 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -1242,7 +1242,7 @@ void free_initmem (void)
page = (addr +
((unsigned long) __va(phys_base)) -
((unsigned long) &empty_zero_page));
- p = mem_map + MAP_NR(page);
+ p = virt_to_page(page);
ClearPageReserved(p);
set_page_count(p, 1);
@@ -1257,7 +1257,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
if (start < end)
printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
for (; start < end; start += PAGE_SIZE) {
- struct page *p = mem_map + MAP_NR(start);
+ struct page *p = virt_to_page(start);
ClearPageReserved(p);
set_page_count(p, 1);