diff --git a/reactos/ntoskrnl/mm/ARM3/pagfault.c b/reactos/ntoskrnl/mm/ARM3/pagfault.c index ceff13bcc8d..362a7d57ed0 100644 --- a/reactos/ntoskrnl/mm/ARM3/pagfault.c +++ b/reactos/ntoskrnl/mm/ARM3/pagfault.c @@ -105,11 +105,12 @@ MiResolveDemandZeroFault(IN PVOID Address, OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); ASSERT(PointerPte->u.Hard.Valid == 0); - // - // Get a page - // - PageFrameNumber = MmAllocPage(MC_PPOOL); - DPRINT("New pool page: %lx\n", PageFrameNumber); + /* Get a page */ + PageFrameNumber = MiRemoveAnyPage(0); + DPRINT1("New pool page: %lx\n", PageFrameNumber); + + /* Initialize it */ + MiInitializePfn(PageFrameNumber, PointerPte, TRUE); // // Release PFN lock @@ -124,11 +125,8 @@ MiResolveDemandZeroFault(IN PVOID Address, /* Shouldn't see faults for user PTEs yet */ ASSERT(PointerPte > MiHighestUserPte); - // - // Build the PTE - // - TempPte = ValidKernelPte; - TempPte.u.Hard.PageFrameNumber = PageFrameNumber; + /* Build the PTE */ + MI_MAKE_HARDWARE_PTE(&TempPte, PointerPte, PointerPte->u.Soft.Protection, PageFrameNumber); ASSERT(TempPte.u.Hard.Valid == 1); ASSERT(PointerPte->u.Hard.Valid == 0); *PointerPte = TempPte; @@ -137,7 +135,7 @@ MiResolveDemandZeroFault(IN PVOID Address, // // It's all good now // - DPRINT("Paged pool page has now been paged in\n"); + DPRINT1("Paged pool page has now been paged in\n"); return STATUS_PAGE_FAULT_DEMAND_ZERO; } diff --git a/reactos/ntoskrnl/mm/ARM3/pool.c b/reactos/ntoskrnl/mm/ARM3/pool.c index 915e407a6cf..28cbe2e4db8 100644 --- a/reactos/ntoskrnl/mm/ARM3/pool.c +++ b/reactos/ntoskrnl/mm/ARM3/pool.c @@ -417,11 +417,9 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType, // KeFlushEntireTb(TRUE, TRUE); - // - // Setup a demand-zero writable PTE - // - TempPte.u.Long = 0; - MI_MAKE_WRITE_PAGE(&TempPte); + /* Setup a demand-zero writable PTE */ + DPRINT1("Setting up demand zero\n"); + MI_MAKE_SOFTWARE_PTE(&TempPte, MM_READWRITE); // // Find the first and last PTE, then loop them all