summaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/page_32.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-01-14 12:14:53 +0100
committerDavid S. Miller <davem@davemloft.net>2010-01-14 12:14:53 +0100
commit8654164f54bd02787ae91db8526dcae8e7e34eeb (patch)
tree67d523ea1576aa6f9d475415fbb4b766ff6dc94b /arch/sparc/include/asm/page_32.h
parentsparc: Simplify param.h by simply including <asm-generic/param.h> (diff)
downloadlinux-8654164f54bd02787ae91db8526dcae8e7e34eeb.tar.xz
linux-8654164f54bd02787ae91db8526dcae8e7e34eeb.zip
sparc32: Fix page_to_phys().
It doesn't account for phys_base like it should, fix by using page_to_pfn(). While we're here, make virt_to_page() use pfn_to_page() as well, so we consistently use the asm/memory-model.h abstractions instead of open-coding memory model assumptions. Tested-by: Kristoffer Glembo <kristoffer@gaisler.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/include/asm/page_32.h')
-rw-r--r--arch/sparc/include/asm/page_32.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/include/asm/page_32.h b/arch/sparc/include/asm/page_32.h
index f72080bdda94..156707b0f18d 100644
--- a/arch/sparc/include/asm/page_32.h
+++ b/arch/sparc/include/asm/page_32.h
@@ -143,7 +143,7 @@ extern unsigned long pfn_base;
#define phys_to_virt __va
#define ARCH_PFN_OFFSET (pfn_base)
-#define virt_to_page(kaddr) (mem_map + ((((unsigned long)(kaddr)-PAGE_OFFSET)>>PAGE_SHIFT)))
+#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define pfn_valid(pfn) (((pfn) >= (pfn_base)) && (((pfn)-(pfn_base)) < max_mapnr))
#define virt_addr_valid(kaddr) ((((unsigned long)(kaddr)-PAGE_OFFSET)>>PAGE_SHIFT) < max_mapnr)