ioapic/abi: Mark unused ISA IRQs as reserved
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 20 Mar 2011 04:37:45 +0000 (12:37 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 20 Mar 2011 04:37:45 +0000 (12:37 +0800)
sys/platform/pc32/apic/ioapic_abi.c
sys/platform/pc32/apic/ioapic_abi.h
sys/platform/pc32/apic/mpapic.c
sys/platform/pc64/apic/ioapic_abi.c
sys/platform/pc64/apic/ioapic_abi.h
sys/platform/pc64/apic/mpapic.c

index bd1be50..3835d6c 100644 (file)
@@ -710,6 +710,22 @@ ioapic_abi_set_irqmap(int irq, int gsi, enum intr_trigger trig,
        imen_unlock();
 }
 
+void
+ioapic_abi_fixup_irqmap(void)
+{
+       int i;
+
+       for (i = 0; i < 16; ++i) {
+               struct ioapic_irqmap *map = &ioapic_irqmaps[i];
+
+               if (map->im_type == IOAPIC_IMT_UNUSED) {
+                       map->im_type = IOAPIC_IMT_RESERVED;
+                       if (bootverbose)
+                               kprintf("IOAPIC: irq %d reserved\n", i);
+               }
+       }
+}
+
 static void
 ioapic_intr_config(int irq, enum intr_trigger trig, enum intr_polarity pola)
 {
index b43c46e..7216236 100644 (file)
@@ -50,6 +50,7 @@
 extern struct machintr_abi MachIntrABI_IOAPIC;
 
 void   ioapic_abi_set_irqmap(int, int, enum intr_trigger, enum intr_polarity);
+void   ioapic_abi_fixup_irqmap(void);
 
 #endif /* SMP */
 
index c29a3dc..570a9cf 100644 (file)
@@ -1200,6 +1200,7 @@ ioapic_config(void)
                 */
                TAILQ_FOREACH(info, &ioapic_conf.ioc_list, io_link)
                        ioapic_setup(info);
+               ioapic_abi_fixup_irqmap();
 
                write_eflags(ef);
 
index de135b3..63bee9f 100644 (file)
@@ -703,6 +703,22 @@ ioapic_abi_set_irqmap(int irq, int gsi, enum intr_trigger trig,
        imen_unlock();
 }
 
+void
+ioapic_abi_fixup_irqmap(void)
+{
+       int i;
+
+       for (i = 0; i < 16; ++i) {
+               struct ioapic_irqmap *map = &ioapic_irqmaps[i];
+
+               if (map->im_type == IOAPIC_IMT_UNUSED) {
+                       map->im_type = IOAPIC_IMT_RESERVED;
+                       if (bootverbose)
+                               kprintf("IOAPIC: irq %d reserved\n", i);
+               }
+       }
+}
+
 static void
 ioapic_intr_config(int irq, enum intr_trigger trig, enum intr_polarity pola)
 {
index b43c46e..7216236 100644 (file)
@@ -50,6 +50,7 @@
 extern struct machintr_abi MachIntrABI_IOAPIC;
 
 void   ioapic_abi_set_irqmap(int, int, enum intr_trigger, enum intr_polarity);
+void   ioapic_abi_fixup_irqmap(void);
 
 #endif /* SMP */
 
index 8244af3..8d8bc4a 100644 (file)
@@ -1262,6 +1262,7 @@ ioapic_config(void)
                 */
                TAILQ_FOREACH(info, &ioapic_conf.ioc_list, io_link)
                        ioapic_setup(info);
+               ioapic_abi_fixup_irqmap();
 
                write_rflags(ef);