ioapic_abi/x86_64: Optimize the GSI search a little bit
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 30 Oct 2011 13:50:45 +0000 (21:50 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 30 Oct 2011 13:50:45 +0000 (21:50 +0800)
Use the recorded max line based IRQ instead of scanning the whole
IRQ map array

sys/platform/pc64/apic/ioapic_abi.c

index 356d652..850df60 100644 (file)
@@ -757,7 +757,7 @@ 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);
 
-       for (irq = 0; irq < IOAPIC_HWI_VECTORS; ++irq) {
+       for (irq = 0; irq < ioapic_abi_line_irq_max; ++irq) {
                const struct ioapic_irqmap *map = &ioapic_irqmaps[irq];
 
                if (map->im_gsi == gsi) {