Tue Feb 7 16:34:44 2012 UTC ()
Initialize pcibus_attach_args.pba_sub to 255.  Note in a comment that
this needs some improvement for machines with >1 Host-PCI bridge, but
that it doesn't cause any practical problems at this time.

Ok releng@.


(dyoung)
diff -r1.93 -r1.94 src/sys/arch/i386/i386/mainbus.c

cvs diff -r1.93 -r1.94 src/sys/arch/i386/i386/Attic/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/i386/i386/Attic/mainbus.c 2012/01/18 21:34:38 1.93
+++ src/sys/arch/i386/i386/Attic/mainbus.c 2012/02/07 16:34:44 1.94
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.93 2012/01/18 21:34:38 drochner Exp $ */ 1/* $NetBSD: mainbus.c,v 1.94 2012/02/07 16:34:44 dyoung Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.93 2012/01/18 21:34:38 drochner Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.94 2012/02/07 16:34:44 dyoung Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/device.h> 38#include <sys/device.h>
39#include <sys/reboot.h> 39#include <sys/reboot.h>
40#include <sys/bus.h> 40#include <sys/bus.h>
41 41
42#include <dev/isa/isavar.h> 42#include <dev/isa/isavar.h>
43#include <dev/eisa/eisavar.h> 43#include <dev/eisa/eisavar.h>
44#include <dev/pci/pcivar.h> 44#include <dev/pci/pcivar.h>
45 45
46#include <dev/isa/isareg.h> /* for ISA_HOLE_VADDR */ 46#include <dev/isa/isareg.h> /* for ISA_HOLE_VADDR */
47 47
@@ -396,26 +396,33 @@ mainbus_rescan(device_t self, const char @@ -396,26 +396,33 @@ mainbus_rescan(device_t self, const char
396 * XXX that's not currently possible. 396 * XXX that's not currently possible.
397 */ 397 */
398#if NPCI > 0 398#if NPCI > 0
399 if (pci_mode_detect() != 0 && ifattr_match(ifattr, "pcibus")) { 399 if (pci_mode_detect() != 0 && ifattr_match(ifattr, "pcibus")) {
400 int npcibus = 0; 400 int npcibus = 0;
401 401
402 mba.mba_pba.pba_iot = x86_bus_space_io; 402 mba.mba_pba.pba_iot = x86_bus_space_io;
403 mba.mba_pba.pba_memt = x86_bus_space_mem; 403 mba.mba_pba.pba_memt = x86_bus_space_mem;
404 mba.mba_pba.pba_dmat = &pci_bus_dma_tag; 404 mba.mba_pba.pba_dmat = &pci_bus_dma_tag;
405 mba.mba_pba.pba_dmat64 = NULL; 405 mba.mba_pba.pba_dmat64 = NULL;
406 mba.mba_pba.pba_pc = NULL; 406 mba.mba_pba.pba_pc = NULL;
407 mba.mba_pba.pba_flags = pci_bus_flags(); 407 mba.mba_pba.pba_flags = pci_bus_flags();
408 mba.mba_pba.pba_bus = 0; 408 mba.mba_pba.pba_bus = 0;
 409 /* XXX On those machines with >1 Host-PCI bridge,
 410 * XXX not every bus > pba_bus is subordinate to pba_bus,
 411 * XXX but this works on many machines, and pba_sub is
 412 * XXX not used today by any critical code, so it is safe
 413 * XXX to be so inclusive at this time.
 414 */
 415 mba.mba_pba.pba_sub = 255;
409 mba.mba_pba.pba_bridgetag = NULL; 416 mba.mba_pba.pba_bridgetag = NULL;
410#if NACPICA > 0 && defined(ACPI_SCANPCI) 417#if NACPICA > 0 && defined(ACPI_SCANPCI)
411 if (npcibus == 0 && sc->sc_mpacpi_active) 418 if (npcibus == 0 && sc->sc_mpacpi_active)
412 npcibus = mp_pci_scan(self, &mba.mba_pba, pcibusprint); 419 npcibus = mp_pci_scan(self, &mba.mba_pba, pcibusprint);
413#endif 420#endif
414#if defined(MPBIOS) && defined(MPBIOS_SCANPCI) 421#if defined(MPBIOS) && defined(MPBIOS_SCANPCI)
415 if (npcibus == 0 && mpbios_scanned != 0) 422 if (npcibus == 0 && mpbios_scanned != 0)
416 npcibus = mp_pci_scan(self, &mba.mba_pba, pcibusprint); 423 npcibus = mp_pci_scan(self, &mba.mba_pba, pcibusprint);
417#endif 424#endif
418 if (npcibus == 0 && sc->sc_pci == NULL) { 425 if (npcibus == 0 && sc->sc_pci == NULL) {
419 sc->sc_pci = config_found_ia(self, "pcibus", 426 sc->sc_pci = config_found_ia(self, "pcibus",
420 &mba.mba_pba, pcibusprint); 427 &mba.mba_pba, pcibusprint);
421 } 428 }