https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6ba611f39e5bb750a24a4…
commit 6ba611f39e5bb750a24a4bbd149ddb788edbcc98
Author: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr>
AuthorDate: Fri Jun 21 14:04:01 2019 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Jul 6 09:55:38 2019 +0200
[NTOS:MM] Fix MmSizeOfSystemCacheInPages value on AMD64
And add 'ASSERT(MmSystemCacheEnd == ...);'.
Addendum to d56a24908908b574852091af0b8bd9dca7bc1165.
CORE-14259
---
ntoskrnl/mm/ARM3/mminit.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/mm/ARM3/mminit.c b/ntoskrnl/mm/ARM3/mminit.c
index bcb8f1652ab..5e4bc303e01 100644
--- a/ntoskrnl/mm/ARM3/mminit.c
+++ b/ntoskrnl/mm/ARM3/mminit.c
@@ -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);