Author: ros-arm-bringup
Date: Sun Jul 27 20:11:19 2008
New Revision: 34879
URL:
http://svn.reactos.org/svn/reactos?rev=34879&view=rev
Log:
The address space creation lock is a guarded mutex, not a pushlock, in NT 5.2. While it is
commendable to attempt using Vista optimizations (it is a push lock on Vista) in order to
speed up
the kernel, it is entirely stupid to do so by completing ignoring the ramifications of
this change, and furthermore, to pollute the kernel with typecasts, as well as to
introduce non-standard
behavior. Ironically it is ion himself who made this change.
Modified:
trunk/reactos/ntoskrnl/include/internal/mm.h
trunk/reactos/ntoskrnl/mm/i386/page.c
trunk/reactos/ntoskrnl/mm/procsup.c
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Sun Jul 27 20:11:19 2008
@@ -1574,16 +1574,14 @@
VOID
MmLockAddressSpace(PMADDRESS_SPACE AddressSpace)
{
- KeEnterCriticalRegion();
- ExAcquirePushLockExclusive((PEX_PUSH_LOCK)&CONTAINING_RECORD(AddressSpace,
EPROCESS, VadRoot)->AddressCreationLock);
+ KeAcquireGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS,
VadRoot)->AddressCreationLock);
}
FORCEINLINE
VOID
MmUnlockAddressSpace(PMADDRESS_SPACE AddressSpace)
{
- ExReleasePushLock((PEX_PUSH_LOCK)&CONTAINING_RECORD(AddressSpace, EPROCESS,
VadRoot)->AddressCreationLock);
- KeLeaveCriticalRegion();
+ KeReleaseGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS,
VadRoot)->AddressCreationLock);
}
FORCEINLINE
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Sun Jul 27 20:11:19 2008
@@ -196,6 +196,7 @@
*DirectoryTableBase = PsGetCurrentProcess()->Pcb.DirectoryTableBase;
/* Initialize the Addresss Space */
+ KeInitializeGuardedMutex(&Process->AddressCreationLock);
MmInitializeAddressSpace(Process, (PMADDRESS_SPACE)&Process->VadRoot);
/* The process now has an address space */
Modified: trunk/reactos/ntoskrnl/mm/procsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/procsup.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] Sun Jul 27 20:11:19 2008
@@ -520,6 +520,7 @@
BoundaryAddressMultiple.QuadPart = 0;
/* Initialize the Addresss Space */
+ KeInitializeGuardedMutex(&Process->AddressCreationLock);
MmInitializeAddressSpace(Process, ProcessAddressSpace);
/* Acquire the Lock */