X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=include%2Fasm-x86_64%2Fmmzone.h;h=6944e7122df5194c767217444a993a90db3d6ede;hb=d3d3cf05eda861d807de539cac25bcefee0f9659;hp=972c9359f7d739ff5ffe4f34b2450a218faeaeab;hpb=9fdb62af92c741addbea15545f214a6e89460865;p=~andy%2Flinux diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index 972c9359f7d..6944e7122df 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h @@ -12,11 +12,17 @@ #include -#define NODEMAPSIZE 0xfff +/* Should really switch to dynamic allocation at some point */ +#define NODEMAPSIZE 0x4fff /* Simple perfect hash to map physical addresses to node numbers */ -extern int memnode_shift; -extern u8 memnodemap[NODEMAPSIZE]; +struct memnode { + int shift; + u8 map[NODEMAPSIZE]; +} ____cacheline_aligned; +extern struct memnode memnode; +#define memnode_shift memnode.shift +#define memnodemap memnode.map extern struct pglist_data *node_data[]; @@ -39,12 +45,8 @@ 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)) -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