summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2000-10-09 00:44:41 +0000
committermsmith <msmith@FreeBSD.org>2000-10-09 00:44:41 +0000
commita67a650294f41fc22f7c8412a6911bdc4372408f (patch)
treeed12f52b341f787945912a715db09fbdef70f404 /sys/amd64
parent3f7f525479e7bd8ecf84de7d05ca0644d7807a68 (diff)
downloadFreeBSD-src-a67a650294f41fc22f7c8412a6911bdc4372408f.zip
FreeBSD-src-a67a650294f41fc22f7c8412a6911bdc4372408f.tar.gz
Only attach "legacy" PCI busses if none have been attached via any other
method.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/pci/pci_bus.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/sys/amd64/pci/pci_bus.c b/sys/amd64/pci/pci_bus.c
index 89a14a9..a3b07a6 100644
--- a/sys/amd64/pci/pci_bus.c
+++ b/sys/amd64/pci/pci_bus.c
@@ -257,9 +257,20 @@ nexus_pcib_identify(driver_t *driver, device_t parent)
int pcifunchigh;
int found824xx = 0;
device_t child;
+ devclass_t pci_devclass;
if (pci_cfgregopen() == 0)
return;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return;
+
+
bus = 0;
retry:
for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
@@ -349,11 +360,20 @@ nexus_pcib_identify(driver_t *driver, device_t parent)
static int
nexus_pcib_probe(device_t dev)
{
+ devclass_t pci_devclass;
- if (pci_cfgregopen() != 0)
- return 0;
+ if (pci_cfgregopen() == 0)
+ return ENXIO;
+ /*
+ * Check to see if we haven't already had a PCI bus added
+ * via some other means. If we have, bail since otherwise
+ * we're going to end up duplicating it.
+ */
+ if ((pci_devclass = devclass_find("pci")) &&
+ devclass_get_device(pci_devclass, 0))
+ return ENXIO;
- return ENXIO;
+ return 0;
}
static int
OpenPOWER on IntegriCloud