acpi/fadt: Make sure that SCI IRQ is valid
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 28 Aug 2012 05:43:35 +0000 (13:43 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 28 Aug 2012 05:43:35 +0000 (13:43 +0800)
sys/platform/pc32/acpica5/acpi_fadt.c
sys/platform/pc64/acpica5/acpi_fadt.c

index 4f752ab..6918f25 100644 (file)
@@ -184,6 +184,14 @@ acpi_sci_config(void)
 
        KKASSERT(mycpuid == 0);
 
 
        KKASSERT(mycpuid == 0);
 
+       if (machintr_legacy_intr_find(acpi_sci_irq,
+           INTR_TRIGGER_CONFORM, INTR_POLARITY_CONFORM) < 0) {
+               kprintf("ACPI FADT: SCI irq %d is invalid, disable\n",
+                   acpi_sci_irq);
+               acpi_sci_irq = -1;
+               return;
+       }
+
        if (acpi_sci_irq < 0)
                return;
 
        if (acpi_sci_irq < 0)
                return;
 
index 4f752ab..6918f25 100644 (file)
@@ -184,6 +184,14 @@ acpi_sci_config(void)
 
        KKASSERT(mycpuid == 0);
 
 
        KKASSERT(mycpuid == 0);
 
+       if (machintr_legacy_intr_find(acpi_sci_irq,
+           INTR_TRIGGER_CONFORM, INTR_POLARITY_CONFORM) < 0) {
+               kprintf("ACPI FADT: SCI irq %d is invalid, disable\n",
+                   acpi_sci_irq);
+               acpi_sci_irq = -1;
+               return;
+       }
+
        if (acpi_sci_irq < 0)
                return;
 
        if (acpi_sci_irq < 0)
                return;