https://git.reactos.org/?p=reactos.git;a=commitdiff;h=18cd763160d92df9e70a7…
commit 18cd763160d92df9e70a7ed21a487e4839678372
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Tue Dec 19 15:16:54 2017 +0100
[NTOS:MM] Make debug code in MmArmInitSystem portable
---
ntoskrnl/include/internal/arm/mm.h | 1 +
ntoskrnl/include/internal/i386/mm.h | 1 +
ntoskrnl/mm/ARM3/mminit.c | 6 ++----
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ntoskrnl/include/internal/arm/mm.h b/ntoskrnl/include/internal/arm/mm.h
index ade2bff25e..71468cce56 100644
--- a/ntoskrnl/include/internal/arm/mm.h
+++ b/ntoskrnl/include/internal/arm/mm.h
@@ -14,6 +14,7 @@
#define MI_PAGED_POOL_START (PVOID)0xE1000000
#define MI_NONPAGED_POOL_END (PVOID)0xFFBE0000
#define MI_DEBUG_MAPPING (PVOID)0xFFBFF000
+#define MI_HIGHEST_SYSTEM_ADDRESS (PVOID)0xFFFFFFFF
#define PTE_PER_PAGE 256
#define PDE_PER_PAGE 4096
diff --git a/ntoskrnl/include/internal/i386/mm.h b/ntoskrnl/include/internal/i386/mm.h
index aae223cf15..19ce1c82a6 100644
--- a/ntoskrnl/include/internal/i386/mm.h
+++ b/ntoskrnl/include/internal/i386/mm.h
@@ -23,6 +23,7 @@
#define MI_PAGED_POOL_START (PVOID)0xE1000000
#define MI_NONPAGED_POOL_END (PVOID)0xFFBE0000
#define MI_DEBUG_MAPPING (PVOID)0xFFBFF000
+#define MI_HIGHEST_SYSTEM_ADDRESS (PVOID)0xFFFFFFFF
/* FIXME: These are different for PAE */
#define PTE_BASE 0xC0000000
diff --git a/ntoskrnl/mm/ARM3/mminit.c b/ntoskrnl/mm/ARM3/mminit.c
index 0ed42eb14a..44f50b085b 100644
--- a/ntoskrnl/mm/ARM3/mminit.c
+++ b/ntoskrnl/mm/ARM3/mminit.c
@@ -2118,9 +2118,8 @@ MmArmInitSystem(IN ULONG Phase,
TestPte = MiProtoPteToPte(&TempPte);
ASSERT(PointerPte == TestPte);
-#ifndef _M_AMD64 // Not working on x64 for obvoius reason
/* Try a bunch of random addresses near the end of the address space */
- PointerPte = (PMMPTE)0xFFFC8000;
+ PointerPte = (PMMPTE)((ULONG_PTR)MI_HIGHEST_SYSTEM_ADDRESS - 0x37FFF);
for (j = 0; j < 20; j += 1)
{
MI_MAKE_PROTOTYPE_PTE(&TempPte, PointerPte);
@@ -2130,11 +2129,10 @@ MmArmInitSystem(IN ULONG Phase,
}
/* Subsection PTEs are always in nonpaged pool, pick a random address to try */
- PointerPte = (PMMPTE)0xFFAACBB8;
+ PointerPte = (PMMPTE)((ULONG_PTR)MmNonPagedPoolStart +
(MmSizeOfNonPagedPoolInBytes / 2));
MI_MAKE_SUBSECTION_PTE(&TempPte, PointerPte);
TestPte = MiSubsectionPteToSubsection(&TempPte);
ASSERT(PointerPte == TestPte);
-#endif
#endif
/* Loop all 8 standby lists */