Author: aandrejevic Date: Tue May 12 19:10:52 2015 New Revision: 67698
URL: http://svn.reactos.org/svn/reactos?rev=67698&view=rev Log: [FAST486] - Only flush the TLB when needed. - Flush the TLB after a reset.
Modified: trunk/reactos/lib/fast486/common.c trunk/reactos/lib/fast486/common.inl trunk/reactos/lib/fast486/extraops.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=67... ============================================================================== --- trunk/reactos/lib/fast486/common.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/common.c [iso-8859-1] Tue May 12 19:10:52 2015 @@ -834,7 +834,7 @@ }
/* Flush the TLB */ - if (State->Tlb) RtlFillMemory(State->Tlb, NUM_TLB_ENTRIES * sizeof(ULONG), 0xFF); + Fast486FlushTlb(State);
/* Update the CPL */ if (NewTssLimit >= (sizeof(FAST486_TSS) - 1)) State->Cpl = GET_SEGMENT_RPL(NewTss.Cs);
Modified: trunk/reactos/lib/fast486/common.inl URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.inl?rev=... ============================================================================== --- trunk/reactos/lib/fast486/common.inl [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/common.inl [iso-8859-1] Tue May 12 19:10:52 2015 @@ -138,10 +138,21 @@ { /* Set the TLB entry */ State->Tlb[VirtualAddress >> 12] = TableEntry.Value; + State->TlbEmpty = FALSE; }
/* Return the table entry */ return TableEntry.Value; +} + +FORCEINLINE +VOID +FASTCALL +Fast486FlushTlb(PFAST486_STATE State) +{ + if (!State->Tlb || State->TlbEmpty) return; + RtlFillMemory(State->Tlb, NUM_TLB_ENTRIES * sizeof(ULONG), 0xFF); + State->TlbEmpty = TRUE; }
FORCEINLINE
Modified: trunk/reactos/lib/fast486/extraops.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/extraops.c?rev=... ============================================================================== --- trunk/reactos/lib/fast486/extraops.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/extraops.c [iso-8859-1] Tue May 12 19:10:52 2015 @@ -640,10 +640,10 @@ State->PrefetchValid = FALSE; #endif
- if (State->Tlb && (ModRegRm.Register == (INT)FAST486_REG_CR3)) + if (ModRegRm.Register == (INT)FAST486_REG_CR3) { /* Flush the TLB */ - RtlFillMemory(State->Tlb, NUM_TLB_ENTRIES * sizeof(ULONG), 0xFF); + Fast486FlushTlb(State); }
/* Load a value to the control register */
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] Tue May 12 19:10:52 2015 @@ -284,6 +284,9 @@ State->IntAckCallback = IntAckCallback; State->FpuCallback = FpuCallback; State->Tlb = Tlb; + + /* Flush the TLB */ + Fast486FlushTlb(State); }
VOID