diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -72,19 +72,33 @@ { struct lookup_irq_request *req; size_t len; - u_int irqnum, irq, trig, pol; + u_int irqnum, trig, pol; + bool found; + + found = false; + req = (struct lookup_irq_request *)context; switch (res->Type) { case ACPI_RESOURCE_TYPE_IRQ: irqnum = res->Data.Irq.InterruptCount; - irq = res->Data.Irq.Interrupts[0]; + for (int i = 0; i < irqnum; i++) { + if (res->Data.Irq.Interrupts[i] == req->irq) { + found = true; + break; + } + } len = ACPI_RS_SIZE(ACPI_RESOURCE_IRQ); trig = res->Data.Irq.Triggering; pol = res->Data.Irq.Polarity; break; case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: irqnum = res->Data.ExtendedIrq.InterruptCount; - irq = res->Data.ExtendedIrq.Interrupts[0]; + for (int i = 0; i < irqnum; i++) { + if (res->Data.ExtendedIrq.Interrupts[i] == req->irq) { + found = true; + break; + } + } len = ACPI_RS_SIZE(ACPI_RESOURCE_EXTENDED_IRQ); trig = res->Data.ExtendedIrq.Triggering; pol = res->Data.ExtendedIrq.Polarity; @@ -92,18 +106,13 @@ default: return (AE_OK); } - if (irqnum != 1) + if (!found) return (AE_OK); - req = (struct lookup_irq_request *)context; if (req->checkrid) { if (req->counter != req->rid) { req->counter++; return (AE_OK); } - KASSERT(irq == req->irq, ("IRQ resources do not match")); - } else { - if (req->irq != irq) - return (AE_OK); } req->found = 1; req->pol = pol;