https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d56a24908908b574852091...
commit d56a24908908b574852091af0b8bd9dca7bc1165 Author: Pierre Schweitzer pierre@reactos.org AuthorDate: Tue Feb 6 13:38:55 2018 +0100 Commit: Pierre Schweitzer pierre@reactos.org CommitDate: Tue Feb 6 13:41:23 2018 +0100
[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 --- ntoskrnl/include/internal/i386/mm.h | 1 + ntoskrnl/mm/ARM3/mminit.c | 11 ++++++++++- ntoskrnl/mm/mminit.c | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/include/internal/i386/mm.h b/ntoskrnl/include/internal/i386/mm.h index 7d5c5ed667..a77b92b9e3 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 76d4a4bee8..eb625fcecb 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 7f756cb778..e0166ee8fb 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,