Author: dgorbachev
Date: Sun Mar 15 04:23:47 2009
New Revision: 40020
URL:
http://svn.reactos.org/svn/reactos?rev=40020&view=rev
Log:
Trying to use r39938 variant again...
Modified:
trunk/reactos/ntoskrnl/mm/hypermap.c
Modified: trunk/reactos/ntoskrnl/mm/hypermap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/hypermap.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/hypermap.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/hypermap.c [iso-8859-1] Sun Mar 15 04:23:47 2009
@@ -139,7 +139,6 @@
{
MMPTE TempPte;
PMMPTE PointerPte;
- PFN_NUMBER Offset;
PVOID Address;
//
@@ -154,47 +153,24 @@
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;
-}