diff options
-rw-r--r-- | sys/amd64/include/pci_cfgreg.h | 1 | ||||
-rw-r--r-- | sys/amd64/pci/pci_cfgreg.c | 19 | ||||
-rw-r--r-- | sys/i386/include/pci_cfgreg.h | 1 | ||||
-rw-r--r-- | sys/i386/pci/pci_cfgreg.c | 19 | ||||
-rw-r--r-- | sys/i386/pci/pci_pir.c | 19 |
5 files changed, 59 insertions, 0 deletions
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 diff --git a/sys/i386/include/pci_cfgreg.h b/sys/i386/include/pci_cfgreg.h index dd51998..9109f66 100644 --- a/sys/i386/include/pci_cfgreg.h +++ b/sys/i386/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/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index 25c5251..1562fd9 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/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 diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c index 25c5251..1562fd9 100644 --- a/sys/i386/pci/pci_pir.c +++ b/sys/i386/pci/pci_pir.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 |