aboutsummaryrefslogtreecommitdiffstats
path: root/arch
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
commit5f3b1a8b6737b09ce5df4ec9fad4ad271aecb5fb (patch)
tree5b3e343ab0c4c963f681afc2bfbba815b26e045b /arch
parentad363f80c386bc4701b1bc2cdf08ca9b96a9337b (diff)
ACPICA: Remove duplicate table definitions (non-conflicting)
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/acpi/boot.c156
-rw-r--r--arch/ia64/kernel/acpi.c172
2 files changed, 160 insertions, 168 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 389a8a56d2b4..5fafbacdd4cb 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -66,7 +66,7 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return
66 66
67#define BAD_MADT_ENTRY(entry, end) ( \ 67#define BAD_MADT_ENTRY(entry, end) ( \
68 (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ 68 (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
69 ((acpi_table_entry_header *)entry)->length < sizeof(*entry)) 69 ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
70 70
71#define PREFIX "ACPI: " 71#define PREFIX "ACPI: "
72 72
@@ -79,7 +79,7 @@ int acpi_ioapic;
79int acpi_strict; 79int acpi_strict;
80EXPORT_SYMBOL(acpi_strict); 80EXPORT_SYMBOL(acpi_strict);
81 81
82acpi_interrupt_flags acpi_sci_flags __initdata; 82u8 acpi_sci_flags __initdata;
83int acpi_sci_override_gsi __initdata; 83int acpi_sci_override_gsi __initdata;
84int acpi_skip_timer_override __initdata; 84int acpi_skip_timer_override __initdata;
85int acpi_use_timer_override __initdata; 85int acpi_use_timer_override __initdata;
@@ -246,11 +246,11 @@ static int __init acpi_parse_madt(struct acpi_table_header *header)
246} 246}
247 247
248static int __init 248static int __init
249acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end) 249acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
250{ 250{
251 struct acpi_table_lapic *processor = NULL; 251 struct acpi_madt_local_apic *processor = NULL;
252 252
253 processor = (struct acpi_table_lapic *)header; 253 processor = (struct acpi_madt_local_apic *)header;
254 254
255 if (BAD_MADT_ENTRY(processor, end)) 255 if (BAD_MADT_ENTRY(processor, end))
256 return -EINVAL; 256 return -EINVAL;
@@ -258,8 +258,8 @@ acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end)
258 acpi_table_print_madt_entry(header); 258 acpi_table_print_madt_entry(header);
259 259
260 /* Record local apic id only when enabled */ 260 /* Record local apic id only when enabled */
261 if (processor->flags.enabled) 261 if (processor->lapic_flags & ACPI_MADT_ENABLED)
262 x86_acpiid_to_apicid[processor->acpi_id] = processor->id; 262 x86_acpiid_to_apicid[processor->processor_id] = processor->id;
263 263
264 /* 264 /*
265 * We need to register disabled CPU as well to permit 265 * We need to register disabled CPU as well to permit
@@ -269,18 +269,18 @@ acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end)
269 * when we use CPU hotplug. 269 * when we use CPU hotplug.
270 */ 270 */
271 mp_register_lapic(processor->id, /* APIC ID */ 271 mp_register_lapic(processor->id, /* APIC ID */
272 processor->flags.enabled); /* Enabled? */ 272 processor->lapic_flags & ACPI_MADT_ENABLED); /* Enabled? */
273 273
274 return 0; 274 return 0;
275} 275}
276 276
277static int __init 277static int __init
278acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header, 278acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header,
279 const unsigned long end) 279 const unsigned long end)
280{ 280{
281 struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL; 281 struct acpi_madt_local_apic_override *lapic_addr_ovr = NULL;
282 282
283 lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr *)header; 283 lapic_addr_ovr = (struct acpi_madt_local_apic_override *)header;
284 284
285 if (BAD_MADT_ENTRY(lapic_addr_ovr, end)) 285 if (BAD_MADT_ENTRY(lapic_addr_ovr, end))
286 return -EINVAL; 286 return -EINVAL;
@@ -291,11 +291,11 @@ acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
291} 291}
292 292
293static int __init 293static int __init
294acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end) 294acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long end)
295{ 295{
296 struct acpi_table_lapic_nmi *lapic_nmi = NULL; 296 struct acpi_madt_local_apic_nmi *lapic_nmi = NULL;
297 297
298 lapic_nmi = (struct acpi_table_lapic_nmi *)header; 298 lapic_nmi = (struct acpi_madt_local_apic_nmi *)header;
299 299
300 if (BAD_MADT_ENTRY(lapic_nmi, end)) 300 if (BAD_MADT_ENTRY(lapic_nmi, end))
301 return -EINVAL; 301 return -EINVAL;
@@ -313,11 +313,11 @@ acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
313#ifdef CONFIG_X86_IO_APIC 313#ifdef CONFIG_X86_IO_APIC
314 314
315static int __init 315static int __init
316acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end) 316acpi_parse_ioapic(struct acpi_subtable_header * header, const unsigned long end)
317{ 317{
318 struct acpi_table_ioapic *ioapic = NULL; 318 struct acpi_madt_io_apic *ioapic = NULL;
319 319
320 ioapic = (struct acpi_table_ioapic *)header; 320 ioapic = (struct acpi_madt_io_apic *)header;
321 321
322 if (BAD_MADT_ENTRY(ioapic, end)) 322 if (BAD_MADT_ENTRY(ioapic, end))
323 return -EINVAL; 323 return -EINVAL;
@@ -342,11 +342,11 @@ static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
342 polarity = 3; 342 polarity = 3;
343 343
344 /* Command-line over-ride via acpi_sci= */ 344 /* Command-line over-ride via acpi_sci= */
345 if (acpi_sci_flags.trigger) 345 if (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK)
346 trigger = acpi_sci_flags.trigger; 346 trigger = (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) >> 2;
347 347
348 if (acpi_sci_flags.polarity) 348 if (acpi_sci_flags & ACPI_MADT_POLARITY_MASK)
349 polarity = acpi_sci_flags.polarity; 349 polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK;
350 350
351 /* 351 /*
352 * mp_config_acpi_legacy_irqs() already setup IRQs < 16 352 * mp_config_acpi_legacy_irqs() already setup IRQs < 16
@@ -364,44 +364,45 @@ static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
364} 364}
365 365
366static int __init 366static int __init
367acpi_parse_int_src_ovr(acpi_table_entry_header * header, 367acpi_parse_int_src_ovr(struct acpi_subtable_header * header,
368 const unsigned long end) 368 const unsigned long end)
369{ 369{
370 struct acpi_table_int_src_ovr *intsrc = NULL; 370 struct acpi_madt_interrupt_override *intsrc = NULL;
371 371
372 intsrc = (struct acpi_table_int_src_ovr *)header; 372 intsrc = (struct acpi_madt_interrupt_override *)header;
373 373
374 if (BAD_MADT_ENTRY(intsrc, end)) 374 if (BAD_MADT_ENTRY(intsrc, end))
375 return -EINVAL; 375 return -EINVAL;
376 376
377 acpi_table_print_madt_entry(header); 377 acpi_table_print_madt_entry(header);
378 378
379 if (intsrc->bus_irq == acpi_gbl_FADT.sci_interrupt) { 379 if (intsrc->source_irq == acpi_gbl_FADT.sci_interrupt) {
380 acpi_sci_ioapic_setup(intsrc->global_irq, 380 acpi_sci_ioapic_setup(intsrc->global_irq,
381 intsrc->flags.polarity, 381 intsrc->inti_flags & ACPI_MADT_POLARITY_MASK,
382 intsrc->flags.trigger); 382 (intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2);
383 return 0; 383 return 0;
384 } 384 }
385 385
386 if (acpi_skip_timer_override && 386 if (acpi_skip_timer_override &&
387 intsrc->bus_irq == 0 && intsrc->global_irq == 2) { 387 intsrc->source_irq == 0 && intsrc->global_irq == 2) {
388 printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); 388 printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
389 return 0; 389 return 0;
390 } 390 }
391 391
392 mp_override_legacy_irq(intsrc->bus_irq, 392 mp_override_legacy_irq(intsrc->source_irq,
393 intsrc->flags.polarity, 393 intsrc->inti_flags & ACPI_MADT_POLARITY_MASK,
394 intsrc->flags.trigger, intsrc->global_irq); 394 (intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2,
395 intsrc->global_irq);
395 396
396 return 0; 397 return 0;
397} 398}
398 399
399static int __init 400static int __init
400acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end) 401acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end)
401{ 402{
402 struct acpi_table_nmi_src *nmi_src = NULL; 403 struct acpi_madt_nmi_source *nmi_src = NULL;
403 404
404 nmi_src = (struct acpi_table_nmi_src *)header; 405 nmi_src = (struct acpi_madt_nmi_source *)header;
405 406
406 if (BAD_MADT_ENTRY(nmi_src, end)) 407 if (BAD_MADT_ENTRY(nmi_src, end))
407 return -EINVAL; 408 return -EINVAL;
@@ -417,7 +418,7 @@ acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
417 418
418/* 419/*
419 * acpi_pic_sci_set_trigger() 420 * acpi_pic_sci_set_trigger()
420 * 421 *
421 * use ELCR to set PIC-mode trigger type for SCI 422 * use ELCR to set PIC-mode trigger type for SCI
422 * 423 *
423 * If a PIC-mode SCI is not recognized or gives spurious IRQ7's 424 * If a PIC-mode SCI is not recognized or gives spurious IRQ7's
@@ -511,7 +512,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
511{ 512{
512 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 513 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
513 union acpi_object *obj; 514 union acpi_object *obj;
514 struct acpi_table_lapic *lapic; 515 struct acpi_madt_local_apic *lapic;
515 cpumask_t tmp_map, new_map; 516 cpumask_t tmp_map, new_map;
516 u8 physid; 517 u8 physid;
517 int cpu; 518 int cpu;
@@ -529,10 +530,10 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
529 return -EINVAL; 530 return -EINVAL;
530 } 531 }
531 532
532 lapic = (struct acpi_table_lapic *)obj->buffer.pointer; 533 lapic = (struct acpi_madt_local_apic *)obj->buffer.pointer;
533 534
534 if ((lapic->header.type != ACPI_MADT_LAPIC) || 535 if (lapic->header.type != ACPI_MADT_TYPE_LOCAL_APIC ||
535 (!lapic->flags.enabled)) { 536 !(lapic->lapic_flags & ACPI_MADT_ENABLED)) {
536 kfree(buffer.pointer); 537 kfree(buffer.pointer);
537 return -EINVAL; 538 return -EINVAL;
538 } 539 }
@@ -544,7 +545,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
544 buffer.pointer = NULL; 545 buffer.pointer = NULL;
545 546
546 tmp_map = cpu_present_map; 547 tmp_map = cpu_present_map;
547 mp_register_lapic(physid, lapic->flags.enabled); 548 mp_register_lapic(physid, lapic->lapic_flags & ACPI_MADT_ENABLED);
548 549
549 /* 550 /*
550 * If mp_register_lapic successfully generates a new logical cpu 551 * If mp_register_lapic successfully generates a new logical cpu
@@ -619,36 +620,30 @@ acpi_scan_rsdp(unsigned long start, unsigned long length)
619 return 0; 620 return 0;
620} 621}
621 622
622static int __init acpi_parse_sbf(struct acpi_table_header *header) 623static int __init acpi_parse_sbf(struct acpi_table_header *table)
623{ 624{
624 struct acpi_table_sbf *sb; 625 struct acpi_table_boot *sb;
625
626 if (!header)
627 return -EINVAL;
628 626
629 sb = (struct acpi_table_sbf *)header; 627 sb = (struct acpi_table_boot *)table;
630 if (!sb) { 628 if (!sb) {
631 printk(KERN_WARNING PREFIX "Unable to map SBF\n"); 629 printk(KERN_WARNING PREFIX "Unable to map SBF\n");
632 return -ENODEV; 630 return -ENODEV;
633 } 631 }
634 632
635 sbf_port = sb->sbf_cmos; /* Save CMOS port */ 633 sbf_port = sb->cmos_index; /* Save CMOS port */
636 634
637 return 0; 635 return 0;
638} 636}
639 637
640#ifdef CONFIG_HPET_TIMER 638#ifdef CONFIG_HPET_TIMER
641 639
642static int __init acpi_parse_hpet(struct acpi_table_header *header) 640static int __init acpi_parse_hpet(struct acpi_table_header *table)
643{ 641{
644 struct acpi_table_hpet *hpet_tbl; 642 struct acpi_table_hpet *hpet_tbl;
645 struct resource *hpet_res; 643 struct resource *hpet_res;
646 resource_size_t res_start; 644 resource_size_t res_start;
647 645
648 if (!header) 646 hpet_tbl = (struct acpi_table_hpet *)table;
649 return -EINVAL;
650
651 hpet_tbl = (struct acpi_table_hpet *)header;
652 if (!hpet_tbl) { 647 if (!hpet_tbl) {
653 printk(KERN_WARNING PREFIX "Unable to map HPET\n"); 648 printk(KERN_WARNING PREFIX "Unable to map HPET\n");
654 return -ENODEV; 649 return -ENODEV;
@@ -706,35 +701,28 @@ static int __init acpi_parse_hpet(struct acpi_table_header *header)
706extern u32 pmtmr_ioport; 701extern u32 pmtmr_ioport;
707#endif 702#endif
708 703
709static int __init acpi_parse_fadt(struct acpi_table_header *header) 704static int __init acpi_parse_fadt(struct acpi_table_header *table)
710{ 705{
711 struct acpi_table_fadt *fadt = NULL;
712
713 fadt = (struct acpi_table_fadt *)header;
714 if (!fadt) {
715 printk(KERN_WARNING PREFIX "Unable to map FADT\n");
716 return 0;
717 }
718 706
719#ifdef CONFIG_X86_PM_TIMER 707#ifdef CONFIG_X86_PM_TIMER
720 /* detect the location of the ACPI PM Timer */ 708 /* detect the location of the ACPI PM Timer */
721 if (fadt->header.revision >= FADT2_REVISION_ID) { 709 if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) {
722 /* FADT rev. 2 */ 710 /* FADT rev. 2 */
723 if (fadt->xpm_timer_block.space_id != 711 if (acpi_gbl_FADT.xpm_timer_block.space_id !=
724 ACPI_ADR_SPACE_SYSTEM_IO) 712 ACPI_ADR_SPACE_SYSTEM_IO)
725 return 0; 713 return 0;
726 714
727 pmtmr_ioport = fadt->xpm_timer_block.address; 715 pmtmr_ioport = acpi_gbl_FADT.xpm_timer_block.address;
728 /* 716 /*
729 * "X" fields are optional extensions to the original V1.0 717 * "X" fields are optional extensions to the original V1.0
730 * fields, so we must selectively expand V1.0 fields if the 718 * fields, so we must selectively expand V1.0 fields if the
731 * corresponding X field is zero. 719 * corresponding X field is zero.
732 */ 720 */
733 if (!pmtmr_ioport) 721 if (!pmtmr_ioport)
734 pmtmr_ioport = fadt->pm_timer_block; 722 pmtmr_ioport = acpi_gbl_FADT.pm_timer_block;
735 } else { 723 } else {
736 /* FADT rev. 1 */ 724 /* FADT rev. 1 */
737 pmtmr_ioport = fadt->pm_timer_block; 725 pmtmr_ioport = acpi_gbl_FADT.pm_timer_block;
738 } 726 }
739 if (pmtmr_ioport) 727 if (pmtmr_ioport)
740 printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", 728 printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n",
@@ -776,13 +764,13 @@ static int __init acpi_parse_madt_lapic_entries(void)
776 if (!cpu_has_apic) 764 if (!cpu_has_apic)
777 return -ENODEV; 765 return -ENODEV;
778 766
779 /* 767 /*
780 * Note that the LAPIC address is obtained from the MADT (32-bit value) 768 * Note that the LAPIC address is obtained from the MADT (32-bit value)
781 * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). 769 * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
782 */ 770 */
783 771
784 count = 772 count =
785 acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, 773 acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE,
786 acpi_parse_lapic_addr_ovr, 0); 774 acpi_parse_lapic_addr_ovr, 0);
787 if (count < 0) { 775 if (count < 0) {
788 printk(KERN_ERR PREFIX 776 printk(KERN_ERR PREFIX
@@ -792,7 +780,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
792 780
793 mp_register_lapic_address(acpi_lapic_addr); 781 mp_register_lapic_address(acpi_lapic_addr);
794 782
795 count = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic, 783 count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC, acpi_parse_lapic,
796 MAX_APICS); 784 MAX_APICS);
797 if (!count) { 785 if (!count) {
798 printk(KERN_ERR PREFIX "No LAPIC entries present\n"); 786 printk(KERN_ERR PREFIX "No LAPIC entries present\n");
@@ -805,7 +793,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
805 } 793 }
806 794
807 count = 795 count =
808 acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0); 796 acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0);
809 if (count < 0) { 797 if (count < 0) {
810 printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); 798 printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
811 /* TBD: Cleanup to allow fallback to MPS */ 799 /* TBD: Cleanup to allow fallback to MPS */
@@ -834,7 +822,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
834 return -ENODEV; 822 return -ENODEV;
835 } 823 }
836 824
837 if (!cpu_has_apic) 825 if (!cpu_has_apic)
838 return -ENODEV; 826 return -ENODEV;
839 827
840 /* 828 /*
@@ -847,7 +835,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
847 } 835 }
848 836
849 count = 837 count =
850 acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic, 838 acpi_table_parse_madt(ACPI_MADT_TYPE_IO_APIC, acpi_parse_ioapic,
851 MAX_IO_APICS); 839 MAX_IO_APICS);
852 if (!count) { 840 if (!count) {
853 printk(KERN_ERR PREFIX "No IOAPIC entries present\n"); 841 printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
@@ -858,7 +846,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
858 } 846 }
859 847
860 count = 848 count =
861 acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 849 acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr,
862 NR_IRQ_VECTORS); 850 NR_IRQ_VECTORS);
863 if (count < 0) { 851 if (count < 0) {
864 printk(KERN_ERR PREFIX 852 printk(KERN_ERR PREFIX
@@ -878,7 +866,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
878 mp_config_acpi_legacy_irqs(); 866 mp_config_acpi_legacy_irqs();
879 867
880 count = 868 count =
881 acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 869 acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, acpi_parse_nmi_src,
882 NR_IRQ_VECTORS); 870 NR_IRQ_VECTORS);
883 if (count < 0) { 871 if (count < 0) {
884 printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); 872 printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
@@ -900,7 +888,7 @@ static void __init acpi_process_madt(void)
900#ifdef CONFIG_X86_LOCAL_APIC 888#ifdef CONFIG_X86_LOCAL_APIC
901 int count, error; 889 int count, error;
902 890
903 count = acpi_table_parse("APIC", acpi_parse_madt); 891 count = acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt);
904 if (count >= 1) { 892 if (count >= 1) {
905 893
906 /* 894 /*
@@ -1187,7 +1175,7 @@ int __init acpi_boot_table_init(void)
1187 if (acpi_disabled && !acpi_ht) 1175 if (acpi_disabled && !acpi_ht)
1188 return 1; 1176 return 1;
1189 1177
1190 /* 1178 /*
1191 * Initialize the ACPI boot-time table parser. 1179 * Initialize the ACPI boot-time table parser.
1192 */ 1180 */
1193 error = acpi_table_init(); 1181 error = acpi_table_init();
@@ -1196,7 +1184,7 @@ int __init acpi_boot_table_init(void)
1196 return error; 1184 return error;
1197 } 1185 }
1198 1186
1199 acpi_table_parse("BOOT", acpi_parse_sbf); 1187 acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf);
1200 1188
1201 /* 1189 /*
1202 * blacklist may disable ACPI entirely 1190 * blacklist may disable ACPI entirely
@@ -1224,7 +1212,7 @@ int __init acpi_boot_init(void)
1224 if (acpi_disabled && !acpi_ht) 1212 if (acpi_disabled && !acpi_ht)
1225 return 1; 1213 return 1;
1226 1214
1227 acpi_table_parse("BOOT", acpi_parse_sbf); 1215 acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf);
1228 1216
1229 /* 1217 /*
1230 * set sci_int and PM timer address 1218 * set sci_int and PM timer address
@@ -1236,7 +1224,7 @@ int __init acpi_boot_init(void)
1236 */ 1224 */
1237 acpi_process_madt(); 1225 acpi_process_madt();
1238 1226
1239 acpi_table_parse("HPET", acpi_parse_hpet); 1227 acpi_table_parse(ACPI_SIG_HPET, acpi_parse_hpet);
1240 1228
1241 return 0; 1229 return 0;
1242} 1230}
@@ -1307,13 +1295,17 @@ static int __init setup_acpi_sci(char *s)
1307 if (!s) 1295 if (!s)
1308 return -EINVAL; 1296 return -EINVAL;
1309 if (!strcmp(s, "edge")) 1297 if (!strcmp(s, "edge"))
1310 acpi_sci_flags.trigger = 1; 1298 acpi_sci_flags = ACPI_MADT_TRIGGER_EDGE |
1299 (acpi_sci_flags & ~ACPI_MADT_TRIGGER_MASK);
1311 else if (!strcmp(s, "level")) 1300 else if (!strcmp(s, "level"))
1312 acpi_sci_flags.trigger = 3; 1301 acpi_sci_flags = ACPI_MADT_TRIGGER_LEVEL |
1302 (acpi_sci_flags & ~ACPI_MADT_TRIGGER_MASK);
1313 else if (!strcmp(s, "high")) 1303 else if (!strcmp(s, "high"))
1314 acpi_sci_flags.polarity = 1; 1304 acpi_sci_flags = ACPI_MADT_POLARITY_ACTIVE_HIGH |
1305 (acpi_sci_flags & ~ACPI_MADT_POLARITY_MASK);
1315 else if (!strcmp(s, "low")) 1306 else if (!strcmp(s, "low"))
1316 acpi_sci_flags.polarity = 3; 1307 acpi_sci_flags = ACPI_MADT_POLARITY_ACTIVE_LOW |
1308 (acpi_sci_flags & ~ACPI_MADT_POLARITY_MASK);
1317 else 1309 else
1318 return -EINVAL; 1310 return -EINVAL;
1319 return 0; 1311 return 0;
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index d37fb8e81898..4719e481d93b 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
@@ -94,7 +94,7 @@ const char *acpi_get_sysname(void)
94 return "dig"; 94 return "dig";
95 } 95 }
96 96
97 xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address); 97 xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_physical_address);
98 hdr = &xsdt->header; 98 hdr = &xsdt->header;
99 if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1)) { 99 if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1)) {
100 printk(KERN_ERR 100 printk(KERN_ERR
@@ -169,12 +169,12 @@ struct acpi_table_madt *acpi_madt __initdata;
169static u8 has_8259; 169static u8 has_8259;
170 170
171static int __init 171static int __init
172acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header, 172acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header,
173 const unsigned long end) 173 const unsigned long end)
174{ 174{
175 struct acpi_table_lapic_addr_ovr *lapic; 175 struct acpi_madt_local_apic_override *lapic;
176 176
177 lapic = (struct acpi_table_lapic_addr_ovr *)header; 177 lapic = (struct acpi_madt_local_apic_override *)header;
178 178
179 if (BAD_MADT_ENTRY(lapic, end)) 179 if (BAD_MADT_ENTRY(lapic, end))
180 return -EINVAL; 180 return -EINVAL;
@@ -187,21 +187,20 @@ acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
187} 187}
188 188
189static int __init 189static int __init
190acpi_parse_lsapic(acpi_table_entry_header * header, const unsigned long end) 190acpi_parse_lsapic(struct acpi_subtable_header * header, const unsigned long end)
191{ 191{
192 struct acpi_table_lsapic *lsapic; 192 struct acpi_madt_local_sapic *lsapic;
193 193
194 lsapic = (struct acpi_table_lsapic *)header; 194 lsapic = (struct acpi_madt_local_sapic *)header;
195 195
196 if (BAD_MADT_ENTRY(lsapic, end)) 196 /*Skip BAD_MADT_ENTRY check, as lsapic size could vary */
197 return -EINVAL;
198 197
199 if (lsapic->flags.enabled) { 198 if (lsapic->lapic_flags & ACPI_MADT_ENABLED) {
200#ifdef CONFIG_SMP 199#ifdef CONFIG_SMP
201 smp_boot_data.cpu_phys_id[available_cpus] = 200 smp_boot_data.cpu_phys_id[available_cpus] =
202 (lsapic->id << 8) | lsapic->eid; 201 (lsapic->id << 8) | lsapic->eid;
203#endif 202#endif
204 ia64_acpiid_to_sapicid[lsapic->acpi_id] = 203 ia64_acpiid_to_sapicid[lsapic->processor_id] =
205 (lsapic->id << 8) | lsapic->eid; 204 (lsapic->id << 8) | lsapic->eid;
206 ++available_cpus; 205 ++available_cpus;
207 } 206 }
@@ -211,11 +210,11 @@ acpi_parse_lsapic(acpi_table_entry_header * header, const unsigned long end)
211} 210}
212 211
213static int __init 212static int __init
214acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end) 213acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long end)
215{ 214{
216 struct acpi_table_lapic_nmi *lacpi_nmi; 215 struct acpi_madt_local_apic_nmi *lacpi_nmi;
217 216
218 lacpi_nmi = (struct acpi_table_lapic_nmi *)header; 217 lacpi_nmi = (struct acpi_madt_local_apic_nmi *)header;
219 218
220 if (BAD_MADT_ENTRY(lacpi_nmi, end)) 219 if (BAD_MADT_ENTRY(lacpi_nmi, end))
221 return -EINVAL; 220 return -EINVAL;
@@ -225,11 +224,11 @@ acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
225} 224}
226 225
227static int __init 226static int __init
228acpi_parse_iosapic(acpi_table_entry_header * header, const unsigned long end) 227acpi_parse_iosapic(struct acpi_subtable_header * header, const unsigned long end)
229{ 228{
230 struct acpi_table_iosapic *iosapic; 229 struct acpi_madt_io_sapic *iosapic;
231 230
232 iosapic = (struct acpi_table_iosapic *)header; 231 iosapic = (struct acpi_madt_io_sapic *)header;
233 232
234 if (BAD_MADT_ENTRY(iosapic, end)) 233 if (BAD_MADT_ENTRY(iosapic, end))
235 return -EINVAL; 234 return -EINVAL;
@@ -240,13 +239,13 @@ acpi_parse_iosapic(acpi_table_entry_header * header, const unsigned long end)
240static unsigned int __initdata acpi_madt_rev; 239static unsigned int __initdata acpi_madt_rev;
241 240
242static int __init 241static int __init
243acpi_parse_plat_int_src(acpi_table_entry_header * header, 242acpi_parse_plat_int_src(struct acpi_subtable_header * header,
244 const unsigned long end) 243 const unsigned long end)
245{ 244{
246 struct acpi_table_plat_int_src *plintsrc; 245 struct acpi_madt_interrupt_source *plintsrc;
247 int vector; 246 int vector;
248 247
249 plintsrc = (struct acpi_table_plat_int_src *)header; 248 plintsrc = (struct acpi_madt_interrupt_source *)header;
250 249
251 if (BAD_MADT_ENTRY(plintsrc, end)) 250 if (BAD_MADT_ENTRY(plintsrc, end))
252 return -EINVAL; 251 return -EINVAL;
@@ -257,19 +256,19 @@ acpi_parse_plat_int_src(acpi_table_entry_header * header,
257 */ 256 */
258 vector = iosapic_register_platform_intr(plintsrc->type, 257 vector = iosapic_register_platform_intr(plintsrc->type,
259 plintsrc->global_irq, 258 plintsrc->global_irq,
260 plintsrc->iosapic_vector, 259 plintsrc->io_sapic_vector,
261 plintsrc->eid, 260 plintsrc->eid,
262 plintsrc->id, 261 plintsrc->id,
263 (plintsrc->flags.polarity == 262 ((plintsrc->inti_flags & ACPI_MADT_POLARITY_MASK) ==
264 1) ? IOSAPIC_POL_HIGH : 263 ACPI_MADT_POLARITY_ACTIVE_HIGH) ?
265 IOSAPIC_POL_LOW, 264 IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
266 (plintsrc->flags.trigger == 265 ((plintsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) ==
267 1) ? IOSAPIC_EDGE : 266 ACPI_MADT_TRIGGER_EDGE) ?
268 IOSAPIC_LEVEL); 267 IOSAPIC_EDGE : IOSAPIC_LEVEL);
269 268
270 platform_intr_list[plintsrc->type] = vector; 269 platform_intr_list[plintsrc->type] = vector;
271 if (acpi_madt_rev > 1) { 270 if (acpi_madt_rev > 1) {
272 acpi_cpei_override = plintsrc->plint_flags.cpei_override_flag; 271 acpi_cpei_override = plintsrc->flags & ACPI_MADT_CPEI_OVERRIDE;
273 } 272 }
274 273
275 /* 274 /*
@@ -324,30 +323,32 @@ unsigned int get_cpei_target_cpu(void)
324} 323}
325 324
326static int __init 325static int __init
327acpi_parse_int_src_ovr(acpi_table_entry_header * header, 326acpi_parse_int_src_ovr(struct acpi_subtable_header * header,
328 const unsigned long end) 327 const unsigned long end)
329{ 328{
330 struct acpi_table_int_src_ovr *p; 329 struct acpi_madt_interrupt_override *p;
331 330
332 p = (struct acpi_table_int_src_ovr *)header; 331 p = (struct acpi_madt_interrupt_override *)header;
333 332
334 if (BAD_MADT_ENTRY(p, end)) 333 if (BAD_MADT_ENTRY(p, end))
335 return -EINVAL; 334 return -EINVAL;
336 335
337 iosapic_override_isa_irq(p->bus_irq, p->global_irq, 336 iosapic_override_isa_irq(p->source_irq, p->global_irq,
338 (p->flags.polarity == 337 ((p->inti_flags & ACPI_MADT_POLARITY_MASK) ==
339 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, 338 ACPI_MADT_POLARITY_ACTIVE_HIGH) ?
340 (p->flags.trigger == 339 IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
341 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); 340 ((p->inti_flags & ACPI_MADT_TRIGGER_MASK) ==
341 ACPI_MADT_TRIGGER_EDGE) ?
342 IOSAPIC_EDGE : IOSAPIC_LEVEL);
342 return 0; 343 return 0;
343} 344}
344 345
345static int __init 346static int __init
346acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end) 347acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end)
347{ 348{
348 struct acpi_table_nmi_src *nmi_src; 349 struct acpi_madt_nmi_source *nmi_src;
349 350
350 nmi_src = (struct acpi_table_nmi_src *)header; 351 nmi_src = (struct acpi_madt_nmi_source *)header;
351 352
352 if (BAD_MADT_ENTRY(nmi_src, end)) 353 if (BAD_MADT_ENTRY(nmi_src, end))
353 return -EINVAL; 354 return -EINVAL;
@@ -371,12 +372,12 @@ static void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
371 } 372 }
372} 373}
373 374
374static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size) 375static int __init acpi_parse_madt(struct acpi_table_header *table)
375{ 376{
376 if (!phys_addr || !size) 377 if (!table)
377 return -EINVAL; 378 return -EINVAL;
378 379
379 acpi_madt = (struct acpi_table_madt *)__va(phys_addr); 380 acpi_madt = (struct acpi_table_madt *)table;
380 381
381 acpi_madt_rev = acpi_madt->header.revision; 382 acpi_madt_rev = acpi_madt->header.revision;
382 383
@@ -384,14 +385,14 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
384#ifdef CONFIG_ITANIUM 385#ifdef CONFIG_ITANIUM
385 has_8259 = 1; /* Firmware on old Itanium systems is broken */ 386 has_8259 = 1; /* Firmware on old Itanium systems is broken */
386#else 387#else
387 has_8259 = acpi_madt->flags.pcat_compat; 388 has_8259 = acpi_madt->flags & ACPI_MADT_PCAT_COMPAT;
388#endif 389#endif
389 iosapic_system_init(has_8259); 390 iosapic_system_init(has_8259);
390 391
391 /* Get base address of IPI Message Block */ 392 /* Get base address of IPI Message Block */
392 393
393 if (acpi_madt->lapic_address) 394 if (acpi_madt->address)
394 ipi_base_addr = ioremap(acpi_madt->lapic_address, 0); 395 ipi_base_addr = ioremap(acpi_madt->address, 0);
395 396
396 printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr); 397 printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr);
397 398
@@ -413,23 +414,24 @@ static u32 __devinitdata pxm_flag[PXM_FLAG_LEN];
413#define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag)) 414#define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag))
414static struct acpi_table_slit __initdata *slit_table; 415static struct acpi_table_slit __initdata *slit_table;
415 416
416static int get_processor_proximity_domain(struct acpi_table_processor_affinity *pa) 417static int get_processor_proximity_domain(struct acpi_srat_cpu_affinity *pa)
417{ 418{
418 int pxm; 419 int pxm;
419 420
420 pxm = pa->proximity_domain; 421 pxm = pa->proximity_domain_lo;
421 if (ia64_platform_is("sn2")) 422 if (ia64_platform_is("sn2"))
422 pxm += pa->reserved[0] << 8; 423 pxm += pa->proximity_domain_hi[0] << 8;
423 return pxm; 424 return pxm;
424} 425}
425 426
426static int get_memory_proximity_domain(struct acpi_table_memory_affinity *ma) 427static int get_memory_proximity_domain(struct acpi_srat_mem_affinity *ma)
427{ 428{
428 int pxm; 429 int pxm;
429 430
430 pxm = ma->proximity_domain; 431 pxm = ma->proximity_domain;
431 if (ia64_platform_is("sn2")) 432 if (ia64_platform_is("sn2"))
432 pxm += ma->reserved1[0] << 8; 433 pxm += ma->reserved << 8;
434
433 return pxm; 435 return pxm;
434} 436}
435 437
@@ -442,7 +444,7 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
442 u32 len; 444 u32 len;
443 445
444 len = sizeof(struct acpi_table_header) + 8 446 len = sizeof(struct acpi_table_header) + 8
445 + slit->localities * slit->localities; 447 + slit->locality_count * slit->locality_count;
446 if (slit->header.length != len) { 448 if (slit->header.length != len) {
447 printk(KERN_ERR 449 printk(KERN_ERR
448 "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n", 450 "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
@@ -454,11 +456,11 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
454} 456}
455 457
456void __init 458void __init
457acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) 459acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
458{ 460{
459 int pxm; 461 int pxm;
460 462
461 if (!pa->flags.enabled) 463 if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
462 return; 464 return;
463 465
464 pxm = get_processor_proximity_domain(pa); 466 pxm = get_processor_proximity_domain(pa);
@@ -467,14 +469,14 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
467 pxm_bit_set(pxm); 469 pxm_bit_set(pxm);
468 470
469 node_cpuid[srat_num_cpus].phys_id = 471 node_cpuid[srat_num_cpus].phys_id =
470 (pa->apic_id << 8) | (pa->lsapic_eid); 472 (pa->apic_id << 8) | (pa->local_sapic_eid);
471 /* nid should be overridden as logical node id later */ 473 /* nid should be overridden as logical node id later */
472 node_cpuid[srat_num_cpus].nid = pxm; 474 node_cpuid[srat_num_cpus].nid = pxm;
473 srat_num_cpus++; 475 srat_num_cpus++;
474} 476}
475 477
476void __init 478void __init
477acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) 479acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
478{ 480{
479 unsigned long paddr, size; 481 unsigned long paddr, size;
480 int pxm; 482 int pxm;
@@ -483,13 +485,11 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
483 pxm = get_memory_proximity_domain(ma); 485 pxm = get_memory_proximity_domain(ma);
484 486
485 /* fill node memory chunk structure */ 487 /* fill node memory chunk structure */
486 paddr = ma->base_addr_hi; 488 paddr = ma->base_address;
487 paddr = (paddr << 32) | ma->base_addr_lo; 489 size = ma->length;
488 size = ma->length_hi;
489 size = (size << 32) | ma->length_lo;
490 490
491 /* Ignore disabled entries */ 491 /* Ignore disabled entries */
492 if (!ma->flags.enabled) 492 if (!(ma->flags & ACPI_SRAT_MEM_ENABLED))
493 return; 493 return;
494 494
495 /* record this node in proximity bitmap */ 495 /* record this node in proximity bitmap */
@@ -560,16 +560,16 @@ void __init acpi_numa_arch_fixup(void)
560 if (!slit_table) 560 if (!slit_table)
561 return; 561 return;
562 memset(numa_slit, -1, sizeof(numa_slit)); 562 memset(numa_slit, -1, sizeof(numa_slit));
563 for (i = 0; i < slit_table->localities; i++) { 563 for (i = 0; i < slit_table->locality_count; i++) {
564 if (!pxm_bit_test(i)) 564 if (!pxm_bit_test(i))
565 continue; 565 continue;
566 node_from = pxm_to_node(i); 566 node_from = pxm_to_node(i);
567 for (j = 0; j < slit_table->localities; j++) { 567 for (j = 0; j < slit_table->locality_count; j++) {
568 if (!pxm_bit_test(j)) 568 if (!pxm_bit_test(j))
569 continue; 569 continue;
570 node_to = pxm_to_node(j); 570 node_to = pxm_to_node(j);
571 node_distance(node_from, node_to) = 571 node_distance(node_from, node_to) =
572 slit_table->entry[i * slit_table->localities + j]; 572 slit_table->entry[i * slit_table->locality_count + j];
573 } 573 }
574 } 574 }
575 575
@@ -614,15 +614,15 @@ void acpi_unregister_gsi(u32 gsi)
614 614
615EXPORT_SYMBOL(acpi_unregister_gsi); 615EXPORT_SYMBOL(acpi_unregister_gsi);
616 616
617static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size) 617static int __init acpi_parse_fadt(struct acpi_table_header *table)
618{ 618{
619 struct acpi_table_header *fadt_header; 619 struct acpi_table_header *fadt_header;
620 struct acpi_table_fadt *fadt; 620 struct acpi_table_fadt *fadt;
621 621
622 if (!phys_addr || !size) 622 if (!table)
623 return -EINVAL; 623 return -EINVAL;
624 624
625 fadt_header = (struct acpi_table_header *)__va(phys_addr); 625 fadt_header = (struct acpi_table_header *)table;
626 if (fadt_header->revision != 3) 626 if (fadt_header->revision != 3)
627 return -ENODEV; /* Only deal with ACPI 2.0 FADT */ 627 return -ENODEV; /* Only deal with ACPI 2.0 FADT */
628 628
@@ -655,7 +655,7 @@ int __init acpi_boot_init(void)
655 * information -- the successor to MPS tables. 655 * information -- the successor to MPS tables.
656 */ 656 */
657 657
658 if (acpi_table_parse(ACPI_APIC, acpi_parse_madt) < 1) { 658 if (acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt) < 1) {
659 printk(KERN_ERR PREFIX "Can't find MADT\n"); 659 printk(KERN_ERR PREFIX "Can't find MADT\n");
660 goto skip_madt; 660 goto skip_madt;
661 } 661 }
@@ -663,40 +663,40 @@ int __init acpi_boot_init(void)
663 /* Local APIC */ 663 /* Local APIC */
664 664
665 if (acpi_table_parse_madt 665 if (acpi_table_parse_madt
666 (ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0) 666 (ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE, acpi_parse_lapic_addr_ovr, 0) < 0)
667 printk(KERN_ERR PREFIX 667 printk(KERN_ERR PREFIX
668 "Error parsing LAPIC address override entry\n"); 668 "Error parsing LAPIC address override entry\n");
669 669
670 if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) 670 if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC, acpi_parse_lsapic, NR_CPUS)
671 < 1) 671 < 1)
672 printk(KERN_ERR PREFIX 672 printk(KERN_ERR PREFIX
673 "Error parsing MADT - no LAPIC entries\n"); 673 "Error parsing MADT - no LAPIC entries\n");
674 674
675 if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) 675 if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0)
676 < 0) 676 < 0)
677 printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); 677 printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
678 678
679 /* I/O APIC */ 679 /* I/O APIC */
680 680
681 if (acpi_table_parse_madt 681 if (acpi_table_parse_madt
682 (ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1) 682 (ACPI_MADT_TYPE_IO_SAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
683 printk(KERN_ERR PREFIX 683 printk(KERN_ERR PREFIX
684 "Error parsing MADT - no IOSAPIC entries\n"); 684 "Error parsing MADT - no IOSAPIC entries\n");
685 685
686 /* System-Level Interrupt Routing */ 686 /* System-Level Interrupt Routing */
687 687
688 if (acpi_table_parse_madt 688 if (acpi_table_parse_madt
689 (ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, 689 (ACPI_MADT_TYPE_INTERRUPT_SOURCE, acpi_parse_plat_int_src,
690 ACPI_MAX_PLATFORM_INTERRUPTS) < 0) 690 ACPI_MAX_PLATFORM_INTERRUPTS) < 0)
691 printk(KERN_ERR PREFIX 691 printk(KERN_ERR PREFIX
692 "Error parsing platform interrupt source entry\n"); 692 "Error parsing platform interrupt source entry\n");
693 693
694 if (acpi_table_parse_madt 694 if (acpi_table_parse_madt
695 (ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0) 695 (ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr, 0) < 0)
696 printk(KERN_ERR PREFIX 696 printk(KERN_ERR PREFIX
697 "Error parsing interrupt source overrides entry\n"); 697 "Error parsing interrupt source overrides entry\n");
698 698
699 if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0) 699 if (acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, acpi_parse_nmi_src, 0) < 0)
700 printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); 700 printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
701 skip_madt: 701 skip_madt:
702 702
@@ -706,7 +706,7 @@ int __init acpi_boot_init(void)
706 * gets interrupts such as power and sleep buttons. If it's not 706 * gets interrupts such as power and sleep buttons. If it's not
707 * on a Legacy interrupt, it needs to be setup. 707 * on a Legacy interrupt, it needs to be setup.
708 */ 708 */
709 if (acpi_table_parse(ACPI_FADT, acpi_parse_fadt) < 1) 709 if (acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt) < 1)
710 printk(KERN_ERR PREFIX "Can't find FADT\n"); 710 printk(KERN_ERR PREFIX "Can't find FADT\n");
711 711
712#ifdef CONFIG_SMP 712#ifdef CONFIG_SMP
@@ -839,7 +839,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
839{ 839{
840 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 840 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
841 union acpi_object *obj; 841 union acpi_object *obj;
842 struct acpi_table_lsapic *lsapic; 842 struct acpi_madt_local_sapic *lsapic;
843 cpumask_t tmp_map; 843 cpumask_t tmp_map;
844 long physid; 844 long physid;
845 int cpu; 845 int cpu;
@@ -851,16 +851,16 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
851 return -EINVAL; 851 return -EINVAL;
852 852
853 obj = buffer.pointer; 853 obj = buffer.pointer;
854 if (obj->type != ACPI_TYPE_BUFFER || 854 if (obj->type != ACPI_TYPE_BUFFER)
855 obj->buffer.length < sizeof(*lsapic)) { 855 {
856 kfree(buffer.pointer); 856 kfree(buffer.pointer);
857 return -EINVAL; 857 return -EINVAL;
858 } 858 }
859 859
860 lsapic = (struct acpi_table_lsapic *)obj->buffer.pointer; 860 lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;
861 861
862 if ((lsapic->header.type != ACPI_MADT_LSAPIC) || 862 if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) ||
863 (!lsapic->flags.enabled)) { 863 (!lsapic->lapic_flags & ACPI_MADT_ENABLED)) {
864 kfree(buffer.pointer); 864 kfree(buffer.pointer);
865 return -EINVAL; 865 return -EINVAL;
866 } 866 }
@@ -880,7 +880,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
880 880
881 cpu_set(cpu, cpu_present_map); 881 cpu_set(cpu, cpu_present_map);
882 ia64_cpu_to_sapicid[cpu] = physid; 882 ia64_cpu_to_sapicid[cpu] = physid;
883 ia64_acpiid_to_sapicid[lsapic->acpi_id] = ia64_cpu_to_sapicid[cpu]; 883 ia64_acpiid_to_sapicid[lsapic->processor_id] = ia64_cpu_to_sapicid[cpu];
884 884
885 *pcpu = cpu; 885 *pcpu = cpu;
886 return (0); 886 return (0);
@@ -917,7 +917,7 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
917{ 917{
918 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 918 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
919 union acpi_object *obj; 919 union acpi_object *obj;
920 struct acpi_table_iosapic *iosapic; 920 struct acpi_madt_io_sapic *iosapic;
921 unsigned int gsi_base; 921 unsigned int gsi_base;
922 int pxm, node; 922 int pxm, node;
923 923
@@ -935,9 +935,9 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
935 return AE_OK; 935 return AE_OK;
936 } 936 }
937 937
938 iosapic = (struct acpi_table_iosapic *)obj->buffer.pointer; 938 iosapic = (struct acpi_madt_io_sapic *)obj->buffer.pointer;
939 939
940 if (iosapic->header.type != ACPI_MADT_IOSAPIC) { 940 if (iosapic->header.type != ACPI_MADT_TYPE_IO_SAPIC) {
941 kfree(buffer.pointer); 941 kfree(buffer.pointer);
942 return AE_OK; 942 return AE_OK;
943 } 943 }