1
0
Fork 0

Add pmode exceptions for cli/sti/popf

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1600
This commit is contained in:
Sjoerd van der Berg 2004-01-25 12:53:29 +00:00
parent 143bad813b
commit 8b68de7de2
2 changed files with 25 additions and 5 deletions

View file

@ -355,6 +355,11 @@
Push_32(reg_flags);
break;
CASE_D(0x9d) /* POPFD */
if ((reg_flags & FLAG_VM) && ((reg_flags & FLAG_IOPL)!=FLAG_IOPL)) {
LEAVECORE;reg_eip-=core.ip_lookup-core.op_start;
CPU_Exception(13,0);
goto decode_start;
}
SETFLAGSd(Pop_32())
#if CPU_TRAP_CHECK
if (GETFLAG(TF)) {
@ -362,7 +367,7 @@
goto decode_end;
}
#endif
#ifdef CPU_PIC_CHECK
#if CPU_PIC_CHECK
if (GETFLAG(IF) && PIC_IRQCheck) goto decode_end;
#endif
@ -499,7 +504,7 @@
return CBRET_NONE;
}
#endif
#ifdef CPU_PIC_CHECK
#if CPU_PIC_CHECK
if (GETFLAG(IF) && PIC_IRQCheck) return CBRET_NONE;
#endif
//TODO TF check

View file

@ -557,6 +557,11 @@
Push_16(reg_flags);
break;
CASE_W(0x9d) /* POPF */
if ((reg_flags & FLAG_VM) && ((reg_flags & FLAG_IOPL)!=FLAG_IOPL)) {
LEAVECORE;reg_eip-=core.ip_lookup-core.op_start;
CPU_Exception(13,0);
goto decode_start;
}
SETFLAGSw(Pop_16());
#if CPU_TRAP_CHECK
if (GETFLAG(TF)) {
@ -564,7 +569,7 @@
goto decode_end;
}
#endif
#ifdef CPU_PIC_CHECK
#if CPU_PIC_CHECK
if (GETFLAG(IF) && PIC_IRQCheck) goto decode_end;
#endif
break;
@ -787,7 +792,7 @@
{
LEAVECORE;
CPU_IRET(false);
#ifdef CPU_PIC_CHECK
#if CPU_PIC_CHECK
if (GETFLAG(IF) && PIC_IRQCheck) return CBRET_NONE;
#endif
#if CPU_TRAP_CHECK
@ -1053,11 +1058,21 @@
SETFLAGBIT(CF,true);
break;
CASE_B(0xfa) /* CLI */
if (cpu.pmode && (GETFLAG_IOPL<cpu.cpl)) {
LEAVECORE;reg_eip-=core.ip_lookup-core.op_start;
CPU_Exception(13,0);
goto decode_start;
}
SETFLAGBIT(IF,false);
break;
CASE_B(0xfb) /* STI */
if (cpu.pmode && !GETFLAG(VM) && (GETFLAG_IOPL<cpu.cpl)) {
LEAVECORE;reg_eip-=core.ip_lookup-core.op_start;
CPU_Exception(13,0);
goto decode_start;
}
SETFLAGBIT(IF,true);
#ifdef CPU_PIC_CHECK
#if CPU_PIC_CHECK
if (GETFLAG(IF) && PIC_IRQCheck) goto decode_end;
#endif
break;