1 /* 2 * Written by Pat Gaughen (gone@us.ibm.com) Mar 2002 3 * 4 */ 5 6 #ifndef _ASM_X86_MMZONE_32_H 7 #define _ASM_X86_MMZONE_32_H 8 9 #include <asm/smp.h> 10 11 #ifdef CONFIG_NUMA 12 extern struct pglist_data *node_data[]; 13 #define NODE_DATA(nid) (node_data[nid]) 14 15 #include <asm/numaq.h> 16 17 #endif /* CONFIG_NUMA */ 18 19 #ifdef CONFIG_DISCONTIGMEM 20 21 /* 22 * generic node memory support, the following assumptions apply: 23 * 24 * 1) memory comes in 64Mb contiguous chunks which are either present or not 25 * 2) we will not have more than 64Gb in total 26 * 27 * for now assume that 64Gb is max amount of RAM for whole system 28 * 64Gb / 4096bytes/page = 16777216 pages 29 */ 30 #define MAX_NR_PAGES 16777216 31 #define MAX_SECTIONS 1024 32 #define PAGES_PER_SECTION (MAX_NR_PAGES/MAX_SECTIONS) 33 34 extern s8 physnode_map[]; 35 36 static inline int pfn_to_nid(unsigned long pfn) 37 { 38 #ifdef CONFIG_NUMA 39 return((int) physnode_map[(pfn) / PAGES_PER_SECTION]); 40 #else 41 return 0; 42 #endif 43 } 44 45 static inline int pfn_valid(int pfn) 46 { 47 int nid = pfn_to_nid(pfn); 48 49 if (nid >= 0) 50 return (pfn < node_end_pfn(nid)); 51 return 0; 52 } 53 54 #define early_pfn_valid(pfn) pfn_valid((pfn)) 55 56 #endif /* CONFIG_DISCONTIGMEM */ 57 58 #endif /* _ASM_X86_MMZONE_32_H */ 59