From ee353ad6908d55b430e85b607412f504bd0cf83d Mon Sep 17 00:00:00 2001 From: Sir Richard Date: Mon, 4 Oct 2010 18:22:50 +0000 Subject: [PATCH] [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 --- reactos/ntoskrnl/mm/ARM3/pfnlist.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/reactos/ntoskrnl/mm/ARM3/pfnlist.c b/reactos/ntoskrnl/mm/ARM3/pfnlist.c index 48f5060e59a..ae2813b4d8a 100644 --- a/reactos/ntoskrnl/mm/ARM3/pfnlist.c +++ b/reactos/ntoskrnl/mm/ARM3/pfnlist.c @@ -713,6 +713,16 @@ MiInitializePfn(IN PFN_NUMBER PageFrameIndex, { /* Only valid from MmCreateProcessAddressSpace path */ ASSERT(PsGetCurrentProcess()->Vm.WorkingSetSize == 0); + + /* Make this a demand zero PTE */ + MI_MAKE_SOFTWARE_PTE(&Pfn1->OriginalPte, MM_READWRITE); + } + else + { + /* Copy the PTE data */ + Pfn1->OriginalPte = *PointerPte; + ASSERT(!((Pfn1->OriginalPte.u.Soft.Prototype == 0) && + (Pfn1->OriginalPte.u.Soft.Transition == 1))); } /* Otherwise this is a fresh page -- set it up */ @@ -870,11 +880,9 @@ MiInitializePfnForOtherProcess(IN PFN_NUMBER PageFrameIndex, /* Setup the PTE */ Pfn1 = MiGetPfnEntry(PageFrameIndex); Pfn1->PteAddress = PointerPte; - -#if 0 // When using ARM3 PFN + /* Make this a software PTE */ MI_MAKE_SOFTWARE_PTE(&Pfn1->OriginalPte, MM_READWRITE); -#endif /* Setup the page */ ASSERT(Pfn1->u3.e2.ReferenceCount == 0);