aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/mm/srat.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>2007-02-02 11:48:22 -0500
committerLen Brown <len.brown@intel.com>2007-02-02 21:14:29 -0500
commit15a58ed12142939d51076380e6e58af477ad96ec (patch)
tree193dbd4637b3c1cd5d976215cece37a95041e499 /arch/x86_64/mm/srat.c
parent5f3b1a8b6737b09ce5df4ec9fad4ad271aecb5fb (diff)
ACPICA: Remove duplicate table definitions (non-conflicting), cont
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch/x86_64/mm/srat.c')
-rw-r--r--arch/x86_64/mm/srat.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 1087e150a218..2efe215fc76a 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -101,7 +101,7 @@ static __init inline int srat_disabled(void)
101static __init int slit_valid(struct acpi_table_slit *slit) 101static __init int slit_valid(struct acpi_table_slit *slit)
102{ 102{
103 int i, j; 103 int i, j;
104 int d = slit->localities; 104 int d = slit->locality_count;
105 for (i = 0; i < d; i++) { 105 for (i = 0; i < d; i++) {
106 for (j = 0; j < d; j++) { 106 for (j = 0; j < d; j++) {
107 u8 val = slit->entry[d*i + j]; 107 u8 val = slit->entry[d*i + j];
@@ -127,18 +127,18 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
127 127
128/* Callback for Proximity Domain -> LAPIC mapping */ 128/* Callback for Proximity Domain -> LAPIC mapping */
129void __init 129void __init
130acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) 130acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
131{ 131{
132 int pxm, node; 132 int pxm, node;
133 if (srat_disabled()) 133 if (srat_disabled())
134 return; 134 return;
135 if (pa->header.length != sizeof(struct acpi_table_processor_affinity)) { 135 if (pa->header.length != sizeof(struct acpi_srat_cpu_affinity)) {
136 bad_srat(); 136 bad_srat();
137 return; 137 return;
138 } 138 }
139 if (pa->flags.enabled == 0) 139 if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
140 return; 140 return;
141 pxm = pa->proximity_domain; 141 pxm = pa->proximity_domain_lo;
142 node = setup_node(pxm); 142 node = setup_node(pxm);
143 if (node < 0) { 143 if (node < 0) {
144 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); 144 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
@@ -254,21 +254,21 @@ static int reserve_hotadd(int node, unsigned long start, unsigned long end)
254 /* Looks good */ 254 /* Looks good */
255 255
256 if (nd->start == nd->end) { 256 if (nd->start == nd->end) {
257 nd->start = start; 257 nd->start = start;
258 nd->end = end; 258 nd->end = end;
259 changed = 1; 259 changed = 1;
260 } else { 260 } else {
261 if (nd->start == end) { 261 if (nd->start == end) {
262 nd->start = start; 262 nd->start = start;
263 changed = 1; 263 changed = 1;
264 } 264 }
265 if (nd->end == start) { 265 if (nd->end == start) {
266 nd->end = end; 266 nd->end = end;
267 changed = 1; 267 changed = 1;
268 } 268 }
269 if (!changed) 269 if (!changed)
270 printk(KERN_ERR "SRAT: Hotplug zone not continuous. Partly ignored\n"); 270 printk(KERN_ERR "SRAT: Hotplug zone not continuous. Partly ignored\n");
271 } 271 }
272 272
273 ret = update_end_of_memory(nd->end); 273 ret = update_end_of_memory(nd->end);
274 274
@@ -279,7 +279,7 @@ static int reserve_hotadd(int node, unsigned long start, unsigned long end)
279 279
280/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ 280/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
281void __init 281void __init
282acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) 282acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
283{ 283{
284 struct bootnode *nd, oldnode; 284 struct bootnode *nd, oldnode;
285 unsigned long start, end; 285 unsigned long start, end;
@@ -288,16 +288,17 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
288 288
289 if (srat_disabled()) 289 if (srat_disabled())
290 return; 290 return;
291 if (ma->header.length != sizeof(struct acpi_table_memory_affinity)) { 291 if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {
292 bad_srat(); 292 bad_srat();
293 return; 293 return;
294 } 294 }
295 if (ma->flags.enabled == 0) 295 if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
296 return; 296 return;
297 if (ma->flags.hot_pluggable && !save_add_info()) 297
298 if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && !save_add_info())
298 return; 299 return;
299 start = ma->base_addr_lo | ((u64)ma->base_addr_hi << 32); 300 start = ma->base_address;
300 end = start + (ma->length_lo | ((u64)ma->length_hi << 32)); 301 end = start + ma->length;
301 pxm = ma->proximity_domain; 302 pxm = ma->proximity_domain;
302 node = setup_node(pxm); 303 node = setup_node(pxm);
303 if (node < 0) { 304 if (node < 0) {
@@ -337,7 +338,8 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
337 push_node_boundaries(node, nd->start >> PAGE_SHIFT, 338 push_node_boundaries(node, nd->start >> PAGE_SHIFT,
338 nd->end >> PAGE_SHIFT); 339 nd->end >> PAGE_SHIFT);
339 340
340 if (ma->flags.hot_pluggable && (reserve_hotadd(node, start, end) < 0)) { 341 if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) &&
342 (reserve_hotadd(node, start, end) < 0)) {
341 /* Ignore hotadd region. Undo damage */ 343 /* Ignore hotadd region. Undo damage */
342 printk(KERN_NOTICE "SRAT: Hotplug region ignored\n"); 344 printk(KERN_NOTICE "SRAT: Hotplug region ignored\n");
343 *nd = oldnode; 345 *nd = oldnode;
@@ -394,7 +396,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
394 396
395 /* First clean up the node list */ 397 /* First clean up the node list */
396 for (i = 0; i < MAX_NUMNODES; i++) { 398 for (i = 0; i < MAX_NUMNODES; i++) {
397 cutoff_node(i, start, end); 399 cutoff_node(i, start, end);
398 if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) { 400 if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
399 unparse_node(i); 401 unparse_node(i);
400 node_set_offline(i); 402 node_set_offline(i);
@@ -426,7 +428,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
426 if (!node_online(i)) 428 if (!node_online(i))
427 setup_node_bootmem(i, nodes[i].start, nodes[i].end); 429 setup_node_bootmem(i, nodes[i].start, nodes[i].end);
428 430
429 for (i = 0; i < NR_CPUS; i++) { 431 for (i = 0; i < NR_CPUS; i++) {
430 if (cpu_to_node[i] == NUMA_NO_NODE) 432 if (cpu_to_node[i] == NUMA_NO_NODE)
431 continue; 433 continue;
432 if (!node_isset(cpu_to_node[i], nodes_parsed)) 434 if (!node_isset(cpu_to_node[i], nodes_parsed))
@@ -461,7 +463,7 @@ int __node_distance(int a, int b)
461 463
462 if (!acpi_slit) 464 if (!acpi_slit)
463 return a == b ? 10 : 20; 465 return a == b ? 10 : 20;
464 index = acpi_slit->localities * node_to_pxm(a); 466 index = acpi_slit->locality_count * node_to_pxm(a);
465 return acpi_slit->entry[index + node_to_pxm(b)]; 467 return acpi_slit->entry[index + node_to_pxm(b)];
466} 468}
467 469