From ed41b168e64b29b5eb0a5ed2fe46198ee565a6ed Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 4 Aug 1999 13:38:24 +0000 Subject: Don't probe if pci_cfgopen() fails to find pci hardware, like we used to to. This might have caused interesting things on non-PCI hardware if PCI was compiled in. --- sys/amd64/pci/pci_bus.c | 9 ++++----- sys/amd64/pci/pci_cfgreg.c | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'sys/amd64') diff --git a/sys/amd64/pci/pci_bus.c b/sys/amd64/pci/pci_bus.c index b3253ac..eb6cc27 100644 --- a/sys/amd64/pci/pci_bus.c +++ b/sys/amd64/pci/pci_bus.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcibus.c,v 1.42 1999/05/18 20:48:43 peter Exp $ + * $Id: pcibus.c,v 1.43 1999/07/16 01:00:29 msmith Exp $ * */ @@ -364,7 +364,7 @@ nexus_pcib_is_host_bridge(pcicfgregs *cfg, case 0x00011039: s = "SiS 5591 host to AGP bridge"; break; - + /* VLSI -- vendor 0x1004 */ case 0x00051004: s = "VLSI 82C592 Host to PCI bridge"; @@ -409,10 +409,10 @@ nexus_pcib_identify(driver_t *driver, device_t parent) { pcicfgregs probe; + if (pci_cfgopen() == 0) + return; probe.hose = 0; probe.bus = 0; - - pci_cfgopen(); for (probe.slot = 0; probe.slot <= PCI_SLOTMAX; probe.slot++) { int pcifunchigh = 0; for (probe.func = 0; @@ -442,7 +442,6 @@ nexus_pcib_identify(driver_t *driver, device_t parent) } } } - } static int diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c index b3253ac..eb6cc27 100644 --- a/sys/amd64/pci/pci_cfgreg.c +++ b/sys/amd64/pci/pci_cfgreg.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcibus.c,v 1.42 1999/05/18 20:48:43 peter Exp $ + * $Id: pcibus.c,v 1.43 1999/07/16 01:00:29 msmith Exp $ * */ @@ -364,7 +364,7 @@ nexus_pcib_is_host_bridge(pcicfgregs *cfg, case 0x00011039: s = "SiS 5591 host to AGP bridge"; break; - + /* VLSI -- vendor 0x1004 */ case 0x00051004: s = "VLSI 82C592 Host to PCI bridge"; @@ -409,10 +409,10 @@ nexus_pcib_identify(driver_t *driver, device_t parent) { pcicfgregs probe; + if (pci_cfgopen() == 0) + return; probe.hose = 0; probe.bus = 0; - - pci_cfgopen(); for (probe.slot = 0; probe.slot <= PCI_SLOTMAX; probe.slot++) { int pcifunchigh = 0; for (probe.func = 0; @@ -442,7 +442,6 @@ nexus_pcib_identify(driver_t *driver, device_t parent) } } } - } static int -- cgit v1.1