]> xenbits.xensource.com Git - seabios.git/commitdiff
mptable: Use same PCI irqs as ACPI code.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 19 Mar 2013 00:26:54 +0000 (20:26 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 19 Mar 2013 00:26:54 +0000 (20:26 -0400)
The ACPI code has a hardcoded list of PCI interrupts.  Use that same
list in the mptable code generation.  This will ensure that both
tables are in synch - it may also make the mptable easier to generate
from QEMU.

Also, move the irq0_override lookup outside of the irq loop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/acpi.c
src/config.h
src/mptable.c

index 119d1c18d40f0c10c517c88e65952a194e2317d9..d1cb65304533bc693c1d3e31a4fc926684b36107 100644 (file)
@@ -131,9 +131,6 @@ struct madt_io_apic
                                  * lines start */
 } PACKED;
 
-/* IRQs 5,9,10,11 */
-#define PCI_ISA_IRQ_MASK    0x0e20
-
 struct madt_intsrcovr {
     ACPI_SUB_HEADER_DEF
     u8  bus;
@@ -372,7 +369,7 @@ build_madt(void)
         intsrcovr++;
     }
     for (i = 1; i < 16; i++) {
-        if (!(PCI_ISA_IRQ_MASK & (1 << i)))
+        if (!(BUILD_PCI_IRQS & (1 << i)))
             /* No need for a INT source override structure. */
             continue;
         memset(intsrcovr, 0, sizeof(*intsrcovr));
index 8b888b93ff31f34595819008c7719fd357ab7c05..64e3c9208623bdd347e5bb9d0aadd119329bf08f 100644 (file)
@@ -53,6 +53,9 @@
 #define BUILD_HPET_ADDRESS        0xfed00000
 #define BUILD_APIC_ADDR           0xfee00000
 
+// PCI IRQS
+#define BUILD_PCI_IRQS         ((1<<5) | (1<<9) | (1<<10) | (1<<11))
+
 // Important real-mode segments
 #define SEG_IVT      0x0000
 #define SEG_BDA      0x0040
index de188cabb97d13ec7d614ad2906d67dca9411a53..7d485eb61a5799849eeccfc20a0ff24bcffc8142 100644 (file)
@@ -99,7 +99,7 @@ mptable_setup(void)
     /* irqs */
     struct mpt_intsrc *intsrcs = (void*)&ioapic[1], *intsrc = intsrcs;
     int dev = -1;
-    unsigned short mask = 0, pinmask = 0;
+    unsigned short pinmask = 0;
 
     struct pci_device *pci;
     foreachpci(pci) {
@@ -117,7 +117,6 @@ mptable_setup(void)
         if (pinmask & (1 << pin)) /* pin was seen already */
             continue;
         pinmask |= (1 << pin);
-        mask |= (1 << irq);
         memset(intsrc, 0, sizeof(*intsrc));
         intsrc->type = MPT_TYPE_INTSRC;
         intsrc->irqtype = 0; /* INT */
@@ -129,9 +128,10 @@ mptable_setup(void)
         intsrc++;
     }
 
+    int irq0_override = romfile_loadint("etc/irq0-override", 0);
     for (i = 0; i < 16; i++) {
         memset(intsrc, 0, sizeof(*intsrc));
-        if (mask & (1 << i))
+        if (BUILD_PCI_IRQS & (1 << i))
             continue;
         intsrc->type = MPT_TYPE_INTSRC;
         intsrc->irqtype = 0; /* INT */
@@ -140,7 +140,7 @@ mptable_setup(void)
         intsrc->srcbusirq = i;
         intsrc->dstapic = ioapic_id;
         intsrc->dstirq = i;
-        if (romfile_loadint("etc/irq0-override", 0)) {
+        if (irq0_override) {
             /* Destination 2 is covered by irq0->inti2 override (i ==
                0). Source IRQ 2 is unused */
             if (i == 0)