Author: sir_richard
Date: Fri Jun 4 22:18:27 2010
New Revision: 47575
URL:
http://svn.reactos.org/svn/reactos?rev=47575&view=rev
Log:
[NTOS]: Build paged pool demand-zero PTE with MI_MAKE_SOFTWARE_PTE macro.
[NTOS]: Handle paged pool demand-zero fault fulfillment with MI_MAKE_HARDWARE_PTE macro.
[NTOS]: Use MiRemoveAnyPage instead of MmAllocPage, in paged pool demand-zero fault
fulfillment.
These changes affect code paths that are not currently in-use.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
trunk/reactos/ntoskrnl/mm/ARM3/pool.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Fri Jun 4 22:18:27 2010
@@ -105,11 +105,12 @@
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 @@
/* 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 @@
//
// 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;
}
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pool.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] Fri Jun 4 22:18:27 2010
@@ -417,11 +417,9 @@
//
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