[OpenBIOS] r505 - trunk/openbios-devel/drivers

svn at openbios.org svn at openbios.org
Sun Jul 5 20:32:50 CEST 2009


Author: blueswirl
Date: 2009-07-05 20:32:50 +0200 (Sun, 05 Jul 2009)
New Revision: 505

Modified:
   trunk/openbios-devel/drivers/pci.c
Log:
Don't try to configure non-existent BARs of bridge devices

QEMU commit b7ee1603c16c1feb0d439d2ddf6cf824119d0aab improved the PCI bridge
device handling. PCI bridges use different header format from ordinary PCI
devices, especially BAR registers do not exist. OpenBIOS tried to configure
the bridges based on the non-BAR data which was assumed to be BARs.


Modified: trunk/openbios-devel/drivers/pci.c
===================================================================
--- trunk/openbios-devel/drivers/pci.c	2009-06-14 16:05:27 UTC (rev 504)
+++ trunk/openbios-devel/drivers/pci.c	2009-07-05 18:32:50 UTC (rev 505)
@@ -747,24 +747,19 @@
 
                         if (class == PCI_BASE_CLASS_BRIDGE &&
                             (subclass == PCI_SUBCLASS_BRIDGE_HOST ||
-                             subclass == PCI_SUBCLASS_BRIDGE_PCI))
+                             subclass == PCI_SUBCLASS_BRIDGE_PCI)) {
                             REGISTER_NAMED_NODE(ob_pci_bus_node, config.path);
-                        else
+                            /* host or bridge */
+                            activate_device(config.path);
+                            ob_pci_add_properties(addr, pci_dev, &config);
+                            free(*path);
+                            *path = strdup(config.path);
+                        } else {
                             REGISTER_NAMED_NODE(ob_pci_simple_node, config.path);
-
-			activate_device(config.path);
-
-                        ob_pci_configure(addr, &config, mem_base, io_base);
-			ob_pci_add_properties(addr, pci_dev, &config);
-
-                        if (class == PCI_BASE_CLASS_BRIDGE &&
-                            (subclass == PCI_SUBCLASS_BRIDGE_HOST ||
-                             subclass == PCI_SUBCLASS_BRIDGE_PCI)) {
-				/* host or bridge */
-				free(*path);
-				*path = strdup(config.path);
-			}
-
+                            activate_device(config.path);
+                            ob_pci_configure(addr, &config, mem_base, io_base);
+                            ob_pci_add_properties(addr, pci_dev, &config);
+                        }
 		}
 	}
 	device_end();




More information about the OpenBIOS mailing list