If the IRQ is already configured into non-level/low mode, we should not
change the trigger and polarity
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/sysctl.h>
+#include <sys/machintr.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_param.h>
/* Ask the BIOS to route this IRQ if we haven't done so already. */
if (!pci_link->pl_routed) {
+ if (machintr_legacy_intr_find(pci_link->pl_irq,
+ INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW) < 0) {
+ kprintf("$PIR: can't find irq %d\n", pci_link->pl_irq);
+ return PCI_INVALID_IRQ;
+ }
+
error = pci_pir_biosroute(bus, device, func, pin - 1,
pci_link->pl_irq);
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/sysctl.h>
+#include <sys/machintr.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_param.h>
/* Ask the BIOS to route this IRQ if we haven't done so already. */
if (!pci_link->pl_routed) {
+ if (machintr_legacy_intr_find(pci_link->pl_irq,
+ INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW) < 0) {
+ kprintf("$PIR: can't find irq %d\n", pci_link->pl_irq);
+ return PCI_INVALID_IRQ;
+ }
+
error = pci_pir_biosroute(bus, device, func, pin - 1,
pci_link->pl_irq);