aboutsummaryrefslogtreecommitdiff
path: root/include/asm-x86_64/mmzone.h
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-11-15 16:49:04 -0800
committerSteve French <sfrench@us.ibm.com>2005-11-15 16:49:04 -0800
commitc12489ad40a9db6b17225e0f38151d41c6175fe8 (patch)
treecf7ea08c0b3bf106975047c66b8bb0b560cc4e3e /include/asm-x86_64/mmzone.h
parentff7feac9638e162263463edaeb342b4f3b1ce90e (diff)
parent1e185b97b4364063f1135604b87f8d8469944233 (diff)
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'include/asm-x86_64/mmzone.h')
-rw-r--r--include/asm-x86_64/mmzone.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h
index b40c661f111..69baaa8a3ce 100644
--- a/include/asm-x86_64/mmzone.h
+++ b/include/asm-x86_64/mmzone.h
@@ -17,16 +17,15 @@
/* Simple perfect hash to map physical addresses to node numbers */
extern int memnode_shift;
extern u8 memnodemap[NODEMAPSIZE];
-extern int maxnode;
extern struct pglist_data *node_data[];
static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
{
- int nid;
+ unsigned nid;
VIRTUAL_BUG_ON((addr >> memnode_shift) >= NODEMAPSIZE);
nid = memnodemap[addr >> memnode_shift];
- VIRTUAL_BUG_ON(nid > maxnode);
+ VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]);
return nid;
}
@@ -41,9 +40,7 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
#define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT)
#define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr))
-/* AK: this currently doesn't deal with invalid addresses. We'll see
- if the 2.5 kernel doesn't pass them
- (2.4 used to). */
+/* Requires pfn_valid(pfn) to be true */
#define pfn_to_page(pfn) ({ \
int nid = phys_to_nid(((unsigned long)(pfn)) << PAGE_SHIFT); \
((pfn) - node_start_pfn(nid)) + NODE_DATA(nid)->node_mem_map; \