mirror of
https://github.com/reactos/reactos.git
synced 2025-01-13 01:22:03 +00:00
[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. svn path=/trunk/; revision=47575
This commit is contained in:
parent
f150c299f2
commit
63ce635b0f
2 changed files with 12 additions and 16 deletions
|
@ -105,11 +105,12 @@ MiResolveDemandZeroFault(IN PVOID Address,
|
||||||
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
||||||
ASSERT(PointerPte->u.Hard.Valid == 0);
|
ASSERT(PointerPte->u.Hard.Valid == 0);
|
||||||
|
|
||||||
//
|
/* Get a page */
|
||||||
// Get a page
|
PageFrameNumber = MiRemoveAnyPage(0);
|
||||||
//
|
DPRINT1("New pool page: %lx\n", PageFrameNumber);
|
||||||
PageFrameNumber = MmAllocPage(MC_PPOOL);
|
|
||||||
DPRINT("New pool page: %lx\n", PageFrameNumber);
|
/* Initialize it */
|
||||||
|
MiInitializePfn(PageFrameNumber, PointerPte, TRUE);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Release PFN lock
|
// Release PFN lock
|
||||||
|
@ -124,11 +125,8 @@ MiResolveDemandZeroFault(IN PVOID Address,
|
||||||
/* Shouldn't see faults for user PTEs yet */
|
/* Shouldn't see faults for user PTEs yet */
|
||||||
ASSERT(PointerPte > MiHighestUserPte);
|
ASSERT(PointerPte > MiHighestUserPte);
|
||||||
|
|
||||||
//
|
/* Build the PTE */
|
||||||
// Build the PTE
|
MI_MAKE_HARDWARE_PTE(&TempPte, PointerPte, PointerPte->u.Soft.Protection, PageFrameNumber);
|
||||||
//
|
|
||||||
TempPte = ValidKernelPte;
|
|
||||||
TempPte.u.Hard.PageFrameNumber = PageFrameNumber;
|
|
||||||
ASSERT(TempPte.u.Hard.Valid == 1);
|
ASSERT(TempPte.u.Hard.Valid == 1);
|
||||||
ASSERT(PointerPte->u.Hard.Valid == 0);
|
ASSERT(PointerPte->u.Hard.Valid == 0);
|
||||||
*PointerPte = TempPte;
|
*PointerPte = TempPte;
|
||||||
|
@ -137,7 +135,7 @@ MiResolveDemandZeroFault(IN PVOID Address,
|
||||||
//
|
//
|
||||||
// It's all good now
|
// 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;
|
return STATUS_PAGE_FAULT_DEMAND_ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -417,11 +417,9 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
//
|
//
|
||||||
KeFlushEntireTb(TRUE, TRUE);
|
KeFlushEntireTb(TRUE, TRUE);
|
||||||
|
|
||||||
//
|
/* Setup a demand-zero writable PTE */
|
||||||
// Setup a demand-zero writable PTE
|
DPRINT1("Setting up demand zero\n");
|
||||||
//
|
MI_MAKE_SOFTWARE_PTE(&TempPte, MM_READWRITE);
|
||||||
TempPte.u.Long = 0;
|
|
||||||
MI_MAKE_WRITE_PAGE(&TempPte);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Find the first and last PTE, then loop them all
|
// Find the first and last PTE, then loop them all
|
||||||
|
|
Loading…
Reference in a new issue