X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-x86_64%2Fmmzone.h;h=972c9359f7d739ff5ffe4f34b2450a218faeaeab;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=c38ebdf6f426ad41ddfc19fc8df42553eae4b5a6;hpb=3944158a6d33f94668dbd6bdc32ff5c67bb53ec2;p=linux-2.6.git diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index c38ebdf6f..972c9359f 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h @@ -4,6 +4,7 @@ #ifndef _ASM_X86_64_MMZONE_H #define _ASM_X86_64_MMZONE_H 1 +#include #ifdef CONFIG_NUMA @@ -11,17 +12,11 @@ #include -/* Should really switch to dynamic allocation at some point */ -#define NODEMAPSIZE 0x4fff +#define NODEMAPSIZE 0xfff /* Simple perfect hash to map physical addresses to node numbers */ -struct memnode { - int shift; - u8 map[NODEMAPSIZE]; -} ____cacheline_aligned; -extern struct memnode memnode; -#define memnode_shift memnode.shift -#define memnodemap memnode.map +extern int memnode_shift; +extern u8 memnodemap[NODEMAPSIZE]; extern struct pglist_data *node_data[]; @@ -42,9 +37,14 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) #ifdef CONFIG_DISCONTIGMEM #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) +#define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr)) +extern struct page *pfn_to_page(unsigned long pfn); +extern unsigned long page_to_pfn(struct page *page); extern int pfn_valid(unsigned long pfn); #endif +#define local_mapnr(kvaddr) \ + ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) ) #endif #endif