Diff for /np2/i386c/ia32/exception.c between versions 1.22 and 1.25

version 1.22, 2011/01/15 17:17:23 version 1.25, 2011/12/17 02:39:06
Line 124  exception(int num, int error_code) Line 124  exception(int num, int error_code)
         if (CPU_STATSAVE.cpu_stat.backout_sp) {          if (CPU_STATSAVE.cpu_stat.backout_sp) {
                 VERBOSE(("exception: restore stack pointer."));                  VERBOSE(("exception: restore stack pointer."));
                 CPU_ESP = CPU_PREV_ESP;                  CPU_ESP = CPU_PREV_ESP;
                   CPU_STATSAVE.cpu_stat.backout_sp = 0;
         }          }
         CPU_STATSAVE.cpu_stat.backout_sp = 0;  
   
         if (CPU_STAT_EXCEPTION_COUNTER >= 2) {          if (CPU_STAT_EXCEPTION_COUNTER >= 2) {
                 if (dftable[exctype[CPU_STAT_PREV_EXCEPTION]][exctype[num]]) {                  if (dftable[exctype[CPU_STAT_PREV_EXCEPTION]][exctype[num]]) {
Line 256  interrupt(int num, int intrtype, int err Line 256  interrupt(int num, int intrtype, int err
 #if defined(DEBUG)  #if defined(DEBUG)
                 if (num == 0x80) {                  if (num == 0x80) {
                         /* Linux, FreeBSD, NetBSD, OpenBSD system call */                          /* Linux, FreeBSD, NetBSD, OpenBSD system call */
                         VERBOSE(("interrupt: syscall no = %d\n%s", CPU_EAX, cpu_reg2str()));                          VERBOSE(("interrupt: syscall# = %d\n%s", CPU_EAX, cpu_reg2str()));
                 }                  }
 #endif  #endif
   
Line 277  interrupt(int num, int intrtype, int err Line 277  interrupt(int num, int intrtype, int err
                         VERBOSE(("interrupt: gate descripter is invalid."));                          VERBOSE(("interrupt: gate descripter is invalid."));
                         EXCEPTION(GP_EXCEPTION, exc_errcode);                          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)) {                  if (!SEG_IS_SYSTEM(&gsd)) {
                         VERBOSE(("interrupt: gate descriptor is not system segment."));                          VERBOSE(("interrupt: gate descriptor is not system segment."));
                         EXCEPTION(GP_EXCEPTION, exc_errcode);                          EXCEPTION(GP_EXCEPTION, exc_errcode);
Line 300  interrupt(int num, int intrtype, int err Line 296  interrupt(int num, int intrtype, int err
                         break;                          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. 例外/割り込みハンドラ・プロシージャの保護 */                  /* 5.10.1.1. 例外/割り込みハンドラ・プロシージャの保護 */
                 if ((intrtype != INTR_TYPE_EXTINTR) && (gsd.dpl < CPU_STAT_CPL)) {                  if ((intrtype != INTR_TYPE_EXTINTR) && (gsd.dpl < CPU_STAT_CPL)) {
                         VERBOSE(("interrupt: intrtype && DPL(%d) < CPL(%d)", gsd.dpl, CPU_STAT_CPL));                          VERBOSE(("interrupt: intrtype(%d) && DPL(%d) < CPL(%d)", intrtype, gsd.dpl, CPU_STAT_CPL));
                         EXCEPTION(GP_EXCEPTION, exc_errcode);                          EXCEPTION(GP_EXCEPTION, exc_errcode);
                 }                  }
   
                 if (!intrtype && CPU_STAT_HLT) {                  if (!SEG_IS_PRESENT(&gsd)) {
                           VERBOSE(("interrupt: gate descriptor is not present."));
                           EXCEPTION(NP_EXCEPTION, exc_errcode);
                   }
   
                   if ((intrtype == INTR_TYPE_EXTINTR) && CPU_STAT_HLT) {
                         CPU_EIP++;                          CPU_EIP++;
                         CPU_STAT_HLT = 0;                          CPU_STAT_HLT = 0;
                 }                  }
Line 345  interrupt_task_gate(const descriptor_t * Line 341  interrupt_task_gate(const descriptor_t *
   
         VERBOSE(("interrupt: TASK-GATE"));          VERBOSE(("interrupt: TASK-GATE"));
   
         (void)intrtype;  
   
         rv = parse_selector(&task_sel, gsdp->u.gate.selector);          rv = parse_selector(&task_sel, gsdp->u.gate.selector);
         if (rv < 0 || task_sel.ldt || !SEG_IS_SYSTEM(&task_sel.desc)) {          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"));                  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"));

Removed from v.1.22  
changed lines
  Added in v.1.25


RetroPC.NET-CVS <cvs@retropc.net>