]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-x86_64/mmzone.h
[PATCH] kprobes: arch_remove_kprobe
[linux-2.6-omap-h63xx.git] / include / asm-x86_64 / mmzone.h
index b40c661f111e32b58f2c07bdd081a89fa4aa4b40..69baaa8a3ce0078b5f9226b218bc0944272bc9c4 100644 (file)
 /* 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;   \