]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ppc64: add early_pfn_to_nid
authorAndy Whitcroft <apw@shadowen.org>
Thu, 23 Jun 2005 07:08:01 +0000 (00:08 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 23 Jun 2005 16:45:05 +0000 (09:45 -0700)
Provide an implementation of early_pfn_to_nid for PPC64.  This is used by
memory models to determine the node from which to take allocations before the
memory allocators are fully initialised.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Martin Bligh <mbligh@aracnet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc64/Kconfig
include/asm-ppc64/mmzone.h

index 85f8fcf44b6c728e465d4c64dd6d6325b7129027..3c8bfd0345cc0d962e1ecd3663496123df588a32 100644 (file)
@@ -211,6 +211,10 @@ config ARCH_FLATMEM_ENABLE
 
 source "mm/Kconfig"
 
+config HAVE_ARCH_EARLY_PFN_TO_NID
+       bool
+       default y
+
 # Some NUMA nodes have memory ranges that span
 # other nodes.  Even though a pfn is valid and
 # between a node's start and end pfns, it may not
index cbfc5ecfe87552c1ed21a0c9bf359cfbf841b6cf..ecc4b07507d65f097ed68e5498be6b6b65483e33 100644 (file)
@@ -90,4 +90,9 @@ static inline int pa_to_nid(unsigned long pa)
 #define discontigmem_pfn_valid(pfn)            ((pfn) < num_physpages)
 
 #endif /* CONFIG_DISCONTIGMEM */
+
+#ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
+#define early_pfn_to_nid(pfn)  pa_to_nid(((unsigned long)pfn) << PAGE_SHIFT)
+#endif
+
 #endif /* _ASM_MMZONE_H_ */