[NTOS:MM] Fix MmSizeOfSystemCacheInPages value on AMD64

And add 'ASSERT(MmSystemCacheEnd == ...);'.

Addendum to d56a249089.
CORE-14259
This commit is contained in:
Serge Gautherie 2019-06-21 14:04:01 +02:00 committed by Pierre Schweitzer
parent 4253ba71fc
commit 6ba611f39e

View file

@ -2521,11 +2521,16 @@ MmArmInitSystem(IN ULONG Phase,
/* Define limits for system cache */
#ifdef _M_AMD64
MmSizeOfSystemCacheInPages = (MI_SYSTEM_CACHE_END - MI_SYSTEM_CACHE_START) / PAGE_SIZE;
MmSizeOfSystemCacheInPages = ((MI_SYSTEM_CACHE_END + 1) - MI_SYSTEM_CACHE_START) / PAGE_SIZE;
#else
MmSizeOfSystemCacheInPages = ((ULONG_PTR)MI_PAGED_POOL_START - (ULONG_PTR)MI_SYSTEM_CACHE_START) / PAGE_SIZE;
#endif
MmSystemCacheEnd = (PVOID)((ULONG_PTR)MmSystemCacheStart + (MmSizeOfSystemCacheInPages * PAGE_SIZE) - 1);
#ifdef _M_AMD64
ASSERT(MmSystemCacheEnd == (PVOID)MI_SYSTEM_CACHE_END);
#else
ASSERT(MmSystemCacheEnd == (PVOID)((ULONG_PTR)MI_PAGED_POOL_START - 1));
#endif
/* Initialize the system cache */
//MiInitializeSystemCache(MmSystemCacheWsMinimum, MmAvailablePages);