From: Sepherosa Ziehau Date: Tue, 20 Dec 2011 11:47:23 +0000 (+0800) Subject: i386/ioapic_abi: Mark the unused IOAPIC irqmap as reserved X-Git-Tag: v3.0.0~341 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/1973dfbc6acee8c38f5caae1f5669e08d42b0bdc i386/ioapic_abi: Mark the unused IOAPIC irqmap as reserved Since IDT on i386 is shared, we need to guard against reuse an already used IDT entry --- diff --git a/sys/platform/pc32/apic/ioapic_abi.c b/sys/platform/pc32/apic/ioapic_abi.c index 2923186f92..7441c74983 100644 --- a/sys/platform/pc32/apic/ioapic_abi.c +++ b/sys/platform/pc32/apic/ioapic_abi.c @@ -799,10 +799,14 @@ ioapic_abi_fixup_irqmap(void) { int cpu; + ioapic_abi_line_irq_max += 1; + if (bootverbose) + kprintf("IOAPIC: line irq max %d\n", ioapic_abi_line_irq_max); + for (cpu = 0; cpu < ncpus; ++cpu) { int i; - for (i = 0; i < ISA_IRQ_CNT; ++i) { + for (i = 0; i < ioapic_abi_line_irq_max; ++i) { struct ioapic_irqmap *map = &ioapic_irqmaps[cpu][i]; if (map->im_type == IOAPIC_IMT_UNUSED) { @@ -814,10 +818,6 @@ ioapic_abi_fixup_irqmap(void) } } } - - ioapic_abi_line_irq_max += 1; - if (bootverbose) - kprintf("IOAPIC: line irq max %d\n", ioapic_abi_line_irq_max); } int