Fix a BOP-related stack corruption.
CORE-8199 #resolve #comment Fixed in revision r63286.
svn path=/trunk/; revision=63286
{
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
/* 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)
/* 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;
}