Merge r44143 from amd64 branch
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 16 Jul 2010 13:23:43 +0000 (13:23 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 16 Jul 2010 13:23:43 +0000 (13:23 +0000)
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
reactos/ntoskrnl/mm/ARM3/mmdbg.c
reactos/ntoskrnl/mm/ARM3/mminit.c
reactos/ntoskrnl/mm/mminit.c

index a1fb21b..f74a150 100644 (file)
@@ -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;
index 41260f2..5d76179 100644 (file)
@@ -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
index 3121162..5b90e2e 100644 (file)
@@ -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);
index 83c45f1..993c8fa 100644 (file)
@@ -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);