ioapic: During initmap, only GSIs should be configured.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 17 Mar 2011 11:28:22 +0000 (19:28 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 18 Mar 2011 07:31:35 +0000 (15:31 +0800)
sys/platform/pc32/apic/ioapic_abi.c
sys/platform/pc64/apic/ioapic_abi.c

index d8e89c9..f1ebf2e 100644 (file)
@@ -717,19 +717,13 @@ ioapic_setdefault(void)
        }
 }
 
-/* XXX magic number */
 static void
 ioapic_initmap(void)
 {
        int i;
 
-       for (i = 0; i < 16; ++i) {
-               struct ioapic_irqmap *map = &ioapic_irqmaps[i];
-
-               map->im_type = IOAPIC_IMT_LINE;
-               map->im_trig = INTR_TRIGGER_EDGE;
-               map->im_gsi = i;
-       }
+       for (i = 0; i < IOAPIC_HWI_VECTORS; ++i)
+               ioapic_irqmaps[i].im_gsi = -1;
        ioapic_irqmaps[IOAPIC_HWI_SYSCALL].im_type = IOAPIC_IMT_SYSCALL;
 }
 
index 2f2b502..519778d 100644 (file)
@@ -710,19 +710,13 @@ ioapic_setdefault(void)
        }
 }
 
-/* XXX magic number */
 static void
 ioapic_initmap(void)
 {
        int i;
 
-       for (i = 0; i < 16; ++i) {
-               struct ioapic_irqmap *map = &ioapic_irqmaps[i];
-
-               map->im_type = IOAPIC_IMT_LINE;
-               map->im_trig = INTR_TRIGGER_EDGE;
-               map->im_gsi = i;
-       }
+       for (i = 0; i < IOAPIC_HWI_VECTORS; ++i)
+               ioapic_irqmaps[i].im_gsi = -1;
        ioapic_irqmaps[IOAPIC_HWI_SYSCALL].im_type = IOAPIC_IMT_SYSCALL;
 }