[NTOS]: Don't use MmAllocPage for the first paged pool PDE, instead, use MiRemoveZero...
authorSir Richard <sir_richard@svn.reactos.org>
Sun, 6 Jun 2010 14:13:35 +0000 (14:13 +0000)
committerSir Richard <sir_richard@svn.reactos.org>
Sun, 6 Jun 2010 14:13:35 +0000 (14:13 +0000)
[NTOS]: Use MiInitializePfnForOtherProcess to setup the first paged pool PDE.

svn path=/trunk/; revision=47622

reactos/ntoskrnl/mm/ARM3/miarm.h
reactos/ntoskrnl/mm/ARM3/mminit.c

index b5adad3..759bdab 100644 (file)
@@ -743,6 +743,12 @@ MiRemoveAnyPage(
     IN ULONG Color
 );
 
+PFN_NUMBER
+NTAPI
+MiRemoveZeroPage(
+    IN ULONG Color
+);
+
 VOID
 NTAPI
 MiInsertPageInFreeList(
index eba66b1..f47b3bb 100644 (file)
@@ -1586,15 +1586,18 @@ MiBuildPagedPool(VOID)
     //
     OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
 
-    //
-    // Allocate a page and map the first paged pool PDE
-    //
-    PageFrameIndex = MmAllocPage(MC_NPPOOL);
+    /* Allocate a page and map the first paged pool PDE */
+    PageFrameIndex = MiRemoveZeroPage(0);
     TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
     ASSERT(PointerPde->u.Hard.Valid == 0);
     ASSERT(TempPte.u.Hard.Valid == 1);
     *PointerPde = TempPte;
 
+    /* Initialize the PFN entry for it */
+    MiInitializePfnForOtherProcess(PageFrameIndex,
+                                   PointerPde,
+                                   MmSystemPageDirectory[(PointerPde - (PMMPTE)PDE_BASE) / PDE_COUNT]);
+
     //
     // Release the PFN database lock
     //