]> xenbits.xensource.com Git - seabios.git/commitdiff
report real I/O APIC ID (0) on MADT and MP-table (v3)
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 25 Jul 2012 18:45:29 +0000 (15:45 -0300)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 2 Aug 2012 00:46:27 +0000 (20:46 -0400)
When resetting an I/O APIC, its ID is set to 0, and SeaBIOS doesn't
change it, so report it correctly on the ACPI MADT table and MP-table.

Some hardware may require the BIOS to initialize I/O APIC ID to an
unique value, but SeaBIOS doesn't do that. This patch at least makes the
tables reflect reality.

Changes v2 -> v3:
 - Fix MP-table too, not just ACPI MADT table

Changes v1 -> v2:
 - Cosmetic: whitespace change (removed extra newline)
 - New patch description

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
src/acpi.c
src/config.h
src/mptable.c

index d39cbd931e4f7435ae26532e2cc27b51eb77d57a..da3bc57ec7aff5a6d1ba3ab22ce604680159af8a 100644 (file)
@@ -336,7 +336,7 @@ build_madt(void)
     struct madt_io_apic *io_apic = (void*)apic;
     io_apic->type = APIC_IO;
     io_apic->length = sizeof(*io_apic);
-    io_apic->io_apic_id = CountCPUs;
+    io_apic->io_apic_id = BUILD_IOAPIC_ID;
     io_apic->address = cpu_to_le32(BUILD_IOAPIC_ADDR);
     io_apic->interrupt = cpu_to_le32(0);
 
index 3a708672d0cd0e842e4b78b0c0c62db4e90cda11..0d4066d91cc249f3e6f86d93ed6bfad067149bd6 100644 (file)
@@ -52,6 +52,7 @@
 #define BUILD_PCIMEM64_END        0x10000000000ULL
 
 #define BUILD_IOAPIC_ADDR         0xfec00000
+#define BUILD_IOAPIC_ID           0
 #define BUILD_HPET_ADDRESS        0xfed00000
 #define BUILD_APIC_ADDR           0xfee00000
 
index 103f46243d8cd3b89afa3fc44f97901f8e265908..74ed33d7d5d7180e9f81a41d16d40f6bfb8d1eb8 100644 (file)
@@ -92,7 +92,7 @@ mptable_init(void)
     entrycount += bus - buses;
 
     /* ioapic */
-    u8 ioapic_id = CountCPUs;
+    u8 ioapic_id = BUILD_IOAPIC_ID;
     struct mpt_ioapic *ioapic = (void*)bus;
     memset(ioapic, 0, sizeof(*ioapic));
     ioapic->type = MPT_TYPE_IOAPIC;