CPL is now forced to 0 when switching from real to protected mode.
This commit is contained in:
@@ -125,6 +125,9 @@ static int opMOV_CRx_r_a16(uint32_t fetchdat)
|
|||||||
case 0:
|
case 0:
|
||||||
if ((cpu_state.regs[cpu_rm].l ^ cr0) & 0x80000001)
|
if ((cpu_state.regs[cpu_rm].l ^ cr0) & 0x80000001)
|
||||||
flushmmucache();
|
flushmmucache();
|
||||||
|
/* Make sure CPL = 0 when switching from real mode to protected mode. */
|
||||||
|
if ((cpu_state.regs[cpu_rm].l & 0x01) && !(cr0 & 0x01))
|
||||||
|
cpu_state.seg_cs.access &= 0x9f;
|
||||||
cr0 = cpu_state.regs[cpu_rm].l;
|
cr0 = cpu_state.regs[cpu_rm].l;
|
||||||
if (cpu_16bitbus)
|
if (cpu_16bitbus)
|
||||||
cr0 |= 0x10;
|
cr0 |= 0x10;
|
||||||
@@ -181,6 +184,9 @@ static int opMOV_CRx_r_a32(uint32_t fetchdat)
|
|||||||
case 0:
|
case 0:
|
||||||
if ((cpu_state.regs[cpu_rm].l ^ cr0) & 0x80000001)
|
if ((cpu_state.regs[cpu_rm].l ^ cr0) & 0x80000001)
|
||||||
flushmmucache();
|
flushmmucache();
|
||||||
|
/* Make sure CPL = 0 when switching from real mode to protected mode. */
|
||||||
|
if ((cpu_state.regs[cpu_rm].l & 0x01) && !(cr0 & 0x01))
|
||||||
|
cpu_state.seg_cs.access &= 0x9f;
|
||||||
cr0 = cpu_state.regs[cpu_rm].l;
|
cr0 = cpu_state.regs[cpu_rm].l;
|
||||||
if (cpu_16bitbus)
|
if (cpu_16bitbus)
|
||||||
cr0 |= 0x10;
|
cr0 |= 0x10;
|
||||||
|
Reference in New Issue
Block a user