summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2012-09-19 23:23:51 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2012-09-19 23:23:51 +0000
commit1030b4ab06a0016e5f2d795e5f008e1e3e539788 (patch)
tree26d95f93f10573fea2f72b1af09787f33eb33d13 /sys
parent8e8e8b6c61ecdac3d56820301245d42f8630ab4a (diff)
Set up PCI bus number resource accounting for the main PCI bus hierarchy.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/mainbus.c3
-rw-r--r--sys/arch/amd64/include/pci_machdep.h3
-rw-r--r--sys/arch/amd64/pci/pchb.c4
-rw-r--r--sys/arch/amd64/pci/pci_machdep.c8
4 files changed, 14 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/mainbus.c b/sys/arch/amd64/amd64/mainbus.c
index 161034edf0b..064ef2cf7aa 100644
--- a/sys/arch/amd64/amd64/mainbus.c
+++ b/sys/arch/amd64/amd64/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.24 2011/10/21 20:48:11 kettenis Exp $ */
+/* $OpenBSD: mainbus.c,v 1.25 2012/09/19 23:23:50 kettenis Exp $ */
/* $NetBSD: mainbus.c,v 1.1 2003/04/26 18:39:29 fvdl Exp $ */
/*
@@ -214,6 +214,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/amd64/include/pci_machdep.h b/sys/arch/amd64/include/pci_machdep.h
index 9a41a1e1493..51894074a34 100644
--- a/sys/arch/amd64/include/pci_machdep.h
+++ b/sys/arch/amd64/include/pci_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.h,v 1.20 2012/09/07 19:23:16 kettenis Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.21 2012/09/19 23:23:50 kettenis Exp $ */
/* $NetBSD: pci_machdep.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */
/*
@@ -66,6 +66,7 @@ struct pci_attach_args;
extern struct extent *pciio_ex;
extern struct extent *pcimem_ex;
+extern struct extent *pcibus_ex;
void pci_init_extents(void);
/*
diff --git a/sys/arch/amd64/pci/pchb.c b/sys/arch/amd64/pci/pchb.c
index 451059c4ce5..e874db8e524 100644
--- a/sys/arch/amd64/pci/pchb.c
+++ b/sys/arch/amd64/pci/pchb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pchb.c,v 1.37 2010/08/31 17:13:46 deraadt Exp $ */
+/* $OpenBSD: pchb.c,v 1.38 2012/09/19 23:23:50 kettenis Exp $ */
/* $NetBSD: pchb.c,v 1.1 2003/04/26 18:39:50 fvdl Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -266,6 +266,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;
@@ -358,6 +359,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/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c
index 6ca81512f95..256463d437f 100644
--- a/sys/arch/amd64/pci/pci_machdep.c
+++ b/sys/arch/amd64/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.54 2012/09/07 19:21:57 kettenis Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.55 2012/09/19 23:23:50 kettenis Exp $ */
/* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -595,6 +595,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)
@@ -652,6 +653,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"