From: Sepherosa Ziehau Date: Sun, 30 Oct 2011 13:50:45 +0000 (+0800) Subject: ioapic_abi/x86_64: Optimize the GSI search a little bit X-Git-Tag: v3.0.0~773 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/dc844205199e9b290c8298fcc826b3c770542be1 ioapic_abi/x86_64: Optimize the GSI search a little bit Use the recorded max line based IRQ instead of scanning the whole IRQ map array --- diff --git a/sys/platform/pc64/apic/ioapic_abi.c b/sys/platform/pc64/apic/ioapic_abi.c index 356d65299f..850df60068 100644 --- a/sys/platform/pc64/apic/ioapic_abi.c +++ b/sys/platform/pc64/apic/ioapic_abi.c @@ -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) {