lkml.org 
[lkml]   [2006]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC][PATCH] unify pfn_to_page [3/25] arm pfn_toPage/page_to_pfn
PFN_TO_NID()/ LOCAL_MAP_NR() is defined by each subarch.

arm can use generic funcs.

Signed-Off-By: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Index: cleanup_pfn_page/include/asm-arm/memory.h
===================================================================
--- cleanup_pfn_page.orig/include/asm-arm/memory.h
+++ cleanup_pfn_page/include/asm-arm/memory.h
@@ -172,9 +172,7 @@ static inline __deprecated void *bus_to_
* virt_addr_valid(k) indicates whether a virtual address is valid
*/
#ifndef CONFIG_DISCONTIGMEM
-
-#define page_to_pfn(page) (((page) - mem_map) + PHYS_PFN_OFFSET)
-#define pfn_to_page(pfn) ((mem_map + (pfn)) - PHYS_PFN_OFFSET)
+#define ARCH_PFN_OFFSET (PHYS_PFN_OFFSET)
#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))

#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))
@@ -190,12 +188,8 @@ static inline __deprecated void *bus_to_
*/
#include <linux/numa.h>

-#define page_to_pfn(page) \
- (( (page) - page_zone(page)->zone_mem_map) \
- + page_zone(page)->zone_start_pfn)
-
-#define pfn_to_page(pfn) \
- (PFN_TO_MAPBASE(pfn) + LOCAL_MAP_NR((pfn) << PAGE_SHIFT))
+#define arch_pfn_to_nid(pfn) (PFN_TO_NID(pfn))
+#define arch_local_map_nr(pfn, nid) (LOCAL_MAP_NR((pfn) << PAGE_SHIFT))

#define pfn_valid(pfn) \
({ \
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-06 11:51    [W:0.024 / U:0.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site