From: Pierre Schweitzer Date: Tue, 6 Feb 2018 12:38:55 +0000 (+0100) Subject: [NTOSKRNL] Define the Mm global variables related to Cc on Mm init. X-Git-Tag: 0.4.9-dev~82 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=d56a24908908b574852091af0b8bd9dca7bc1165 [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 --- diff --git a/ntoskrnl/include/internal/i386/mm.h b/ntoskrnl/include/internal/i386/mm.h index 7d5c5ed667a..a77b92b9e34 100644 --- a/ntoskrnl/include/internal/i386/mm.h +++ b/ntoskrnl/include/internal/i386/mm.h @@ -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 diff --git a/ntoskrnl/mm/ARM3/mminit.c b/ntoskrnl/mm/ARM3/mminit.c index 76d4a4bee8c..eb625fcecb5 100644 --- a/ntoskrnl/mm/ARM3/mminit.c +++ b/ntoskrnl/mm/ARM3/mminit.c @@ -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); diff --git a/ntoskrnl/mm/mminit.c b/ntoskrnl/mm/mminit.c index 7f756cb7786..e0166ee8fb3 100644 --- a/ntoskrnl/mm/mminit.c +++ b/ntoskrnl/mm/mminit.c @@ -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,