diff options
author | marius <marius@FreeBSD.org> | 2007-09-30 11:05:18 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2007-09-30 11:05:18 +0000 |
commit | d60b8a3096c2760d921f7f4b6e99280cb82f8c7b (patch) | |
tree | 8043b70223b1a26b9d8903a04633a168390b18dc /sys/dev/acpica/acpi_pci.c | |
parent | 9ea9e12f35ecb014cf0a8b5047b850605706741b (diff) | |
download | FreeBSD-src-d60b8a3096c2760d921f7f4b6e99280cb82f8c7b.zip FreeBSD-src-d60b8a3096c2760d921f7f4b6e99280cb82f8c7b.tar.gz |
Make the PCI code aware of PCI domains (aka PCI segments) so we can
support machines having multiple independently numbered PCI domains
and don't support reenumeration without ambiguity amongst the
devices as seen by the OS and represented by PCI location strings.
This includes introducing a function pci_find_dbsf(9) which works
like pci_find_bsf(9) but additionally takes a domain number argument
and limiting pci_find_bsf(9) to only search devices in domain 0 (the
only domain in single-domain systems). Bge(4) and ofw_pcibus(4) are
changed to use pci_find_dbsf(9) instead of pci_find_bsf(9) in order
to no longer report false positives when searching for siblings and
dupe devices in the same domain respectively.
Along with this change the sole host-PCI bridge driver converted to
actually make use of PCI domain support is uninorth(4), the others
continue to use domain 0 only for now and need to be converted as
appropriate later on.
Note that this means that the format of the location strings as used
by pciconf(8) has been changed and that consumers of <sys/pciio.h>
potentially need to be recompiled.
Suggested by: jhb
Reviewed by: grehan, jhb, marcel
Approved by: re (kensmith), jhb (PCI maintainer hat)
Diffstat (limited to 'sys/dev/acpica/acpi_pci.c')
-rw-r--r-- | sys/dev/acpica/acpi_pci.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/acpica/acpi_pci.c b/sys/dev/acpica/acpi_pci.c index c909ac5..ed22417 100644 --- a/sys/dev/acpica/acpi_pci.c +++ b/sys/dev/acpica/acpi_pci.c @@ -275,17 +275,19 @@ acpi_pci_probe(device_t dev) static int acpi_pci_attach(device_t dev) { - int busno; + int busno, domain; /* * Since there can be multiple independantly numbered PCI * busses on systems with multiple PCI domains, we can't use * the unit number to decide which bus we are probing. We ask - * the parent pcib what our bus number is. + * the parent pcib what our domain and bus numbers are. */ + domain = pcib_get_domain(dev); busno = pcib_get_bus(dev); if (bootverbose) - device_printf(dev, "physical bus=%d\n", busno); + device_printf(dev, "domain=%d, physical bus=%d\n", + domain, busno); /* * First, PCI devices are added as in the normal PCI bus driver. @@ -297,7 +299,7 @@ acpi_pci_attach(device_t dev) * pci_add_children() doesn't find. We currently just ignore * these devices. */ - pci_add_children(dev, busno, sizeof(struct acpi_pci_devinfo)); + pci_add_children(dev, domain, busno, sizeof(struct acpi_pci_devinfo)); AcpiWalkNamespace(ACPI_TYPE_DEVICE, acpi_get_handle(dev), 1, acpi_pci_save_handle, dev, NULL); |