--- np2/i386c/ia32/instructions/flag_ctrl.c 2004/03/12 13:31:20 1.8 +++ np2/i386c/ia32/instructions/flag_ctrl.c 2011/01/15 17:17:23 1.12 @@ -1,5 +1,3 @@ -/* $Id: flag_ctrl.c,v 1.8 2004/03/12 13:31:20 monaka Exp $ */ - /* * Copyright (c) 2003 NONAKA Kimihiro * All rights reserved. @@ -12,8 +10,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 @@ -132,34 +128,6 @@ POPF_Fw(void) UINT16 flags, mask; CPU_WORKCLOCK(3); -#if defined(IA32_DONT_USE_SET_EFLAGS_FUNCTION) - mask = ALL_FLAG; - if (!CPU_STAT_PM) { - /* Real Mode */ - POP0_16(flags); - } else if (!CPU_STAT_VM86) { - /* Protected Mode */ - POP0_16(flags); - if (CPU_STAT_CPL > 0) { - mask &= ~IOPL_FLAG; - if (CPU_STAT_CPL > CPU_STAT_IOPL) { - mask &= ~I_FLAG; - } - } - } else { - /* Virtual-8086 Mode */ - if (CPU_STAT_IOPL == CPU_IOPL3) { - POP0_16(flags); - mask &= ~IOPL_FLAG; - } else { - /* IOPL < 3 */ - EXCEPTION(GP_EXCEPTION, 0); - } - } - CPU_FLAG = (flags & mask) | (CPU_FLAG & ~mask); - CPU_OV = CPU_FLAG & O_FLAG; - CPU_TRAP = (CPU_FLAG & (I_FLAG|T_FLAG)) == (I_FLAG|T_FLAG); -#else if (!CPU_STAT_PM) { /* Real Mode */ POP0_16(flags); @@ -185,7 +153,6 @@ POPF_Fw(void) /* compiler happy */ } set_eflags(flags, mask); -#endif /* IA32_DONT_USE_SET_EFLAGS_FUNCTION */ IRQCHECKTERM(); } @@ -195,36 +162,6 @@ POPFD_Fd(void) UINT32 flags, mask; CPU_WORKCLOCK(3); -#if defined(IA32_DONT_USE_SET_EFLAGS_FUNCTION) - mask = (ALL_EFLAG & ~VM_FLAG); - if (!CPU_STAT_PM) { - /* Real Mode */ - POP0_32(flags); - flags &= ~(VIF_FLAG|VIP_FLAG); - } else if (!CPU_STAT_VM86) { - /* Protected Mode */ - POP0_32(flags); - flags &= ~(VIF_FLAG|VIP_FLAG); - if (CPU_STAT_CPL > 0) { - mask &= ~IOPL_FLAG; - if (CPU_STAT_CPL > CPU_STAT_IOPL) { - mask &= ~I_FLAG; - } - } - } else { - /* Virtual-8086 Mode */ - if (CPU_STAT_IOPL == CPU_IOPL3) { - POP0_32(flags); - mask &= ~(IOPL_FLAG|RF_FLAG|VIF_FLAG|VIP_FLAG); - } else { - /* IOPL < 3 */ - EXCEPTION(GP_EXCEPTION, 0); - } - } - CPU_EFLAG = (flags & mask) | (CPU_EFLAG & ~mask); - CPU_OV = CPU_FLAG & O_FLAG; - CPU_TRAP = (CPU_FLAG & (I_FLAG|T_FLAG)) == (I_FLAG|T_FLAG); -#else if (!CPU_STAT_PM) { /* Real Mode */ POP0_32(flags); @@ -254,7 +191,6 @@ POPFD_Fd(void) /* compiler happy */ } set_eflags(flags, mask); -#endif /* IA32_DONT_USE_SET_EFLAGS_FUNCTION */ IRQCHECKTERM(); }