diff options
author | jhb <jhb@FreeBSD.org> | 2002-09-06 22:15:44 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-09-06 22:15:44 +0000 |
commit | 891a98175a25e80a82abab8a370a4d36e99baa73 (patch) | |
tree | 4fa09345514ae91ac0e6a8c54ba3e7357236d924 | |
parent | 6e666d91a9b94017de7e8dcd7c4a45f913f01be1 (diff) | |
download | FreeBSD-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.
-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 |