From 0f6f0fe19a6278edc6b2acd73628b1c59a3cc995 Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Sun, 15 Mar 2009 01:23:47 +0000 Subject: [PATCH] Trying to use r39938 variant again... svn path=/trunk/; revision=40020 --- reactos/ntoskrnl/mm/hypermap.c | 36 ++++++---------------------------- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/reactos/ntoskrnl/mm/hypermap.c b/reactos/ntoskrnl/mm/hypermap.c index fbdc03e32a7..448e1189631 100644 --- a/reactos/ntoskrnl/mm/hypermap.c +++ b/reactos/ntoskrnl/mm/hypermap.c @@ -139,7 +139,6 @@ MiMapPageToZeroInHyperSpace(IN PFN_NUMBER Page) { MMPTE TempPte; PMMPTE PointerPte; - PFN_NUMBER Offset; PVOID Address; // @@ -154,47 +153,24 @@ MiMapPageToZeroInHyperSpace(IN PFN_NUMBER Page) TempPte.u.Hard.PageFrameNumber = Page; // - // Pick the first zeroing PTE + // Get the Zero PTE and its address // - PointerPte = MmFirstReservedZeroingPte; + PointerPte = MiAddressToPte(MI_ZERO_PTE); + Address = (PVOID)((ULONG_PTR)PointerPte << 10); // - // Now get the first free PTE + // Invalidate the old address // - Offset = PFN_FROM_PTE(PointerPte); - if (!Offset) - { - // - // Reset the PTEs - // - Offset = MI_ZEROING_PTES; - KeFlushProcessTb(); - } - - // - // Prepare the next PTE - // - PointerPte->u.Hard.PageFrameNumber = Offset - 1; + __invlpg(Address); // // Write the current PTE // - PointerPte += Offset; + TempPte.u.Hard.PageFrameNumber = Page; *PointerPte = TempPte; // // Return the address // - Address = (PVOID)((ULONG_PTR)PointerPte << 10); return Address; } - -VOID -NTAPI -MiUnmapPageInZeroSpace(IN PVOID Address) -{ - // - // Blow away the mapping - // - MiAddressToPte(Address)->u.Long = 0; -}