diff options
Diffstat (limited to 'include/asm-x86/mmzone_32.h')
-rw-r--r-- | include/asm-x86/mmzone_32.h | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/include/asm-x86/mmzone_32.h b/include/asm-x86/mmzone_32.h index cb2cad0b65a7..b2298a227567 100644 --- a/include/asm-x86/mmzone_32.h +++ b/include/asm-x86/mmzone_32.h | |||
@@ -12,11 +12,9 @@ | |||
12 | extern struct pglist_data *node_data[]; | 12 | extern struct pglist_data *node_data[]; |
13 | #define NODE_DATA(nid) (node_data[nid]) | 13 | #define NODE_DATA(nid) (node_data[nid]) |
14 | 14 | ||
15 | #ifdef CONFIG_X86_NUMAQ | 15 | #include <asm/numaq.h> |
16 | #include <asm/numaq.h> | 16 | /* summit or generic arch */ |
17 | #elif defined(CONFIG_ACPI_SRAT)/* summit or generic arch */ | 17 | #include <asm/srat.h> |
18 | #include <asm/srat.h> | ||
19 | #endif | ||
20 | 18 | ||
21 | extern int get_memcfg_numa_flat(void); | 19 | extern int get_memcfg_numa_flat(void); |
22 | /* | 20 | /* |
@@ -26,28 +24,20 @@ extern int get_memcfg_numa_flat(void); | |||
26 | */ | 24 | */ |
27 | static inline void get_memcfg_numa(void) | 25 | static inline void get_memcfg_numa(void) |
28 | { | 26 | { |
29 | #ifdef CONFIG_X86_NUMAQ | 27 | |
30 | if (get_memcfg_numaq()) | 28 | if (get_memcfg_numaq()) |
31 | return; | 29 | return; |
32 | #elif defined(CONFIG_ACPI_SRAT) | ||
33 | if (get_memcfg_from_srat()) | 30 | if (get_memcfg_from_srat()) |
34 | return; | 31 | return; |
35 | #endif | ||
36 | |||
37 | get_memcfg_numa_flat(); | 32 | get_memcfg_numa_flat(); |
38 | } | 33 | } |
39 | 34 | ||
40 | extern int early_pfn_to_nid(unsigned long pfn); | 35 | extern int early_pfn_to_nid(unsigned long pfn); |
41 | extern void numa_kva_reserve(void); | ||
42 | 36 | ||
43 | #else /* !CONFIG_NUMA */ | 37 | #else /* !CONFIG_NUMA */ |
44 | 38 | ||
45 | #define get_memcfg_numa get_memcfg_numa_flat | 39 | #define get_memcfg_numa get_memcfg_numa_flat |
46 | #define get_zholes_size(n) (0) | ||
47 | 40 | ||
48 | static inline void numa_kva_reserve(void) | ||
49 | { | ||
50 | } | ||
51 | #endif /* CONFIG_NUMA */ | 41 | #endif /* CONFIG_NUMA */ |
52 | 42 | ||
53 | #ifdef CONFIG_DISCONTIGMEM | 43 | #ifdef CONFIG_DISCONTIGMEM |
@@ -55,14 +45,14 @@ static inline void numa_kva_reserve(void) | |||
55 | /* | 45 | /* |
56 | * generic node memory support, the following assumptions apply: | 46 | * generic node memory support, the following assumptions apply: |
57 | * | 47 | * |
58 | * 1) memory comes in 256Mb contigious chunks which are either present or not | 48 | * 1) memory comes in 64Mb contigious chunks which are either present or not |
59 | * 2) we will not have more than 64Gb in total | 49 | * 2) we will not have more than 64Gb in total |
60 | * | 50 | * |
61 | * for now assume that 64Gb is max amount of RAM for whole system | 51 | * for now assume that 64Gb is max amount of RAM for whole system |
62 | * 64Gb / 4096bytes/page = 16777216 pages | 52 | * 64Gb / 4096bytes/page = 16777216 pages |
63 | */ | 53 | */ |
64 | #define MAX_NR_PAGES 16777216 | 54 | #define MAX_NR_PAGES 16777216 |
65 | #define MAX_ELEMENTS 256 | 55 | #define MAX_ELEMENTS 1024 |
66 | #define PAGES_PER_ELEMENT (MAX_NR_PAGES/MAX_ELEMENTS) | 56 | #define PAGES_PER_ELEMENT (MAX_NR_PAGES/MAX_ELEMENTS) |
67 | 57 | ||
68 | extern s8 physnode_map[]; | 58 | extern s8 physnode_map[]; |
@@ -87,9 +77,6 @@ static inline int pfn_to_nid(unsigned long pfn) | |||
87 | __pgdat->node_start_pfn + __pgdat->node_spanned_pages; \ | 77 | __pgdat->node_start_pfn + __pgdat->node_spanned_pages; \ |
88 | }) | 78 | }) |
89 | 79 | ||
90 | #ifdef CONFIG_X86_NUMAQ /* we have contiguous memory on NUMA-Q */ | ||
91 | #define pfn_valid(pfn) ((pfn) < num_physpages) | ||
92 | #else | ||
93 | static inline int pfn_valid(int pfn) | 80 | static inline int pfn_valid(int pfn) |
94 | { | 81 | { |
95 | int nid = pfn_to_nid(pfn); | 82 | int nid = pfn_to_nid(pfn); |
@@ -98,7 +85,6 @@ static inline int pfn_valid(int pfn) | |||
98 | return (pfn < node_end_pfn(nid)); | 85 | return (pfn < node_end_pfn(nid)); |
99 | return 0; | 86 | return 0; |
100 | } | 87 | } |
101 | #endif /* CONFIG_X86_NUMAQ */ | ||
102 | 88 | ||
103 | #endif /* CONFIG_DISCONTIGMEM */ | 89 | #endif /* CONFIG_DISCONTIGMEM */ |
104 | 90 | ||