From e6d512688676e9d1e8dbc87dc063cc5df5f8c2f0 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 16 Jul 2010 13:23:43 +0000 Subject: [PATCH] Merge r44143 from amd64 branch Initialize MmDebugPte from MiDebugMapping variable instead of using MiAddressToPte for a constant initializer. This way the page can be set dynamically. Use MmDebugPte to determine if ready for mapping physical pages. svn path=/trunk/; revision=48079 --- reactos/ntoskrnl/include/internal/mm.h | 3 ++- reactos/ntoskrnl/mm/ARM3/mmdbg.c | 6 +++--- reactos/ntoskrnl/mm/ARM3/mminit.c | 2 +- reactos/ntoskrnl/mm/mminit.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index a1fb21bef3b..f74a150e9d7 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -46,7 +46,8 @@ extern SIZE_T MmPagedPoolCommit; extern SIZE_T MmPeakCommitment; extern SIZE_T MmtotalCommitLimitMaximum; -extern BOOLEAN MiDbgReadyForPhysical; +extern PVOID MiDebugMapping; +extern PMMPTE MmDebugPte; struct _KTRAP_FRAME; struct _EPROCESS; diff --git a/reactos/ntoskrnl/mm/ARM3/mmdbg.c b/reactos/ntoskrnl/mm/ARM3/mmdbg.c index 41260f224c3..5d761791940 100644 --- a/reactos/ntoskrnl/mm/ARM3/mmdbg.c +++ b/reactos/ntoskrnl/mm/ARM3/mmdbg.c @@ -22,8 +22,8 @@ /* GLOBALS ********************************************************************/ -PMMPTE MmDebugPte = MiAddressToPte(MI_DEBUG_MAPPING); -BOOLEAN MiDbgReadyForPhysical = FALSE; +PVOID MiDebugMapping = MI_DEBUG_MAPPING; +PMMPTE MmDebugPte = NULL; /* FUNCTIONS ******************************************************************/ @@ -49,7 +49,7 @@ MiDbgTranslatePhysicalAddress(IN ULONG64 PhysicalAddress, // // Check if we are called too early // - if (MiDbgReadyForPhysical == FALSE) + if (MmDebugPte == NULL) { // // The structures we require aren't initialized yet, fail diff --git a/reactos/ntoskrnl/mm/ARM3/mminit.c b/reactos/ntoskrnl/mm/ARM3/mminit.c index 3121162615c..5b90e2e02a7 100644 --- a/reactos/ntoskrnl/mm/ARM3/mminit.c +++ b/reactos/ntoskrnl/mm/ARM3/mminit.c @@ -1990,7 +1990,7 @@ MmArmInitSystem(IN ULONG Phase, MiBuildPagedPool(); /* Debugger physical memory support is now ready to be used */ - MiDbgReadyForPhysical = TRUE; + MmDebugPte = MiAddressToPte(MiDebugMapping); /* Initialize the loaded module list */ MiInitializeLoadedModuleList(LoaderBlock); diff --git a/reactos/ntoskrnl/mm/mminit.c b/reactos/ntoskrnl/mm/mminit.c index 83c45f145b9..993c8fa4390 100644 --- a/reactos/ntoskrnl/mm/mminit.c +++ b/reactos/ntoskrnl/mm/mminit.c @@ -409,7 +409,7 @@ MmInitSystem(IN ULONG Phase, // // Now get the PTE for shared data, and read the PFN that holds it // - PointerPte = MiAddressToPte(KI_USER_SHARED_DATA); + PointerPte = MiAddressToPte((PVOID)KI_USER_SHARED_DATA); ASSERT(PointerPte->u.Hard.Valid == 1); PageFrameNumber = PFN_FROM_PTE(PointerPte); -- 2.17.1