mirror of
https://github.com/reactos/reactos.git
synced 2024-07-07 13:15:07 +00:00
[FAST486]
- Restore the stack pointer on an exception. - Fix the parameter size for 286 call gates. Caught by V. svn path=/trunk/; revision=68021
This commit is contained in:
parent
c3f90daa0d
commit
8bdaa7f0e1
|
@ -515,6 +515,7 @@ struct _FAST486_STATE
|
||||||
FAST486_REG GeneralRegs[FAST486_NUM_GEN_REGS];
|
FAST486_REG GeneralRegs[FAST486_NUM_GEN_REGS];
|
||||||
FAST486_SEG_REG SegmentRegs[FAST486_NUM_SEG_REGS];
|
FAST486_SEG_REG SegmentRegs[FAST486_NUM_SEG_REGS];
|
||||||
FAST486_REG InstPtr, SavedInstPtr;
|
FAST486_REG InstPtr, SavedInstPtr;
|
||||||
|
FAST486_REG SavedStackPtr;
|
||||||
FAST486_FLAGS_REG Flags;
|
FAST486_FLAGS_REG Flags;
|
||||||
FAST486_TABLE_REG Gdtr, Idtr;
|
FAST486_TABLE_REG Gdtr, Idtr;
|
||||||
FAST486_LDT_REG Ldtr;
|
FAST486_LDT_REG Ldtr;
|
||||||
|
|
|
@ -579,6 +579,9 @@ Fast486ExceptionWithErrorCode(PFAST486_STATE State,
|
||||||
/* Restore the IP to the saved IP */
|
/* Restore the IP to the saved IP */
|
||||||
State->InstPtr = State->SavedInstPtr;
|
State->InstPtr = State->SavedInstPtr;
|
||||||
|
|
||||||
|
/* Restore the SP to the saved SP */
|
||||||
|
State->GeneralRegs[FAST486_REG_ESP] = State->SavedStackPtr;
|
||||||
|
|
||||||
/* Get the interrupt vector */
|
/* Get the interrupt vector */
|
||||||
if (!Fast486GetIntVector(State, ExceptionCode, &IdtEntry))
|
if (!Fast486GetIntVector(State, ExceptionCode, &IdtEntry))
|
||||||
{
|
{
|
||||||
|
@ -1040,7 +1043,7 @@ Fast486CallGate(PFAST486_STATE State,
|
||||||
OldEsp,
|
OldEsp,
|
||||||
FALSE,
|
FALSE,
|
||||||
ParamBuffer,
|
ParamBuffer,
|
||||||
Gate->ParamCount * sizeof(ULONG)))
|
Gate->ParamCount * (GateSize ? sizeof(ULONG) : sizeof(USHORT))))
|
||||||
{
|
{
|
||||||
/* Exception occurred */
|
/* Exception occurred */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -61,7 +61,11 @@ Fast486ExecutionControl(PFAST486_STATE State, FAST486_EXEC_CMD Command)
|
||||||
{
|
{
|
||||||
NextInst:
|
NextInst:
|
||||||
/* Check if this is a new instruction */
|
/* Check if this is a new instruction */
|
||||||
if (State->PrefixFlags == 0) State->SavedInstPtr = State->InstPtr;
|
if (State->PrefixFlags == 0)
|
||||||
|
{
|
||||||
|
State->SavedInstPtr = State->InstPtr;
|
||||||
|
State->SavedStackPtr = State->GeneralRegs[FAST486_REG_ESP];
|
||||||
|
}
|
||||||
|
|
||||||
/* Perform an instruction fetch */
|
/* Perform an instruction fetch */
|
||||||
if (!Fast486FetchByte(State, &Opcode))
|
if (!Fast486FetchByte(State, &Opcode))
|
||||||
|
|
Loading…
Reference in a new issue