irqmap: Consume the syscall entry in irqmap
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 16 Feb 2011 02:49:43 +0000 (10:49 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 16 Feb 2011 03:05:25 +0000 (11:05 +0800)
sys/platform/pc32/apic/ioapic_abi.c
sys/platform/pc32/icu/icu_abi.c
sys/platform/pc64/apic/ioapic_abi.c
sys/platform/pc64/icu/icu_abi.c

index 6190cff..d8e89c9 100644 (file)
@@ -449,6 +449,8 @@ static inthand_t *ioapic_intr[IOAPIC_HWI_VECTORS] = {
        &IDTVEC(ioapic_intr191)
 };
 
+#define IOAPIC_HWI_SYSCALL     (IDT_OFFSET_SYSCALL - IDT_OFFSET)
+
 static struct ioapic_irqmap {
        int                     im_type;        /* IOAPIC_IMT_ */
        enum intr_trigger       im_trig;
@@ -458,6 +460,7 @@ static struct ioapic_irqmap {
 #define IOAPIC_IMT_UNUSED      0
 #define IOAPIC_IMT_RESERVED    1
 #define IOAPIC_IMT_LINE                2
+#define IOAPIC_IMT_SYSCALL     3
 
 extern void    IOAPIC_INTREN(int);
 extern void    IOAPIC_INTRDIS(int);
@@ -615,7 +618,7 @@ ioapic_vectorctl(int op, int intr, int flags)
        u_long ef;
 
        if (intr < 0 || intr >= IOAPIC_HWI_VECTORS ||
-           intr == IDT_OFFSET_SYSCALL - IDT_OFFSET)
+           intr == IOAPIC_HWI_SYSCALL)
                return EINVAL;
 
        ef = read_eflags();
@@ -707,7 +710,7 @@ ioapic_setdefault(void)
        int intr;
 
        for (intr = 0; intr < IOAPIC_HWI_VECTORS; ++intr) {
-               if (intr == IDT_OFFSET_SYSCALL - IDT_OFFSET)
+               if (intr == IOAPIC_HWI_SYSCALL)
                        continue;
                setidt(IDT_OFFSET + intr, ioapic_intr[intr], SDT_SYS386IGT,
                       SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
@@ -727,6 +730,7 @@ ioapic_initmap(void)
                map->im_trig = INTR_TRIGGER_EDGE;
                map->im_gsi = i;
        }
+       ioapic_irqmaps[IOAPIC_HWI_SYSCALL].im_type = IOAPIC_IMT_SYSCALL;
 }
 
 #endif /* SMP */
index f063dd1..a26d92c 100644 (file)
@@ -89,6 +89,7 @@ static struct icu_irqmap {
 #define ICU_IMT_UNUSED         0       /* KEEP THIS */
 #define ICU_IMT_RESERVED       1
 #define ICU_IMT_LINE           2
+#define ICU_IMT_SYSCALL                3
 
 extern void    ICU_INTREN(int);
 extern void    ICU_INTRDIS(int);
@@ -305,4 +306,5 @@ icu_initmap(void)
                        }
                }
        }
+       icu_irqmaps[IDT_OFFSET_SYSCALL - IDT_OFFSET].im_type = ICU_IMT_SYSCALL;
 }
index c115659..2f2b502 100644 (file)
@@ -449,6 +449,8 @@ static inthand_t *ioapic_intr[IOAPIC_HWI_VECTORS] = {
        &IDTVEC(ioapic_intr191)
 };
 
+#define IOAPIC_HWI_SYSCALL     (IDT_OFFSET_SYSCALL - IDT_OFFSET)
+
 static struct ioapic_irqmap {
        int                     im_type;        /* IOAPIC_IMT_ */
        enum intr_trigger       im_trig;
@@ -458,6 +460,7 @@ static struct ioapic_irqmap {
 #define IOAPIC_IMT_UNUSED      0
 #define IOAPIC_IMT_RESERVED    1
 #define IOAPIC_IMT_LINE                2
+#define IOAPIC_IMT_SYSCALL     3
 
 extern void    IOAPIC_INTREN(int);
 extern void    IOAPIC_INTRDIS(int);
@@ -615,7 +618,7 @@ ioapic_vectorctl(int op, int intr, int flags)
        register_t ef;
 
        if (intr < 0 || intr >= IOAPIC_HWI_VECTORS ||
-           intr == IDT_OFFSET_SYSCALL - IDT_OFFSET)
+           intr == IOAPIC_HWI_SYSCALL)
                return EINVAL;
 
        ef = read_rflags();
@@ -700,7 +703,7 @@ ioapic_setdefault(void)
        int intr;
 
        for (intr = 0; intr < IOAPIC_HWI_VECTORS; ++intr) {
-               if (intr == IDT_OFFSET_SYSCALL - IDT_OFFSET)
+               if (intr == IOAPIC_HWI_SYSCALL)
                        continue;
                setidt(IDT_OFFSET + intr, ioapic_intr[intr], SDT_SYSIGT,
                       SEL_KPL, 0);
@@ -720,6 +723,7 @@ ioapic_initmap(void)
                map->im_trig = INTR_TRIGGER_EDGE;
                map->im_gsi = i;
        }
+       ioapic_irqmaps[IOAPIC_HWI_SYSCALL].im_type = IOAPIC_IMT_SYSCALL;
 }
 
 #endif /* SMP */
index 6789b8e..ab6197f 100644 (file)
@@ -89,6 +89,7 @@ static struct icu_irqmap {
 #define ICU_IMT_UNUSED         0       /* KEEP THIS */
 #define ICU_IMT_RESERVED       1
 #define ICU_IMT_LINE           2
+#define ICU_IMT_SYSCALL                3
 
 extern void    ICU_INTREN(int);
 extern void    ICU_INTRDIS(int);
@@ -305,4 +306,5 @@ icu_initmap(void)
                        }
                }
        }
+       icu_irqmaps[i].im_type = ICU_IMT_SYSCALL;
 }