Author: aandrejevic Date: Thu Jun 4 14:48:07 2015 New Revision: 68014
URL: http://svn.reactos.org/svn/reactos?rev=68014&view=rev Log: [FAST486] - Interrupts always clear TF. - Let at least one instruction happen between #DB's (when TF is set).
Modified: trunk/reactos/lib/fast486/common.c trunk/reactos/lib/fast486/fast486.c
Modified: trunk/reactos/lib/fast486/common.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.c?rev=68... ============================================================================== --- trunk/reactos/lib/fast486/common.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/common.c [iso-8859-1] Thu Jun 4 14:48:07 2015 @@ -430,8 +430,8 @@ State->InstPtr.LowWord = IdtEntry->Offset; }
- /* Clear TF and NT */ - State->Flags.Tf = State->Flags.Nt = FALSE; + /* Clear NT */ + State->Flags.Nt = FALSE;
if (OldVm) { @@ -512,6 +512,9 @@ /* Disable interrupts after a jump to an interrupt gate handler */ State->Flags.If = FALSE; } + + /* Clear TF */ + State->Flags.Tf = FALSE;
return TRUE; }
Modified: trunk/reactos/lib/fast486/fast486.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fast486.c?rev=6... ============================================================================== --- trunk/reactos/lib/fast486/fast486.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/fast486.c [iso-8859-1] Thu Jun 4 14:48:07 2015 @@ -50,10 +50,13 @@ UCHAR Opcode; FAST486_OPCODE_HANDLER_PROC CurrentHandler; INT ProcedureCallCount = 0; + BOOLEAN Trap;
/* Main execution loop */ do { + Trap = State->Flags.Tf; + if (!State->Halted) { NextInst: @@ -90,19 +93,10 @@ /* Clear the interrupt delay flag */ State->DoNotInterrupt = FALSE; } - else if (State->Flags.Tf && !State->Halted) + else if (Trap && !State->Halted) { /* Perform the interrupt */ - Fast486PerformInterrupt(State, 0x01); - - /* - * Flags and TF are pushed on stack so we can reset TF now, - * to not break into the INT 0x01 handler. - * After the INT 0x01 handler returns, the flags and therefore - * TF are popped back off the stack and restored, so TF will be - * automatically reset to its previous state. - */ - State->Flags.Tf = FALSE; + Fast486PerformInterrupt(State, FAST486_EXCEPTION_DB); } else if (State->Flags.If && State->IntSignaled) {