]> xenbits.xensource.com Git - seabios.git/commitdiff
mptable: Don't describe pci-to-pci bridges.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 19 Mar 2013 00:14:21 +0000 (20:14 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 19 Mar 2013 00:14:21 +0000 (20:14 -0400)
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>
src/mptable.c

index 0f2d756b01dfd5819b6472d8a5973aaaf1e6add4..de188cabb97d13ec7d614ad2906d67dca9411a53 100644 (file)
@@ -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)