--- np2/i386c/ia32/instructions/ctrl_trans.c 2005/03/03 06:59:41 1.19 +++ np2/i386c/ia32/instructions/ctrl_trans.c 2008/01/25 17:55:55 1.22 @@ -1,4 +1,4 @@ -/* $Id: ctrl_trans.c,v 1.19 2005/03/03 06:59:41 yui Exp $ */ +/* $Id: ctrl_trans.c,v 1.22 2008/01/25 17:55:55 monaka Exp $ */ /* * Copyright (c) 2002-2003 NONAKA Kimihiro @@ -12,8 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -1152,28 +1150,11 @@ IRET(void) UINT32 new_ip; UINT32 new_flags; UINT32 new_cs; -#if !defined(IA32_DONT_USE_SET_EFLAGS_FUNCTION) UINT32 mask; -#endif if (!CPU_STAT_PM) { /* Real mode */ CPU_WORKCLOCK(22); -#if defined(IA32_DONT_USE_SET_EFLAGS_FUNCTION) - if (!CPU_INST_OP32) { - POP0_16(new_ip); - POP0_16(new_cs); - POP0_16(new_flags); - CPU_FLAG = new_flags & ALL_FLAG; - } else { - POP0_32(new_ip); - POP0_32(new_cs); - POP0_32(new_flags); - CPU_EFLAG = (new_flags & (ALL_FLAG|RF_FLAG|AC_FLAG|ID_FLAG)) | (CPU_EFLAG & (VM_FLAG|VIF_FLAG|VIP_FLAG)); - } - CPU_OV = CPU_FLAG & O_FLAG; - CPU_TRAP = (CPU_FLAG & (I_FLAG|T_FLAG)) == (I_FLAG|T_FLAG); -#else mask = I_FLAG|IOPL_FLAG; if (!CPU_INST_OP32) { POP0_16(new_ip); @@ -1187,7 +1168,6 @@ IRET(void) } set_eflags(new_flags, mask); -#endif CPU_SET_SEGREG(CPU_CS_INDEX, (UINT16)new_cs); SET_EIP(new_ip); @@ -1314,7 +1294,7 @@ ENTER16_IwIb(void) level &= 0x1f; /* check stack room size */ - if (CPU_STAT_PM) { + if (CPU_STAT_PM && !CPU_STAT_VM86) { size = dimsize + (level + 1) * 2; if (!CPU_STAT_SS32) { sp = CPU_SP; @@ -1388,7 +1368,7 @@ ENTER32_IwIb(void) level &= 0x1f; /* check stack room size */ - if (CPU_STAT_PM) { + if (CPU_STAT_PM && !CPU_STAT_VM86) { size = dimsize + (level + 1) * 4; if (CPU_STAT_SS32) { sp = CPU_ESP; @@ -1456,7 +1436,7 @@ LEAVE(void) CPU_WORKCLOCK(4); - if (CPU_STAT_PM) { + if (CPU_STAT_PM && !CPU_STAT_VM86) { if (!CPU_INST_OP32) { s = 2; } else {