diff options
author | imp <imp@FreeBSD.org> | 2003-08-01 21:31:36 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2003-08-01 21:31:36 +0000 |
commit | 4181b4df7729879757484903982430bdbd639b6d (patch) | |
tree | ac16301c0a9b38d4077d0ed801387d3a73ddcc6c | |
parent | 7f68ee2b318e1ec23413620143ef9e28a7897a2d (diff) | |
download | FreeBSD-src-4181b4df7729879757484903982430bdbd639b6d.zip FreeBSD-src-4181b4df7729879757484903982430bdbd639b6d.tar.gz |
Add hw.pci.irq_override_mask, which is a mask of interrupts that are
considered to be good to try when it otherwise has no clue about which
interrupts to try. This is a band-aide and we really should try to
balance the IRQs that we arbitrarily pick, but it should help some
people that would otherwise get bad IRQs.
-rw-r--r-- | sys/i386/pci/pci_cfgreg.c | 14 | ||||
-rw-r--r-- | sys/i386/pci/pci_pir.c | 14 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index 31c0e62..53d2261 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/lock.h> #include <sys/mutex.h> +#include <sys/sysctl.h> #include <vm/vm.h> #include <vm/pmap.h> #include <machine/md_var.h> @@ -78,6 +79,17 @@ static int pci_route_count; static struct mtx pcicfg_mtx; +/* sysctl vars */ +SYSCTL_DECL(_hw_pci); + +static uint32_t pci_irq_override_mask = 0xdef4; +TUNABLE_INT("hw.pci.irq_override_mask", &pci_irq_override_mask); +SYSCTL_INT(_hw_pci, OID_AUTO, irq_override_mask, CTLFLAG_RD, + &pci_irq_override_mask, 0xdef4, + "Mask of allowed irqs to try to route when it has no good clue about\n" + "which irqs it should use."); + + /* * Some BIOS writers seem to want to ignore the spec and put * 0 in the intline rather than 255 to indicate none. Some use @@ -515,6 +527,8 @@ pci_cfgintr_virgin(struct PIR_entry *pe, int pin) /* life is tough, so just pick an interrupt */ for (irq = 0; irq < 16; irq++) { ibit = (1 << irq); + if ((ibit & pci_irq_override_mask) == 0) + continue; if (pe->pe_intpin[pin - 1].irqs & ibit) { PRVERB(("pci_cfgintr_virgin: using routable interrupt %d\n", irq)); return(irq); diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c index 31c0e62..53d2261 100644 --- a/sys/i386/pci/pci_pir.c +++ b/sys/i386/pci/pci_pir.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/lock.h> #include <sys/mutex.h> +#include <sys/sysctl.h> #include <vm/vm.h> #include <vm/pmap.h> #include <machine/md_var.h> @@ -78,6 +79,17 @@ static int pci_route_count; static struct mtx pcicfg_mtx; +/* sysctl vars */ +SYSCTL_DECL(_hw_pci); + +static uint32_t pci_irq_override_mask = 0xdef4; +TUNABLE_INT("hw.pci.irq_override_mask", &pci_irq_override_mask); +SYSCTL_INT(_hw_pci, OID_AUTO, irq_override_mask, CTLFLAG_RD, + &pci_irq_override_mask, 0xdef4, + "Mask of allowed irqs to try to route when it has no good clue about\n" + "which irqs it should use."); + + /* * Some BIOS writers seem to want to ignore the spec and put * 0 in the intline rather than 255 to indicate none. Some use @@ -515,6 +527,8 @@ pci_cfgintr_virgin(struct PIR_entry *pe, int pin) /* life is tough, so just pick an interrupt */ for (irq = 0; irq < 16; irq++) { ibit = (1 << irq); + if ((ibit & pci_irq_override_mask) == 0) + continue; if (pe->pe_intpin[pin - 1].irqs & ibit) { PRVERB(("pci_cfgintr_virgin: using routable interrupt %d\n", irq)); return(irq); |