diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-09-19 23:03:13 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-09-19 23:03:13 +0000 |
commit | 8e8e8b6c61ecdac3d56820301245d42f8630ab4a (patch) | |
tree | 932b84553ba850d871ea0fc080778dccac63ae9f /sys/arch/i386 | |
parent | eb9fc2714568c319bf4cf240ca8dcbaed0bc2ecb (diff) |
Set up PCI bus number resource accounting for the main PCI bus hierarchy.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/mainbus.c | 3 | ||||
-rw-r--r-- | sys/arch/i386/pci/pchb.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/pci/pci_machdep.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/pci/pci_machdep.h | 3 |
4 files changed, 14 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/mainbus.c b/sys/arch/i386/i386/mainbus.c index d9db1b6c819..a0a5d0579c7 100644 --- a/sys/arch/i386/i386/mainbus.c +++ b/sys/arch/i386/i386/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.48 2010/11/03 10:15:23 dlg Exp $ */ +/* $OpenBSD: mainbus.c,v 1.49 2012/09/19 23:03:12 kettenis Exp $ */ /* $NetBSD: mainbus.c,v 1.21 1997/06/06 23:14:20 thorpej Exp $ */ /* @@ -241,6 +241,7 @@ mainbus_attach(struct device *parent, struct device *self, void *aux) mba.mba_pba.pba_dmat = &pci_bus_dma_tag; mba.mba_pba.pba_ioex = pciio_ex; mba.mba_pba.pba_memex = pcimem_ex; + mba.mba_pba.pba_busex = pcibus_ex; mba.mba_pba.pba_domain = pci_ndomains++; mba.mba_pba.pba_bus = 0; config_found(self, &mba.mba_pba, mainbus_print); diff --git a/sys/arch/i386/pci/pchb.c b/sys/arch/i386/pci/pchb.c index 115e722a9cb..c74622daf25 100644 --- a/sys/arch/i386/pci/pchb.c +++ b/sys/arch/i386/pci/pchb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pchb.c,v 1.85 2010/08/31 17:13:46 deraadt Exp $ */ +/* $OpenBSD: pchb.c,v 1.86 2012/09/19 23:03:12 kettenis Exp $ */ /* $NetBSD: pchb.c,v 1.65 2007/08/15 02:26:13 markd Exp $ */ /* @@ -409,6 +409,7 @@ pchbattach(struct device *parent, struct device *self, void *aux) pba.pba_iot = pa->pa_iot; pba.pba_memt = pa->pa_memt; pba.pba_dmat = pa->pa_dmat; + pba.pba_busex = pa->pa_busex; pba.pba_domain = pa->pa_domain; pba.pba_bus = pbnum; pba.pba_pc = pa->pa_pc; @@ -502,6 +503,7 @@ pchb_amd64ht_attach(struct device *self, struct pci_attach_args *pa, int i) pba.pba_iot = pa->pa_iot; pba.pba_memt = pa->pa_memt; pba.pba_dmat = pa->pa_dmat; + pba.pba_busex = pa->pa_busex; pba.pba_domain = pa->pa_domain; pba.pba_bus = AMD64HT_LDT_SEC_BUS_NUM(bus); pba.pba_pc = pa->pa_pc; diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c index 3d513608dd9..b513acf36fa 100644 --- a/sys/arch/i386/pci/pci_machdep.c +++ b/sys/arch/i386/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.69 2012/09/07 19:23:53 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.70 2012/09/19 23:03:12 kettenis Exp $ */ /* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */ /*- @@ -870,6 +870,7 @@ pci_intr_disestablish(pci_chipset_tag_t pc, void *cookie) struct extent *pciio_ex; struct extent *pcimem_ex; +struct extent *pcibus_ex; void pci_init_extents(void) @@ -921,6 +922,11 @@ pci_init_extents(void) extent_alloc_region(pcimem_ex, IOM_BEGIN, IOM_SIZE, EX_CONFLICTOK | EX_NOWAIT); } + + if (pcibus_ex == NULL) { + pcibus_ex = extent_create("pcibus", 0, 0xff, M_DEVBUF, + NULL, 0, EX_NOWAIT); + } } #include "acpi.h" diff --git a/sys/arch/i386/pci/pci_machdep.h b/sys/arch/i386/pci/pci_machdep.h index 0ff7a031b3a..1a45e9c9537 100644 --- a/sys/arch/i386/pci/pci_machdep.h +++ b/sys/arch/i386/pci/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.24 2012/09/07 19:23:53 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.25 2012/09/19 23:03:12 kettenis Exp $ */ /* $NetBSD: pci_machdep.h,v 1.7 1997/06/06 23:29:18 thorpej Exp $ */ /* @@ -82,6 +82,7 @@ int pci_mode_detect(void); extern struct extent *pciio_ex; extern struct extent *pcimem_ex; +extern struct extent *pcibus_ex; void pci_init_extents(void); /* |