summaryrefslogtreecommitdiffstats
path: root/sys/amd64/pci
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-09-06 22:15:44 +0000
committerjhb <jhb@FreeBSD.org>2002-09-06 22:15:44 +0000
commit891a98175a25e80a82abab8a370a4d36e99baa73 (patch)
tree4fa09345514ae91ac0e6a8c54ba3e7357236d924 /sys/amd64/pci
parent6e666d91a9b94017de7e8dcd7c4a45f913f01be1 (diff)
downloadFreeBSD-src-891a98175a25e80a82abab8a370a4d36e99baa73.zip
FreeBSD-src-891a98175a25e80a82abab8a370a4d36e99baa73.tar.gz
Add a function pci_probe_route_table() that returns true if our PCI BIOS
supports interrupt routing and if the specified PCI bus is present in the routing table.
Diffstat (limited to 'sys/amd64/pci')
-rw-r--r--sys/amd64/pci/pci_cfgreg.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c
index 25c5251..1562fd9 100644
--- a/sys/amd64/pci/pci_cfgreg.c
+++ b/sys/amd64/pci/pci_cfgreg.c
@@ -576,6 +576,25 @@ pci_print_route_table(struct PIR_table *prt, int size)
}
/*
+ * See if any interrupts for a given PCI bus are routed in the PIR. Don't
+ * even bother looking if the BIOS doesn't support routing anyways.
+ */
+int
+pci_probe_route_table(int bus)
+{
+ int i;
+ u_int16_t v;
+
+ v = pcibios_get_version();
+ if (v < 0x0210)
+ return (0);
+ for (i = 0; i < pci_route_count; i++)
+ if (pci_route_table->pt_entry[i].pe_bus == bus)
+ return (1);
+ return (0);
+}
+
+/*
* Config space access using BIOS functions
*/
static int
OpenPOWER on IntegriCloud