[FAST486]

Fix a BOP-related stack corruption.
CORE-8199 #resolve #comment Fixed in revision r63286.


svn path=/trunk/; revision=63286
This commit is contained in:
Aleksandar Andrejevic 2014-05-13 23:22:49 +00:00
parent 32604108f4
commit b748bf5dc8
3 changed files with 18 additions and 1 deletions

View file

@ -159,7 +159,8 @@ typedef enum _FAST486_INT_STATUS
{
FAST486_INT_NONE = 0,
FAST486_INT_EXECUTE = 1,
FAST486_INT_SIGNAL = 2
FAST486_INT_SIGNAL = 2,
FAST486_INT_DELAYED = 3
} FAST486_INT_STATUS, *PFAST486_INT_STATUS;
typedef

View file

@ -121,6 +121,11 @@ Fast486ExecutionControl(PFAST486_STATE State, FAST486_EXEC_CMD Command)
/* Set the interrupt status to execute on the next instruction */
State->IntStatus = FAST486_INT_EXECUTE;
}
else if (State->IntStatus == FAST486_INT_DELAYED)
{
/* Restore the old state */
State->IntStatus = FAST486_INT_EXECUTE;
}
}
while ((Command == FAST486_CONTINUE)
|| (Command == FAST486_STEP_OVER && ProcedureCallCount > 0)

View file

@ -4397,6 +4397,17 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeLdsLes)
/* Call the BOP handler */
State->BopCallback(State, BopCode);
/*
* If an interrupt should occur at this time, delay it.
* We must do this because if an interrupt begins and the BOP callback
* changes the CS:IP, the interrupt handler won't execute and the
* stack pointer will never be restored.
*/
if (State->IntStatus == FAST486_INT_EXECUTE)
{
State->IntStatus = FAST486_INT_DELAYED;
}
/* Return success */
return TRUE;
}