Skip to content

Commit

Permalink
[PATCH] ppc64: add early_pfn_to_nid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Jun 23, 2005
1 parent 29751f6 commit 510f8fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/ppc64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions include/asm-ppc64/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */

0 comments on commit 510f8fa

Please sign in to comment.