--- np2/i386c/ia32/exception.c 2011/01/15 17:17:23 1.22 +++ np2/i386c/ia32/exception.c 2011/12/17 02:23:35 1.24 @@ -277,10 +277,6 @@ interrupt(int num, int intrtype, int err VERBOSE(("interrupt: gate descripter is invalid.")); EXCEPTION(GP_EXCEPTION, exc_errcode); } - if (!SEG_IS_PRESENT(&gsd)) { - VERBOSE(("interrupt: gate descriptor is not present.")); - EXCEPTION(GP_EXCEPTION, exc_errcode); - } if (!SEG_IS_SYSTEM(&gsd)) { VERBOSE(("interrupt: gate descriptor is not system segment.")); EXCEPTION(GP_EXCEPTION, exc_errcode); @@ -300,17 +296,17 @@ interrupt(int num, int intrtype, int err break; } - if (gsd.dpl < CPU_STAT_CPL) { - VERBOSE(("interrupt: gate DPL(%d) < CPL(%d)", gsd.dpl, CPU_STAT_CPL)); - EXCEPTION(GP_EXCEPTION, exc_errcode); - } - /* 5.10.1.1. 例外/割り込みハンドラ・プロシージャの保護 */ if ((intrtype != INTR_TYPE_EXTINTR) && (gsd.dpl < CPU_STAT_CPL)) { VERBOSE(("interrupt: intrtype && DPL(%d) < CPL(%d)", gsd.dpl, CPU_STAT_CPL)); EXCEPTION(GP_EXCEPTION, exc_errcode); } + if (!SEG_IS_PRESENT(&gsd)) { + VERBOSE(("interrupt: gate descriptor is not present.")); + EXCEPTION(NP_EXCEPTION, exc_errcode); + } + if (!intrtype && CPU_STAT_HLT) { CPU_EIP++; CPU_STAT_HLT = 0; @@ -345,8 +341,6 @@ interrupt_task_gate(const descriptor_t * VERBOSE(("interrupt: TASK-GATE")); - (void)intrtype; - rv = parse_selector(&task_sel, gsdp->u.gate.selector); if (rv < 0 || task_sel.ldt || !SEG_IS_SYSTEM(&task_sel.desc)) { VERBOSE(("interrupt: parse_selector (selector = %04x, rv = %d, %cDT, type = %s)", gsdp->u.gate.selector, rv, task_sel.ldt ? 'L' : 'G', task_sel.desc.s ? "code/data" : "system"));