Author: aandrejevic Date: Wed Nov 5 20:21:32 2014 New Revision: 65272
URL: http://svn.reactos.org/svn/reactos?rev=65272&view=rev Log: [FAST486] Make sure the corrected prefetch address contains the block we're trying to read.
Modified: trunk/reactos/lib/fast486/common.c
Modified: trunk/reactos/lib/fast486/common.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.c?rev=65... ============================================================================== --- trunk/reactos/lib/fast486/common.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/common.c [iso-8859-1] Wed Nov 5 20:21:32 2014 @@ -106,6 +106,13 @@ /* We mustn't prefetch across a page boundary */ State->PrefetchAddress = PAGE_ALIGN(State->PrefetchAddress) | (FAST486_PAGE_SIZE - FAST486_CACHE_SIZE); + + if ((LinearAddress - State->PrefetchAddress + Size) >= FAST486_CACHE_SIZE) + { + /* We can't prefetch without possibly violating page permissions */ + State->PrefetchValid = FALSE; + return Fast486ReadLinearMemory(State, LinearAddress, Buffer, Size); + } }
/* Prefetch */