ioapic: Don't assert that interrupt mode are level/low or edge/high
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 25 Mar 2011 13:04:38 +0000 (21:04 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 25 Mar 2011 14:59:05 +0000 (22:59 +0800)
For ACPI SCI, other combinations may be used by brain damaged BIOSes.

sys/platform/pc32/apic/ioapic_abi.c
sys/platform/pc64/apic/ioapic_abi.c

index 5c678a4..f552d2d 100644 (file)
@@ -674,8 +674,6 @@ ioapic_abi_set_irqmap(int irq, int gsi, enum intr_trigger trig,
 
        KKASSERT(trig == INTR_TRIGGER_EDGE || trig == INTR_TRIGGER_LEVEL);
        KKASSERT(pola == INTR_POLARITY_HIGH || pola == INTR_POLARITY_LOW);
-       KKASSERT((trig == INTR_TRIGGER_EDGE && pola == INTR_POLARITY_HIGH) ||
-                (trig == INTR_TRIGGER_LEVEL && pola == INTR_POLARITY_LOW));
 
        KKASSERT(irq >= 0 && irq < IOAPIC_HWI_VECTORS);
        map = &ioapic_irqmaps[irq];
@@ -736,8 +734,6 @@ ioapic_abi_find_gsi(int gsi, enum intr_trigger trig, enum intr_polarity pola)
 
        KKASSERT(trig == INTR_TRIGGER_EDGE || trig == INTR_TRIGGER_LEVEL);
        KKASSERT(pola == INTR_POLARITY_HIGH || pola == INTR_POLARITY_LOW);
-       KKASSERT((trig == INTR_TRIGGER_EDGE && pola == INTR_POLARITY_HIGH) ||
-                (trig == INTR_TRIGGER_LEVEL && pola == INTR_POLARITY_LOW));
 
        for (irq = 0; irq < IOAPIC_HWI_VECTORS; ++irq) {
                const struct ioapic_irqmap *map = &ioapic_irqmaps[irq];
@@ -763,8 +759,6 @@ ioapic_abi_find_irq(int irq, enum intr_trigger trig, enum intr_polarity pola)
 
        KKASSERT(trig == INTR_TRIGGER_EDGE || trig == INTR_TRIGGER_LEVEL);
        KKASSERT(pola == INTR_POLARITY_HIGH || pola == INTR_POLARITY_LOW);
-       KKASSERT((trig == INTR_TRIGGER_EDGE && pola == INTR_POLARITY_HIGH) ||
-                (trig == INTR_TRIGGER_LEVEL && pola == INTR_POLARITY_LOW));
 
        if (irq < 0 || irq >= IOAPIC_HWI_VECTORS)
                return -1;
@@ -798,8 +792,6 @@ ioapic_intr_config(int irq, enum intr_trigger trig, enum intr_polarity pola)
 
        KKASSERT(trig == INTR_TRIGGER_EDGE || trig == INTR_TRIGGER_LEVEL);
        KKASSERT(pola == INTR_POLARITY_HIGH || pola == INTR_POLARITY_LOW);
-       KKASSERT((trig == INTR_TRIGGER_EDGE && pola == INTR_POLARITY_HIGH) ||
-                (trig == INTR_TRIGGER_LEVEL && pola == INTR_POLARITY_LOW));
 
        KKASSERT(irq >= 0 && irq < IOAPIC_HWI_VECTORS);
        map = &ioapic_irqmaps[irq];
index 6fbed8b..3179356 100644 (file)
@@ -667,8 +667,6 @@ ioapic_abi_set_irqmap(int irq, int gsi, enum intr_trigger trig,
 
        KKASSERT(trig == INTR_TRIGGER_EDGE || trig == INTR_TRIGGER_LEVEL);
        KKASSERT(pola == INTR_POLARITY_HIGH || pola == INTR_POLARITY_LOW);
-       KKASSERT((trig == INTR_TRIGGER_EDGE && pola == INTR_POLARITY_HIGH) ||
-                (trig == INTR_TRIGGER_LEVEL && pola == INTR_POLARITY_LOW));
 
        KKASSERT(irq >= 0 && irq < IOAPIC_HWI_VECTORS);
        map = &ioapic_irqmaps[irq];
@@ -729,8 +727,6 @@ ioapic_abi_find_gsi(int gsi, enum intr_trigger trig, enum intr_polarity pola)
 
        KKASSERT(trig == INTR_TRIGGER_EDGE || trig == INTR_TRIGGER_LEVEL);
        KKASSERT(pola == INTR_POLARITY_HIGH || pola == INTR_POLARITY_LOW);
-       KKASSERT((trig == INTR_TRIGGER_EDGE && pola == INTR_POLARITY_HIGH) ||
-                (trig == INTR_TRIGGER_LEVEL && pola == INTR_POLARITY_LOW));
 
        for (irq = 0; irq < IOAPIC_HWI_VECTORS; ++irq) {
                const struct ioapic_irqmap *map = &ioapic_irqmaps[irq];
@@ -756,8 +752,6 @@ ioapic_abi_find_irq(int irq, enum intr_trigger trig, enum intr_polarity pola)
 
        KKASSERT(trig == INTR_TRIGGER_EDGE || trig == INTR_TRIGGER_LEVEL);
        KKASSERT(pola == INTR_POLARITY_HIGH || pola == INTR_POLARITY_LOW);
-       KKASSERT((trig == INTR_TRIGGER_EDGE && pola == INTR_POLARITY_HIGH) ||
-                (trig == INTR_TRIGGER_LEVEL && pola == INTR_POLARITY_LOW));
 
        if (irq < 0 || irq >= IOAPIC_HWI_VECTORS)
                return -1;
@@ -791,8 +785,6 @@ ioapic_intr_config(int irq, enum intr_trigger trig, enum intr_polarity pola)
 
        KKASSERT(trig == INTR_TRIGGER_EDGE || trig == INTR_TRIGGER_LEVEL);
        KKASSERT(pola == INTR_POLARITY_HIGH || pola == INTR_POLARITY_LOW);
-       KKASSERT((trig == INTR_TRIGGER_EDGE && pola == INTR_POLARITY_HIGH) ||
-                (trig == INTR_TRIGGER_LEVEL && pola == INTR_POLARITY_LOW));
 
        KKASSERT(irq >= 0 && irq < IOAPIC_HWI_VECTORS);
        map = &ioapic_irqmaps[irq];