aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/memory.h
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2006-03-27 04:15:37 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:44:44 -0500
commit7eb98a2f3b605d8a11434d855b58d828393ea533 (patch)
tree4643bb90d8fe3e48ca8d042286ca3d55b8560d45 /include/asm-arm/memory.h
parent1c05dda2b6f025267ab79a267e0a84628a3760e1 (diff)
[PATCH] unify pfn_to_page: arm pfn_to_page
ARM can use generic funcs. PFN_TO_NID, LOCAL_MAP_NR are defined by sub-archs. Signed-off-by: KAMEZAWA Hirotuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-arm/memory.h')
-rw-r--r--include/asm-arm/memory.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index b4e1146ab682..afa5c3ea077c 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -172,9 +172,7 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
172 * virt_addr_valid(k) indicates whether a virtual address is valid 172 * virt_addr_valid(k) indicates whether a virtual address is valid
173 */ 173 */
174#ifndef CONFIG_DISCONTIGMEM 174#ifndef CONFIG_DISCONTIGMEM
175 175#define ARCH_PFN_OFFSET (PHYS_PFN_OFFSET)
176#define page_to_pfn(page) (((page) - mem_map) + PHYS_PFN_OFFSET)
177#define pfn_to_page(pfn) ((mem_map + (pfn)) - PHYS_PFN_OFFSET)
178#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr)) 176#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
179 177
180#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)) 178#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))
@@ -189,13 +187,8 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
189 * around in memory. 187 * around in memory.
190 */ 188 */
191#include <linux/numa.h> 189#include <linux/numa.h>
192 190#define arch_pfn_to_nid(pfn) (PFN_TO_NID(pfn))
193#define page_to_pfn(page) \ 191#define arch_local_page_offset(pfn, nid) (LOCAL_MAP_NR((pfn) << PAGE_OFFSET))
194 (( (page) - page_zone(page)->zone_mem_map) \
195 + page_zone(page)->zone_start_pfn)
196
197#define pfn_to_page(pfn) \
198 (PFN_TO_MAPBASE(pfn) + LOCAL_MAP_NR((pfn) << PAGE_SHIFT))
199 192
200#define pfn_valid(pfn) \ 193#define pfn_valid(pfn) \
201 ({ \ 194 ({ \
@@ -243,4 +236,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
243 236
244#endif 237#endif
245 238
239#include <asm-generic/memory_model.h>
240
246#endif 241#endif