mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 07:28:19 +00:00
[FAST486]
The LMSW instruction doesn't #GP when the program tries to return to real mode. Rather, it just doesn't happen (the PE bit remains 1). svn path=/trunk/; revision=67647
This commit is contained in:
parent
45b03b53d3
commit
ee08940855
1 changed files with 9 additions and 14 deletions
|
@ -2239,11 +2239,14 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeGroup0F01)
|
||||||
{
|
{
|
||||||
USHORT MachineStatusWord;
|
USHORT MachineStatusWord;
|
||||||
|
|
||||||
/* This is a privileged instruction */
|
if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
|
||||||
if (Fast486GetCurrentPrivLevel(State) != 0)
|
|
||||||
{
|
{
|
||||||
Fast486Exception(State, FAST486_EXCEPTION_GP);
|
/* This is a privileged instruction */
|
||||||
return;
|
if (Fast486GetCurrentPrivLevel(State) != 0)
|
||||||
|
{
|
||||||
|
Fast486Exception(State, FAST486_EXCEPTION_GP);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the new Machine Status Word */
|
/* Read the new Machine Status Word */
|
||||||
|
@ -2253,16 +2256,8 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeGroup0F01)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This instruction cannot be used to return to real mode */
|
/* Set the lowest 4 bits, but never clear bit 0 */
|
||||||
if ((State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
|
State->ControlRegisters[FAST486_REG_CR0] &= 0xFFFFFFF1;
|
||||||
&& !(MachineStatusWord & FAST486_CR0_PE))
|
|
||||||
{
|
|
||||||
Fast486Exception(State, FAST486_EXCEPTION_GP);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the lowest 4 bits */
|
|
||||||
State->ControlRegisters[FAST486_REG_CR0] &= 0xFFFFFFF0;
|
|
||||||
State->ControlRegisters[FAST486_REG_CR0] |= MachineStatusWord & 0x0F;
|
State->ControlRegisters[FAST486_REG_CR0] |= MachineStatusWord & 0x0F;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue