aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-03-18 20:26:54 -0400
committerKevin O'Connor <kevin@koconnor.net>2013-03-18 20:26:54 -0400
commitd8388157a2e303dea6d8d1406174c56c50d8d676 (patch)
treee53a7c7e8fbc2cf1e210259f367309525b744fe7
parent3c3a3fa6522f564873936c75f7dddfbb817d0626 (diff)
downloadseabios-d8388157a2e303dea6d8d1406174c56c50d8d676.tar.gz
mptable: Use same PCI irqs as ACPI code.
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>
-rw-r--r--src/acpi.c5
-rw-r--r--src/config.h3
-rw-r--r--src/mptable.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/src/acpi.c b/src/acpi.c
index 119d1c1..d1cb653 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -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));
diff --git a/src/config.h b/src/config.h
index 8b888b9..64e3c92 100644
--- a/src/config.h
+++ b/src/config.h
@@ -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
diff --git a/src/mptable.c b/src/mptable.c
index de188ca..7d485eb 100644
--- a/src/mptable.c
+++ b/src/mptable.c
@@ -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)