Skip to content

Commit ee353ad

Browse files
author
Sir Richard
committed
[NTOS]: Go ahead and now fill out the OriginalPte field for PFNs initialized with MiInitializePfn(ForOtherProcess). They should only belong to ARM3 so they'll never have SwapEntry/RMAP associated with them. This functionality is important for future Prototype PTE support, among other things, as it lets us get the original PTE value written for a given PFN entry.
svn path=/trunk/; revision=48976
1 parent 251be92 commit ee353ad

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

reactos/ntoskrnl/mm/ARM3/pfnlist.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,16 @@ MiInitializePfn(IN PFN_NUMBER PageFrameIndex,
713713
{
714714
/* Only valid from MmCreateProcessAddressSpace path */
715715
ASSERT(PsGetCurrentProcess()->Vm.WorkingSetSize == 0);
716+
717+
/* Make this a demand zero PTE */
718+
MI_MAKE_SOFTWARE_PTE(&Pfn1->OriginalPte, MM_READWRITE);
719+
}
720+
else
721+
{
722+
/* Copy the PTE data */
723+
Pfn1->OriginalPte = *PointerPte;
724+
ASSERT(!((Pfn1->OriginalPte.u.Soft.Prototype == 0) &&
725+
(Pfn1->OriginalPte.u.Soft.Transition == 1)));
716726
}
717727

718728
/* Otherwise this is a fresh page -- set it up */
@@ -870,11 +880,9 @@ MiInitializePfnForOtherProcess(IN PFN_NUMBER PageFrameIndex,
870880
/* Setup the PTE */
871881
Pfn1 = MiGetPfnEntry(PageFrameIndex);
872882
Pfn1->PteAddress = PointerPte;
873-
874-
#if 0 // When using ARM3 PFN
883+
875884
/* Make this a software PTE */
876885
MI_MAKE_SOFTWARE_PTE(&Pfn1->OriginalPte, MM_READWRITE);
877-
#endif
878886

879887
/* Setup the page */
880888
ASSERT(Pfn1->u3.e2.ReferenceCount == 0);

0 commit comments

Comments
 (0)