[NTOSKRNL] Define the Mm global variables related to Cc on Mm init.

This means that MmSystemCacheStart, MmSystemCacheEnd, MmSizeOfSystemCacheInPages
have now a valid value.
System cache is not used atm the moment though. MmMapViewInSystemCache() is to
be implemented, and Cc is to be made aware of this.

CORE-14259
This commit is contained in:
Pierre Schweitzer 2018-02-06 13:38:55 +01:00
parent 64d32eab27
commit d56a249089
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
3 changed files with 14 additions and 1 deletions

View file

@ -20,6 +20,7 @@
#define HYPER_SPACE_END 0xC0BFFFFF
#endif
#define MI_SYSTEM_CACHE_WS_START (PVOID)0xC0C00000
#define MI_SYSTEM_CACHE_START (PVOID)0xC1000000
#define MI_PAGED_POOL_START (PVOID)0xE1000000
#define MI_NONPAGED_POOL_END (PVOID)0xFFBE0000
#define MI_DEBUG_MAPPING (PVOID)0xFFBFF000

View file

@ -240,8 +240,9 @@ PMMPTE MiHighestUserPxe;
#endif
/* These variables define the system cache address space */
PVOID MmSystemCacheStart;
PVOID MmSystemCacheStart = MI_SYSTEM_CACHE_START;
PVOID MmSystemCacheEnd;
ULONG MmSizeOfSystemCacheInPages;
MMSUPPORT MmSystemCacheWs;
//
@ -2494,6 +2495,14 @@ MmArmInitSystem(IN ULONG Phase,
return FALSE;
}
/* Define limits for system cache */
#ifdef _M_AMD64
MmSizeOfSystemCacheInPages = (MI_SYSTEM_CACHE_END - 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);
/* Initialize the system cache */
//MiInitializeSystemCache(MmSystemCacheWsMinimum, MmAvailablePages);

View file

@ -154,6 +154,9 @@ MiDbgDumpAddressSpace(VOID)
DPRINT1(" 0x%p - 0x%p\t%s\n",
HYPER_SPACE, HYPER_SPACE_END,
"Hyperspace");
DPRINT1(" 0x%p - 0x%p\t%s\n",
MmSystemCacheStart, MmSystemCacheEnd,
"System Cache");
DPRINT1(" 0x%p - 0x%p\t%s\n",
MmPagedPoolStart,
(ULONG_PTR)MmPagedPoolStart + MmSizeOfPagedPoolInBytes,