mirror of
https://github.com/reactos/reactos.git
synced 2025-07-05 08:51:22 +00:00
[FAST486]
We can't load the stack segment until after we've updated the CPL. svn path=/trunk/; revision=65281
This commit is contained in:
parent
e42640b500
commit
d7897ca1e5
1 changed files with 17 additions and 17 deletions
|
@ -4496,7 +4496,13 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeRetFar)
|
||||||
/* Exception */
|
/* Exception */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Update the CPL */
|
||||||
|
State->Cpl = GET_SEGMENT_RPL(Segment);
|
||||||
|
|
||||||
|
if (State->Cpl > OldCpl)
|
||||||
|
{
|
||||||
/* Load new SS */
|
/* Load new SS */
|
||||||
if (!Fast486LoadSegment(State, FAST486_REG_SS, StackSel))
|
if (!Fast486LoadSegment(State, FAST486_REG_SS, StackSel))
|
||||||
{
|
{
|
||||||
|
@ -4507,13 +4513,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeRetFar)
|
||||||
/* Set ESP */
|
/* Set ESP */
|
||||||
if (Size) State->GeneralRegs[FAST486_REG_ESP].Long = StackPtr;
|
if (Size) State->GeneralRegs[FAST486_REG_ESP].Long = StackPtr;
|
||||||
else State->GeneralRegs[FAST486_REG_ESP].LowWord = LOWORD(StackPtr);
|
else State->GeneralRegs[FAST486_REG_ESP].LowWord = LOWORD(StackPtr);
|
||||||
}
|
|
||||||
|
|
||||||
/* Update the CPL */
|
|
||||||
State->Cpl = GET_SEGMENT_RPL(Segment);
|
|
||||||
|
|
||||||
if (State->Cpl > OldCpl)
|
|
||||||
{
|
|
||||||
/* Check segment security */
|
/* Check segment security */
|
||||||
for (i = 0; i < FAST486_NUM_SEG_REGS; i++)
|
for (i = 0; i < FAST486_NUM_SEG_REGS; i++)
|
||||||
{
|
{
|
||||||
|
@ -4732,17 +4732,6 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeIret)
|
||||||
/* Exception */
|
/* Exception */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load new SS */
|
|
||||||
if (!Fast486LoadSegment(State, FAST486_REG_SS, StackSel))
|
|
||||||
{
|
|
||||||
/* Exception */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set ESP */
|
|
||||||
if (Size) State->GeneralRegs[FAST486_REG_ESP].Long = StackPtr;
|
|
||||||
else State->GeneralRegs[FAST486_REG_ESP].LowWord = LOWORD(StackPtr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the CPL */
|
/* Update the CPL */
|
||||||
|
@ -4759,6 +4748,17 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeIret)
|
||||||
|
|
||||||
if (State->Cpl > OldCpl)
|
if (State->Cpl > OldCpl)
|
||||||
{
|
{
|
||||||
|
/* Load new SS */
|
||||||
|
if (!Fast486LoadSegment(State, FAST486_REG_SS, StackSel))
|
||||||
|
{
|
||||||
|
/* Exception */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set ESP */
|
||||||
|
if (Size) State->GeneralRegs[FAST486_REG_ESP].Long = StackPtr;
|
||||||
|
else State->GeneralRegs[FAST486_REG_ESP].LowWord = LOWORD(StackPtr);
|
||||||
|
|
||||||
/* Check segment security */
|
/* Check segment security */
|
||||||
for (i = 0; i < FAST486_NUM_SEG_REGS; i++)
|
for (i = 0; i < FAST486_NUM_SEG_REGS; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue