summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/i386/pci/pci_cfgreg.c14
-rw-r--r--sys/i386/pci/pci_pir.c14
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);
OpenPOWER on IntegriCloud