aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-03-18 20:14:21 -0400
committerKevin O'Connor <kevin@koconnor.net>2013-03-18 20:14:21 -0400
commit3c3a3fa6522f564873936c75f7dddfbb817d0626 (patch)
treea2312b8ede15e3a1c3be0d3538052187ecf623ac
parent2d6db556cb219ff1a15b98a18fafad33310e47b0 (diff)
downloadseabios-3c3a3fa6522f564873936c75f7dddfbb817d0626.tar.gz
mptable: Don't describe pci-to-pci bridges.
It should not be necessary to describe PCI-to-PCI bridges in the mptable. (The mptable was designed to fit in ROM, so it seems unlikely that it would be used for bridges that could be dynamically added.) Describing only the root bus should make it easier to port this content into QEMU. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/mptable.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mptable.c b/src/mptable.c
index 0f2d756..de188ca 100644
--- a/src/mptable.c
+++ b/src/mptable.c
@@ -65,30 +65,25 @@ mptable_setup(void)
}
int entrycount = cpu - cpus;
- // PCI buses
+ // PCI bus
struct mpt_bus *buses = (void*)cpu, *bus = buses;
- int lastbus = -1;
- struct pci_device *pci;
- foreachpci(pci) {
- int curbus = pci_bdf_to_bus(pci->bdf);
- if (curbus == lastbus)
- continue;
- lastbus = curbus;
+ if (PCIDevices) {
memset(bus, 0, sizeof(*bus));
bus->type = MPT_TYPE_BUS;
- bus->busid = curbus;
+ bus->busid = 0;
memcpy(bus->bustype, "PCI ", sizeof(bus->bustype));
bus++;
+ entrycount++;
}
/* isa bus */
- int isabusid;
+ int isabusid = bus - buses;
memset(bus, 0, sizeof(*bus));
bus->type = MPT_TYPE_BUS;
- isabusid = bus->busid = lastbus + 1;
+ bus->busid = isabusid;
memcpy(bus->bustype, "ISA ", sizeof(bus->bustype));
bus++;
- entrycount += bus - buses;
+ entrycount++;
/* ioapic */
u8 ioapic_id = BUILD_IOAPIC_ID;
@@ -106,8 +101,11 @@ mptable_setup(void)
int dev = -1;
unsigned short mask = 0, pinmask = 0;
+ struct pci_device *pci;
foreachpci(pci) {
u16 bdf = pci->bdf;
+ if (pci_bdf_to_bus(bdf) != 0)
+ break;
int pin = pci_config_readb(bdf, PCI_INTERRUPT_PIN);
int irq = pci_config_readb(bdf, PCI_INTERRUPT_LINE);
if (pin == 0)