From 474ba684977c7946282157da7ce728f31ebc36f1 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 16 Feb 2011 10:49:43 +0800 Subject: [PATCH] irqmap: Consume the syscall entry in irqmap --- sys/platform/pc32/apic/ioapic_abi.c | 8 ++++++-- sys/platform/pc32/icu/icu_abi.c | 2 ++ sys/platform/pc64/apic/ioapic_abi.c | 8 ++++++-- sys/platform/pc64/icu/icu_abi.c | 2 ++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/platform/pc32/apic/ioapic_abi.c b/sys/platform/pc32/apic/ioapic_abi.c index 6190cfff81..d8e89c97a3 100644 --- a/sys/platform/pc32/apic/ioapic_abi.c +++ b/sys/platform/pc32/apic/ioapic_abi.c @@ -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 */ diff --git a/sys/platform/pc32/icu/icu_abi.c b/sys/platform/pc32/icu/icu_abi.c index f063dd137b..a26d92c901 100644 --- a/sys/platform/pc32/icu/icu_abi.c +++ b/sys/platform/pc32/icu/icu_abi.c @@ -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; } diff --git a/sys/platform/pc64/apic/ioapic_abi.c b/sys/platform/pc64/apic/ioapic_abi.c index c11565938d..2f2b502b5a 100644 --- a/sys/platform/pc64/apic/ioapic_abi.c +++ b/sys/platform/pc64/apic/ioapic_abi.c @@ -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 */ diff --git a/sys/platform/pc64/icu/icu_abi.c b/sys/platform/pc64/icu/icu_abi.c index 6789b8e8db..ab6197f6bb 100644 --- a/sys/platform/pc64/icu/icu_abi.c +++ b/sys/platform/pc64/icu/icu_abi.c @@ -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; } -- 2.41.0