diff options
author | Len Brown <len.brown@intel.com> | 2007-02-06 15:31:00 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-06 15:31:00 -0500 |
commit | 57e1c5c87db512629dd44ddeb882a5aaf0e4299e (patch) | |
tree | e71e8a132d4f696beeae1bdab59efeed9517ba66 /arch/ia64/kernel/acpi.c | |
parent | 62d0cfcb27cf755cebdc93ca95dabc83608007cd (diff) | |
parent | 76a2e849df47697706024262a8bbb83432b8bde7 (diff) |
Pull test into release branch
Diffstat (limited to 'arch/ia64/kernel/acpi.c')
-rw-r--r-- | arch/ia64/kernel/acpi.c | 200 |
1 files changed, 92 insertions, 108 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 29f05d4b68cd..9197d7b361b3 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -55,7 +55,7 @@ | |||
55 | 55 | ||
56 | #define BAD_MADT_ENTRY(entry, end) ( \ | 56 | #define BAD_MADT_ENTRY(entry, end) ( \ |
57 | (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ | 57 | (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ |
58 | ((acpi_table_entry_header *)entry)->length < sizeof(*entry)) | 58 | ((struct acpi_subtable_header *)entry)->length < sizeof(*entry)) |
59 | 59 | ||
60 | #define PREFIX "ACPI: " | 60 | #define PREFIX "ACPI: " |
61 | 61 | ||
@@ -67,16 +67,11 @@ EXPORT_SYMBOL(pm_power_off); | |||
67 | unsigned int acpi_cpei_override; | 67 | unsigned int acpi_cpei_override; |
68 | unsigned int acpi_cpei_phys_cpuid; | 68 | unsigned int acpi_cpei_phys_cpuid; |
69 | 69 | ||
70 | #define MAX_SAPICS 256 | ||
71 | u16 ia64_acpiid_to_sapicid[MAX_SAPICS] = {[0 ... MAX_SAPICS - 1] = -1 }; | ||
72 | |||
73 | EXPORT_SYMBOL(ia64_acpiid_to_sapicid); | ||
74 | |||
75 | const char *acpi_get_sysname(void) | 70 | const char *acpi_get_sysname(void) |
76 | { | 71 | { |
77 | #ifdef CONFIG_IA64_GENERIC | 72 | #ifdef CONFIG_IA64_GENERIC |
78 | unsigned long rsdp_phys; | 73 | unsigned long rsdp_phys; |
79 | struct acpi20_table_rsdp *rsdp; | 74 | struct acpi_table_rsdp *rsdp; |
80 | struct acpi_table_xsdt *xsdt; | 75 | struct acpi_table_xsdt *xsdt; |
81 | struct acpi_table_header *hdr; | 76 | struct acpi_table_header *hdr; |
82 | 77 | ||
@@ -87,16 +82,16 @@ const char *acpi_get_sysname(void) | |||
87 | return "dig"; | 82 | return "dig"; |
88 | } | 83 | } |
89 | 84 | ||
90 | rsdp = (struct acpi20_table_rsdp *)__va(rsdp_phys); | 85 | rsdp = (struct acpi_table_rsdp *)__va(rsdp_phys); |
91 | if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) { | 86 | if (strncmp(rsdp->signature, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1)) { |
92 | printk(KERN_ERR | 87 | printk(KERN_ERR |
93 | "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n"); | 88 | "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n"); |
94 | return "dig"; | 89 | return "dig"; |
95 | } | 90 | } |
96 | 91 | ||
97 | xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address); | 92 | xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_physical_address); |
98 | hdr = &xsdt->header; | 93 | hdr = &xsdt->header; |
99 | if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) { | 94 | if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1)) { |
100 | printk(KERN_ERR | 95 | printk(KERN_ERR |
101 | "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n"); | 96 | "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n"); |
102 | return "dig"; | 97 | return "dig"; |
@@ -169,12 +164,12 @@ struct acpi_table_madt *acpi_madt __initdata; | |||
169 | static u8 has_8259; | 164 | static u8 has_8259; |
170 | 165 | ||
171 | static int __init | 166 | static int __init |
172 | acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header, | 167 | acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header, |
173 | const unsigned long end) | 168 | const unsigned long end) |
174 | { | 169 | { |
175 | struct acpi_table_lapic_addr_ovr *lapic; | 170 | struct acpi_madt_local_apic_override *lapic; |
176 | 171 | ||
177 | lapic = (struct acpi_table_lapic_addr_ovr *)header; | 172 | lapic = (struct acpi_madt_local_apic_override *)header; |
178 | 173 | ||
179 | if (BAD_MADT_ENTRY(lapic, end)) | 174 | if (BAD_MADT_ENTRY(lapic, end)) |
180 | return -EINVAL; | 175 | return -EINVAL; |
@@ -187,22 +182,19 @@ acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header, | |||
187 | } | 182 | } |
188 | 183 | ||
189 | static int __init | 184 | static int __init |
190 | acpi_parse_lsapic(acpi_table_entry_header * header, const unsigned long end) | 185 | acpi_parse_lsapic(struct acpi_subtable_header * header, const unsigned long end) |
191 | { | 186 | { |
192 | struct acpi_table_lsapic *lsapic; | 187 | struct acpi_madt_local_sapic *lsapic; |
193 | 188 | ||
194 | lsapic = (struct acpi_table_lsapic *)header; | 189 | lsapic = (struct acpi_madt_local_sapic *)header; |
195 | 190 | ||
196 | if (BAD_MADT_ENTRY(lsapic, end)) | 191 | /*Skip BAD_MADT_ENTRY check, as lsapic size could vary */ |
197 | return -EINVAL; | ||
198 | 192 | ||
199 | if (lsapic->flags.enabled) { | 193 | if (lsapic->lapic_flags & ACPI_MADT_ENABLED) { |
200 | #ifdef CONFIG_SMP | 194 | #ifdef CONFIG_SMP |
201 | smp_boot_data.cpu_phys_id[available_cpus] = | 195 | smp_boot_data.cpu_phys_id[available_cpus] = |
202 | (lsapic->id << 8) | lsapic->eid; | 196 | (lsapic->id << 8) | lsapic->eid; |
203 | #endif | 197 | #endif |
204 | ia64_acpiid_to_sapicid[lsapic->acpi_id] = | ||
205 | (lsapic->id << 8) | lsapic->eid; | ||
206 | ++available_cpus; | 198 | ++available_cpus; |
207 | } | 199 | } |
208 | 200 | ||
@@ -211,11 +203,11 @@ acpi_parse_lsapic(acpi_table_entry_header * header, const unsigned long end) | |||
211 | } | 203 | } |
212 | 204 | ||
213 | static int __init | 205 | static int __init |
214 | acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end) | 206 | acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long end) |
215 | { | 207 | { |
216 | struct acpi_table_lapic_nmi *lacpi_nmi; | 208 | struct acpi_madt_local_apic_nmi *lacpi_nmi; |
217 | 209 | ||
218 | lacpi_nmi = (struct acpi_table_lapic_nmi *)header; | 210 | lacpi_nmi = (struct acpi_madt_local_apic_nmi *)header; |
219 | 211 | ||
220 | if (BAD_MADT_ENTRY(lacpi_nmi, end)) | 212 | if (BAD_MADT_ENTRY(lacpi_nmi, end)) |
221 | return -EINVAL; | 213 | return -EINVAL; |
@@ -225,11 +217,11 @@ acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end) | |||
225 | } | 217 | } |
226 | 218 | ||
227 | static int __init | 219 | static int __init |
228 | acpi_parse_iosapic(acpi_table_entry_header * header, const unsigned long end) | 220 | acpi_parse_iosapic(struct acpi_subtable_header * header, const unsigned long end) |
229 | { | 221 | { |
230 | struct acpi_table_iosapic *iosapic; | 222 | struct acpi_madt_io_sapic *iosapic; |
231 | 223 | ||
232 | iosapic = (struct acpi_table_iosapic *)header; | 224 | iosapic = (struct acpi_madt_io_sapic *)header; |
233 | 225 | ||
234 | if (BAD_MADT_ENTRY(iosapic, end)) | 226 | if (BAD_MADT_ENTRY(iosapic, end)) |
235 | return -EINVAL; | 227 | return -EINVAL; |
@@ -240,13 +232,13 @@ acpi_parse_iosapic(acpi_table_entry_header * header, const unsigned long end) | |||
240 | static unsigned int __initdata acpi_madt_rev; | 232 | static unsigned int __initdata acpi_madt_rev; |
241 | 233 | ||
242 | static int __init | 234 | static int __init |
243 | acpi_parse_plat_int_src(acpi_table_entry_header * header, | 235 | acpi_parse_plat_int_src(struct acpi_subtable_header * header, |
244 | const unsigned long end) | 236 | const unsigned long end) |
245 | { | 237 | { |
246 | struct acpi_table_plat_int_src *plintsrc; | 238 | struct acpi_madt_interrupt_source *plintsrc; |
247 | int vector; | 239 | int vector; |
248 | 240 | ||
249 | plintsrc = (struct acpi_table_plat_int_src *)header; | 241 | plintsrc = (struct acpi_madt_interrupt_source *)header; |
250 | 242 | ||
251 | if (BAD_MADT_ENTRY(plintsrc, end)) | 243 | if (BAD_MADT_ENTRY(plintsrc, end)) |
252 | return -EINVAL; | 244 | return -EINVAL; |
@@ -257,19 +249,19 @@ acpi_parse_plat_int_src(acpi_table_entry_header * header, | |||
257 | */ | 249 | */ |
258 | vector = iosapic_register_platform_intr(plintsrc->type, | 250 | vector = iosapic_register_platform_intr(plintsrc->type, |
259 | plintsrc->global_irq, | 251 | plintsrc->global_irq, |
260 | plintsrc->iosapic_vector, | 252 | plintsrc->io_sapic_vector, |
261 | plintsrc->eid, | 253 | plintsrc->eid, |
262 | plintsrc->id, | 254 | plintsrc->id, |
263 | (plintsrc->flags.polarity == | 255 | ((plintsrc->inti_flags & ACPI_MADT_POLARITY_MASK) == |
264 | 1) ? IOSAPIC_POL_HIGH : | 256 | ACPI_MADT_POLARITY_ACTIVE_HIGH) ? |
265 | IOSAPIC_POL_LOW, | 257 | IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, |
266 | (plintsrc->flags.trigger == | 258 | ((plintsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) == |
267 | 1) ? IOSAPIC_EDGE : | 259 | ACPI_MADT_TRIGGER_EDGE) ? |
268 | IOSAPIC_LEVEL); | 260 | IOSAPIC_EDGE : IOSAPIC_LEVEL); |
269 | 261 | ||
270 | platform_intr_list[plintsrc->type] = vector; | 262 | platform_intr_list[plintsrc->type] = vector; |
271 | if (acpi_madt_rev > 1) { | 263 | if (acpi_madt_rev > 1) { |
272 | acpi_cpei_override = plintsrc->plint_flags.cpei_override_flag; | 264 | acpi_cpei_override = plintsrc->flags & ACPI_MADT_CPEI_OVERRIDE; |
273 | } | 265 | } |
274 | 266 | ||
275 | /* | 267 | /* |
@@ -324,30 +316,32 @@ unsigned int get_cpei_target_cpu(void) | |||
324 | } | 316 | } |
325 | 317 | ||
326 | static int __init | 318 | static int __init |
327 | acpi_parse_int_src_ovr(acpi_table_entry_header * header, | 319 | acpi_parse_int_src_ovr(struct acpi_subtable_header * header, |
328 | const unsigned long end) | 320 | const unsigned long end) |
329 | { | 321 | { |
330 | struct acpi_table_int_src_ovr *p; | 322 | struct acpi_madt_interrupt_override *p; |
331 | 323 | ||
332 | p = (struct acpi_table_int_src_ovr *)header; | 324 | p = (struct acpi_madt_interrupt_override *)header; |
333 | 325 | ||
334 | if (BAD_MADT_ENTRY(p, end)) | 326 | if (BAD_MADT_ENTRY(p, end)) |
335 | return -EINVAL; | 327 | return -EINVAL; |
336 | 328 | ||
337 | iosapic_override_isa_irq(p->bus_irq, p->global_irq, | 329 | iosapic_override_isa_irq(p->source_irq, p->global_irq, |
338 | (p->flags.polarity == | 330 | ((p->inti_flags & ACPI_MADT_POLARITY_MASK) == |
339 | 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, | 331 | ACPI_MADT_POLARITY_ACTIVE_HIGH) ? |
340 | (p->flags.trigger == | 332 | IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, |
341 | 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); | 333 | ((p->inti_flags & ACPI_MADT_TRIGGER_MASK) == |
334 | ACPI_MADT_TRIGGER_EDGE) ? | ||
335 | IOSAPIC_EDGE : IOSAPIC_LEVEL); | ||
342 | return 0; | 336 | return 0; |
343 | } | 337 | } |
344 | 338 | ||
345 | static int __init | 339 | static int __init |
346 | acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end) | 340 | acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end) |
347 | { | 341 | { |
348 | struct acpi_table_nmi_src *nmi_src; | 342 | struct acpi_madt_nmi_source *nmi_src; |
349 | 343 | ||
350 | nmi_src = (struct acpi_table_nmi_src *)header; | 344 | nmi_src = (struct acpi_madt_nmi_source *)header; |
351 | 345 | ||
352 | if (BAD_MADT_ENTRY(nmi_src, end)) | 346 | if (BAD_MADT_ENTRY(nmi_src, end)) |
353 | return -EINVAL; | 347 | return -EINVAL; |
@@ -371,12 +365,12 @@ static void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
371 | } | 365 | } |
372 | } | 366 | } |
373 | 367 | ||
374 | static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size) | 368 | static int __init acpi_parse_madt(struct acpi_table_header *table) |
375 | { | 369 | { |
376 | if (!phys_addr || !size) | 370 | if (!table) |
377 | return -EINVAL; | 371 | return -EINVAL; |
378 | 372 | ||
379 | acpi_madt = (struct acpi_table_madt *)__va(phys_addr); | 373 | acpi_madt = (struct acpi_table_madt *)table; |
380 | 374 | ||
381 | acpi_madt_rev = acpi_madt->header.revision; | 375 | acpi_madt_rev = acpi_madt->header.revision; |
382 | 376 | ||
@@ -384,14 +378,14 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size) | |||
384 | #ifdef CONFIG_ITANIUM | 378 | #ifdef CONFIG_ITANIUM |
385 | has_8259 = 1; /* Firmware on old Itanium systems is broken */ | 379 | has_8259 = 1; /* Firmware on old Itanium systems is broken */ |
386 | #else | 380 | #else |
387 | has_8259 = acpi_madt->flags.pcat_compat; | 381 | has_8259 = acpi_madt->flags & ACPI_MADT_PCAT_COMPAT; |
388 | #endif | 382 | #endif |
389 | iosapic_system_init(has_8259); | 383 | iosapic_system_init(has_8259); |
390 | 384 | ||
391 | /* Get base address of IPI Message Block */ | 385 | /* Get base address of IPI Message Block */ |
392 | 386 | ||
393 | if (acpi_madt->lapic_address) | 387 | if (acpi_madt->address) |
394 | ipi_base_addr = ioremap(acpi_madt->lapic_address, 0); | 388 | ipi_base_addr = ioremap(acpi_madt->address, 0); |
395 | 389 | ||
396 | printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr); | 390 | printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr); |
397 | 391 | ||
@@ -413,23 +407,24 @@ static u32 __devinitdata pxm_flag[PXM_FLAG_LEN]; | |||
413 | #define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag)) | 407 | #define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag)) |
414 | static struct acpi_table_slit __initdata *slit_table; | 408 | static struct acpi_table_slit __initdata *slit_table; |
415 | 409 | ||
416 | static int get_processor_proximity_domain(struct acpi_table_processor_affinity *pa) | 410 | static int get_processor_proximity_domain(struct acpi_srat_cpu_affinity *pa) |
417 | { | 411 | { |
418 | int pxm; | 412 | int pxm; |
419 | 413 | ||
420 | pxm = pa->proximity_domain; | 414 | pxm = pa->proximity_domain_lo; |
421 | if (ia64_platform_is("sn2")) | 415 | if (ia64_platform_is("sn2")) |
422 | pxm += pa->reserved[0] << 8; | 416 | pxm += pa->proximity_domain_hi[0] << 8; |
423 | return pxm; | 417 | return pxm; |
424 | } | 418 | } |
425 | 419 | ||
426 | static int get_memory_proximity_domain(struct acpi_table_memory_affinity *ma) | 420 | static int get_memory_proximity_domain(struct acpi_srat_mem_affinity *ma) |
427 | { | 421 | { |
428 | int pxm; | 422 | int pxm; |
429 | 423 | ||
430 | pxm = ma->proximity_domain; | 424 | pxm = ma->proximity_domain; |
431 | if (ia64_platform_is("sn2")) | 425 | if (!ia64_platform_is("sn2")) |
432 | pxm += ma->reserved1[0] << 8; | 426 | pxm &= 0xff; |
427 | |||
433 | return pxm; | 428 | return pxm; |
434 | } | 429 | } |
435 | 430 | ||
@@ -442,7 +437,7 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit) | |||
442 | u32 len; | 437 | u32 len; |
443 | 438 | ||
444 | len = sizeof(struct acpi_table_header) + 8 | 439 | len = sizeof(struct acpi_table_header) + 8 |
445 | + slit->localities * slit->localities; | 440 | + slit->locality_count * slit->locality_count; |
446 | if (slit->header.length != len) { | 441 | if (slit->header.length != len) { |
447 | printk(KERN_ERR | 442 | printk(KERN_ERR |
448 | "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n", | 443 | "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n", |
@@ -454,11 +449,11 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit) | |||
454 | } | 449 | } |
455 | 450 | ||
456 | void __init | 451 | void __init |
457 | acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) | 452 | acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) |
458 | { | 453 | { |
459 | int pxm; | 454 | int pxm; |
460 | 455 | ||
461 | if (!pa->flags.enabled) | 456 | if (!(pa->flags & ACPI_SRAT_CPU_ENABLED)) |
462 | return; | 457 | return; |
463 | 458 | ||
464 | pxm = get_processor_proximity_domain(pa); | 459 | pxm = get_processor_proximity_domain(pa); |
@@ -467,14 +462,14 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) | |||
467 | pxm_bit_set(pxm); | 462 | pxm_bit_set(pxm); |
468 | 463 | ||
469 | node_cpuid[srat_num_cpus].phys_id = | 464 | node_cpuid[srat_num_cpus].phys_id = |
470 | (pa->apic_id << 8) | (pa->lsapic_eid); | 465 | (pa->apic_id << 8) | (pa->local_sapic_eid); |
471 | /* nid should be overridden as logical node id later */ | 466 | /* nid should be overridden as logical node id later */ |
472 | node_cpuid[srat_num_cpus].nid = pxm; | 467 | node_cpuid[srat_num_cpus].nid = pxm; |
473 | srat_num_cpus++; | 468 | srat_num_cpus++; |
474 | } | 469 | } |
475 | 470 | ||
476 | void __init | 471 | void __init |
477 | acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) | 472 | acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) |
478 | { | 473 | { |
479 | unsigned long paddr, size; | 474 | unsigned long paddr, size; |
480 | int pxm; | 475 | int pxm; |
@@ -483,13 +478,11 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) | |||
483 | pxm = get_memory_proximity_domain(ma); | 478 | pxm = get_memory_proximity_domain(ma); |
484 | 479 | ||
485 | /* fill node memory chunk structure */ | 480 | /* fill node memory chunk structure */ |
486 | paddr = ma->base_addr_hi; | 481 | paddr = ma->base_address; |
487 | paddr = (paddr << 32) | ma->base_addr_lo; | 482 | size = ma->length; |
488 | size = ma->length_hi; | ||
489 | size = (size << 32) | ma->length_lo; | ||
490 | 483 | ||
491 | /* Ignore disabled entries */ | 484 | /* Ignore disabled entries */ |
492 | if (!ma->flags.enabled) | 485 | if (!(ma->flags & ACPI_SRAT_MEM_ENABLED)) |
493 | return; | 486 | return; |
494 | 487 | ||
495 | /* record this node in proximity bitmap */ | 488 | /* record this node in proximity bitmap */ |
@@ -560,16 +553,16 @@ void __init acpi_numa_arch_fixup(void) | |||
560 | if (!slit_table) | 553 | if (!slit_table) |
561 | return; | 554 | return; |
562 | memset(numa_slit, -1, sizeof(numa_slit)); | 555 | memset(numa_slit, -1, sizeof(numa_slit)); |
563 | for (i = 0; i < slit_table->localities; i++) { | 556 | for (i = 0; i < slit_table->locality_count; i++) { |
564 | if (!pxm_bit_test(i)) | 557 | if (!pxm_bit_test(i)) |
565 | continue; | 558 | continue; |
566 | node_from = pxm_to_node(i); | 559 | node_from = pxm_to_node(i); |
567 | for (j = 0; j < slit_table->localities; j++) { | 560 | for (j = 0; j < slit_table->locality_count; j++) { |
568 | if (!pxm_bit_test(j)) | 561 | if (!pxm_bit_test(j)) |
569 | continue; | 562 | continue; |
570 | node_to = pxm_to_node(j); | 563 | node_to = pxm_to_node(j); |
571 | node_distance(node_from, node_to) = | 564 | node_distance(node_from, node_to) = |
572 | slit_table->entry[i * slit_table->localities + j]; | 565 | slit_table->entry[i * slit_table->locality_count + j]; |
573 | } | 566 | } |
574 | } | 567 | } |
575 | 568 | ||
@@ -617,21 +610,21 @@ void acpi_unregister_gsi(u32 gsi) | |||
617 | 610 | ||
618 | EXPORT_SYMBOL(acpi_unregister_gsi); | 611 | EXPORT_SYMBOL(acpi_unregister_gsi); |
619 | 612 | ||
620 | static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size) | 613 | static int __init acpi_parse_fadt(struct acpi_table_header *table) |
621 | { | 614 | { |
622 | struct acpi_table_header *fadt_header; | 615 | struct acpi_table_header *fadt_header; |
623 | struct fadt_descriptor *fadt; | 616 | struct acpi_table_fadt *fadt; |
624 | 617 | ||
625 | if (!phys_addr || !size) | 618 | if (!table) |
626 | return -EINVAL; | 619 | return -EINVAL; |
627 | 620 | ||
628 | fadt_header = (struct acpi_table_header *)__va(phys_addr); | 621 | fadt_header = (struct acpi_table_header *)table; |
629 | if (fadt_header->revision != 3) | 622 | if (fadt_header->revision != 3) |
630 | return -ENODEV; /* Only deal with ACPI 2.0 FADT */ | 623 | return -ENODEV; /* Only deal with ACPI 2.0 FADT */ |
631 | 624 | ||
632 | fadt = (struct fadt_descriptor *)fadt_header; | 625 | fadt = (struct acpi_table_fadt *)fadt_header; |
633 | 626 | ||
634 | acpi_register_gsi(fadt->sci_int, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); | 627 | acpi_register_gsi(fadt->sci_interrupt, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); |
635 | return 0; | 628 | return 0; |
636 | } | 629 | } |
637 | 630 | ||
@@ -658,7 +651,7 @@ int __init acpi_boot_init(void) | |||
658 | * information -- the successor to MPS tables. | 651 | * information -- the successor to MPS tables. |
659 | */ | 652 | */ |
660 | 653 | ||
661 | if (acpi_table_parse(ACPI_APIC, acpi_parse_madt) < 1) { | 654 | if (acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt) < 1) { |
662 | printk(KERN_ERR PREFIX "Can't find MADT\n"); | 655 | printk(KERN_ERR PREFIX "Can't find MADT\n"); |
663 | goto skip_madt; | 656 | goto skip_madt; |
664 | } | 657 | } |
@@ -666,40 +659,40 @@ int __init acpi_boot_init(void) | |||
666 | /* Local APIC */ | 659 | /* Local APIC */ |
667 | 660 | ||
668 | if (acpi_table_parse_madt | 661 | if (acpi_table_parse_madt |
669 | (ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0) | 662 | (ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE, acpi_parse_lapic_addr_ovr, 0) < 0) |
670 | printk(KERN_ERR PREFIX | 663 | printk(KERN_ERR PREFIX |
671 | "Error parsing LAPIC address override entry\n"); | 664 | "Error parsing LAPIC address override entry\n"); |
672 | 665 | ||
673 | if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) | 666 | if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC, acpi_parse_lsapic, NR_CPUS) |
674 | < 1) | 667 | < 1) |
675 | printk(KERN_ERR PREFIX | 668 | printk(KERN_ERR PREFIX |
676 | "Error parsing MADT - no LAPIC entries\n"); | 669 | "Error parsing MADT - no LAPIC entries\n"); |
677 | 670 | ||
678 | if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) | 671 | if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0) |
679 | < 0) | 672 | < 0) |
680 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); | 673 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); |
681 | 674 | ||
682 | /* I/O APIC */ | 675 | /* I/O APIC */ |
683 | 676 | ||
684 | if (acpi_table_parse_madt | 677 | if (acpi_table_parse_madt |
685 | (ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1) | 678 | (ACPI_MADT_TYPE_IO_SAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1) |
686 | printk(KERN_ERR PREFIX | 679 | printk(KERN_ERR PREFIX |
687 | "Error parsing MADT - no IOSAPIC entries\n"); | 680 | "Error parsing MADT - no IOSAPIC entries\n"); |
688 | 681 | ||
689 | /* System-Level Interrupt Routing */ | 682 | /* System-Level Interrupt Routing */ |
690 | 683 | ||
691 | if (acpi_table_parse_madt | 684 | if (acpi_table_parse_madt |
692 | (ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, | 685 | (ACPI_MADT_TYPE_INTERRUPT_SOURCE, acpi_parse_plat_int_src, |
693 | ACPI_MAX_PLATFORM_INTERRUPTS) < 0) | 686 | ACPI_MAX_PLATFORM_INTERRUPTS) < 0) |
694 | printk(KERN_ERR PREFIX | 687 | printk(KERN_ERR PREFIX |
695 | "Error parsing platform interrupt source entry\n"); | 688 | "Error parsing platform interrupt source entry\n"); |
696 | 689 | ||
697 | if (acpi_table_parse_madt | 690 | if (acpi_table_parse_madt |
698 | (ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0) | 691 | (ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr, 0) < 0) |
699 | printk(KERN_ERR PREFIX | 692 | printk(KERN_ERR PREFIX |
700 | "Error parsing interrupt source overrides entry\n"); | 693 | "Error parsing interrupt source overrides entry\n"); |
701 | 694 | ||
702 | if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0) | 695 | if (acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, acpi_parse_nmi_src, 0) < 0) |
703 | printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); | 696 | printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); |
704 | skip_madt: | 697 | skip_madt: |
705 | 698 | ||
@@ -709,7 +702,7 @@ int __init acpi_boot_init(void) | |||
709 | * gets interrupts such as power and sleep buttons. If it's not | 702 | * gets interrupts such as power and sleep buttons. If it's not |
710 | * on a Legacy interrupt, it needs to be setup. | 703 | * on a Legacy interrupt, it needs to be setup. |
711 | */ | 704 | */ |
712 | if (acpi_table_parse(ACPI_FADT, acpi_parse_fadt) < 1) | 705 | if (acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt) < 1) |
713 | printk(KERN_ERR PREFIX "Can't find FADT\n"); | 706 | printk(KERN_ERR PREFIX "Can't find FADT\n"); |
714 | 707 | ||
715 | #ifdef CONFIG_SMP | 708 | #ifdef CONFIG_SMP |
@@ -842,7 +835,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
842 | { | 835 | { |
843 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 836 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
844 | union acpi_object *obj; | 837 | union acpi_object *obj; |
845 | struct acpi_table_lsapic *lsapic; | 838 | struct acpi_madt_local_sapic *lsapic; |
846 | cpumask_t tmp_map; | 839 | cpumask_t tmp_map; |
847 | long physid; | 840 | long physid; |
848 | int cpu; | 841 | int cpu; |
@@ -854,16 +847,16 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
854 | return -EINVAL; | 847 | return -EINVAL; |
855 | 848 | ||
856 | obj = buffer.pointer; | 849 | obj = buffer.pointer; |
857 | if (obj->type != ACPI_TYPE_BUFFER || | 850 | if (obj->type != ACPI_TYPE_BUFFER) |
858 | obj->buffer.length < sizeof(*lsapic)) { | 851 | { |
859 | kfree(buffer.pointer); | 852 | kfree(buffer.pointer); |
860 | return -EINVAL; | 853 | return -EINVAL; |
861 | } | 854 | } |
862 | 855 | ||
863 | lsapic = (struct acpi_table_lsapic *)obj->buffer.pointer; | 856 | lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer; |
864 | 857 | ||
865 | if ((lsapic->header.type != ACPI_MADT_LSAPIC) || | 858 | if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) || |
866 | (!lsapic->flags.enabled)) { | 859 | (!lsapic->lapic_flags & ACPI_MADT_ENABLED)) { |
867 | kfree(buffer.pointer); | 860 | kfree(buffer.pointer); |
868 | return -EINVAL; | 861 | return -EINVAL; |
869 | } | 862 | } |
@@ -883,7 +876,6 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
883 | 876 | ||
884 | cpu_set(cpu, cpu_present_map); | 877 | cpu_set(cpu, cpu_present_map); |
885 | ia64_cpu_to_sapicid[cpu] = physid; | 878 | ia64_cpu_to_sapicid[cpu] = physid; |
886 | ia64_acpiid_to_sapicid[lsapic->acpi_id] = ia64_cpu_to_sapicid[cpu]; | ||
887 | 879 | ||
888 | *pcpu = cpu; | 880 | *pcpu = cpu; |
889 | return (0); | 881 | return (0); |
@@ -893,14 +885,6 @@ EXPORT_SYMBOL(acpi_map_lsapic); | |||
893 | 885 | ||
894 | int acpi_unmap_lsapic(int cpu) | 886 | int acpi_unmap_lsapic(int cpu) |
895 | { | 887 | { |
896 | int i; | ||
897 | |||
898 | for (i = 0; i < MAX_SAPICS; i++) { | ||
899 | if (ia64_acpiid_to_sapicid[i] == ia64_cpu_to_sapicid[cpu]) { | ||
900 | ia64_acpiid_to_sapicid[i] = -1; | ||
901 | break; | ||
902 | } | ||
903 | } | ||
904 | ia64_cpu_to_sapicid[cpu] = -1; | 888 | ia64_cpu_to_sapicid[cpu] = -1; |
905 | cpu_clear(cpu, cpu_present_map); | 889 | cpu_clear(cpu, cpu_present_map); |
906 | 890 | ||
@@ -920,7 +904,7 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret) | |||
920 | { | 904 | { |
921 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 905 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
922 | union acpi_object *obj; | 906 | union acpi_object *obj; |
923 | struct acpi_table_iosapic *iosapic; | 907 | struct acpi_madt_io_sapic *iosapic; |
924 | unsigned int gsi_base; | 908 | unsigned int gsi_base; |
925 | int pxm, node; | 909 | int pxm, node; |
926 | 910 | ||
@@ -938,9 +922,9 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret) | |||
938 | return AE_OK; | 922 | return AE_OK; |
939 | } | 923 | } |
940 | 924 | ||
941 | iosapic = (struct acpi_table_iosapic *)obj->buffer.pointer; | 925 | iosapic = (struct acpi_madt_io_sapic *)obj->buffer.pointer; |
942 | 926 | ||
943 | if (iosapic->header.type != ACPI_MADT_IOSAPIC) { | 927 | if (iosapic->header.type != ACPI_MADT_TYPE_IO_SAPIC) { |
944 | kfree(buffer.pointer); | 928 | kfree(buffer.pointer); |
945 | return AE_OK; | 929 | return AE_OK; |
946 | } | 930 | } |