From 891a98175a25e80a82abab8a370a4d36e99baa73 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 6 Sep 2002 22:15:44 +0000 Subject: 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. --- sys/amd64/include/pci_cfgreg.h | 1 + sys/amd64/pci/pci_cfgreg.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'sys/amd64') diff --git a/sys/amd64/include/pci_cfgreg.h b/sys/amd64/include/pci_cfgreg.h index dd51998..9109f66 100644 --- a/sys/amd64/include/pci_cfgreg.h +++ b/sys/amd64/include/pci_cfgreg.h @@ -53,3 +53,4 @@ void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int int pci_cfgintr(int bus, int device, int pin, int oldirq); int pci_kill_pcibios(void); int pci_pcibios_active(void); +int pci_probe_route_table(int bus); 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 -- cgit v1.1