Author: fireball Date: Mon Apr 27 14:12:57 2009 New Revision: 40713
URL: http://svn.reactos.org/svn/reactos?rev=40713&view=rev Log: - Change storage of ReactOS-specific virtual address space from VadRoot to Vm EPROCESS structure member. Change containing "structure" from MM_AVL_TABLE to MMSUPPORT respectively .
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h trunk/reactos/ntoskrnl/mm/anonmem.c trunk/reactos/ntoskrnl/mm/i386/page.c trunk/reactos/ntoskrnl/mm/marea.c trunk/reactos/ntoskrnl/mm/mdlsup.c trunk/reactos/ntoskrnl/mm/mm.c trunk/reactos/ntoskrnl/mm/procsup.c trunk/reactos/ntoskrnl/mm/region.c trunk/reactos/ntoskrnl/mm/rmap.c trunk/reactos/ntoskrnl/mm/section.c trunk/reactos/ntoskrnl/mm/virtual.c
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/m... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -388,7 +388,7 @@
typedef VOID (*PMM_ALTER_REGION_FUNC)( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID BaseAddress, ULONG Length, ULONG OldType, @@ -412,7 +412,7 @@ NTSTATUS NTAPI MmCreateMemoryArea( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, ULONG Type, PVOID *BaseAddress, ULONG_PTR Length, @@ -426,21 +426,21 @@ PMEMORY_AREA NTAPI MmLocateMemoryAreaByAddress( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID Address );
ULONG_PTR NTAPI MmFindGapAtAddress( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID Address );
NTSTATUS NTAPI MmFreeMemoryArea( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PMM_FREE_PAGE_FUNC FreePage, PVOID FreePageContext @@ -449,7 +449,7 @@ NTSTATUS NTAPI MmFreeMemoryAreaByPtr( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID BaseAddress, PMM_FREE_PAGE_FUNC FreePage, PVOID FreePageContext @@ -457,12 +457,12 @@
VOID NTAPI -MmDumpMemoryAreas(PMM_AVL_TABLE AddressSpace); +MmDumpMemoryAreas(PMMSUPPORT AddressSpace);
PMEMORY_AREA NTAPI MmLocateMemoryAreaByRegion( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID Address, ULONG_PTR Length ); @@ -470,7 +470,7 @@ PVOID NTAPI MmFindGap( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, ULONG_PTR Length, ULONG_PTR Granularity, BOOLEAN TopDown @@ -480,7 +480,7 @@ NTAPI MmReleaseMemoryAreaIfDecommitted( struct _EPROCESS *Process, - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID BaseAddress );
@@ -746,7 +746,7 @@ NTSTATUS NTAPI MmNotPresentFaultVirtualMemory( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, BOOLEAN Locked @@ -755,7 +755,7 @@ NTSTATUS NTAPI MmPageOutVirtualMemory( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID Address, struct _MM_PAGEOP* PageOp @@ -780,7 +780,7 @@ NTSTATUS NTAPI MmProtectAnonMem( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID BaseAddress, ULONG Length, @@ -791,7 +791,7 @@ NTSTATUS NTAPI MmWritePageVirtualMemory( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PMEMORY_AREA MArea, PVOID Address, PMM_PAGEOP PageOp @@ -1390,7 +1390,7 @@ NTSTATUS NTAPI MmAlterRegion( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID StartAddress, @@ -1458,7 +1458,7 @@ NTSTATUS NTAPI MmProtectSectionView( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID BaseAddress, ULONG Length, @@ -1469,7 +1469,7 @@ NTSTATUS NTAPI MmWritePageSectionView( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PMEMORY_AREA MArea, PVOID Address, PMM_PAGEOP PageOp @@ -1482,7 +1482,7 @@ NTSTATUS NTAPI MmNotPresentFaultSectionView( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, BOOLEAN Locked @@ -1491,7 +1491,7 @@ NTSTATUS NTAPI MmPageOutSectionView( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID Address, struct _MM_PAGEOP *PageOp @@ -1504,7 +1504,7 @@ NTSTATUS NTAPI MmAccessFaultSectionView( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, BOOLEAN Locked @@ -1608,39 +1608,39 @@ IN PKTHREAD Thread );
-extern PMM_AVL_TABLE MmKernelAddressSpace; +extern PMMSUPPORT MmKernelAddressSpace;
FORCEINLINE VOID -MmLockAddressSpace(PMM_AVL_TABLE AddressSpace) -{ - KeAcquireGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, VadRoot)->AddressCreationLock); +MmLockAddressSpace(PMMSUPPORT AddressSpace) +{ + KeAcquireGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock); }
FORCEINLINE VOID -MmUnlockAddressSpace(PMM_AVL_TABLE AddressSpace) -{ - KeReleaseGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, VadRoot)->AddressCreationLock); +MmUnlockAddressSpace(PMMSUPPORT AddressSpace) +{ + KeReleaseGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock); }
FORCEINLINE PEPROCESS -MmGetAddressSpaceOwner(IN PMM_AVL_TABLE AddressSpace) +MmGetAddressSpaceOwner(IN PMMSUPPORT AddressSpace) { if (AddressSpace == MmKernelAddressSpace) return NULL; - return CONTAINING_RECORD(AddressSpace, EPROCESS, VadRoot); + return CONTAINING_RECORD(AddressSpace, EPROCESS, Vm); }
FORCEINLINE -PMM_AVL_TABLE +PMMSUPPORT MmGetCurrentAddressSpace(VOID) { - return &((PEPROCESS)KeGetCurrentThread()->ApcState.Process)->VadRoot; + return &((PEPROCESS)KeGetCurrentThread()->ApcState.Process)->Vm; }
FORCEINLINE -PMM_AVL_TABLE +PMMSUPPORT MmGetKernelAddressSpace(VOID) { return MmKernelAddressSpace;
Modified: trunk/reactos/ntoskrnl/mm/anonmem.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/anonmem.c?rev=4... ============================================================================== --- trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -47,7 +47,7 @@
NTSTATUS NTAPI -MmWritePageVirtualMemory(PMM_AVL_TABLE AddressSpace, +MmWritePageVirtualMemory(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID Address, PMM_PAGEOP PageOp) @@ -130,7 +130,7 @@
NTSTATUS NTAPI -MmPageOutVirtualMemory(PMM_AVL_TABLE AddressSpace, +MmPageOutVirtualMemory(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID Address, PMM_PAGEOP PageOp) @@ -239,7 +239,7 @@
NTSTATUS NTAPI -MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, +MmNotPresentFaultVirtualMemory(PMMSUPPORT AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, BOOLEAN Locked) @@ -446,7 +446,7 @@ }
static VOID -MmModifyAttributes(PMM_AVL_TABLE AddressSpace, +MmModifyAttributes(PMMSUPPORT AddressSpace, PVOID BaseAddress, ULONG RegionSize, ULONG OldType, @@ -562,7 +562,7 @@ ULONG_PTR MemoryAreaLength; ULONG Type; NTSTATUS Status; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; PVOID BaseAddress; ULONG RegionSize; PVOID PBaseAddress; @@ -713,7 +713,7 @@ Type = (AllocationType & MEM_COMMIT) ? MEM_COMMIT : MEM_RESERVE; DPRINT("Type %x\n", Type);
- AddressSpace = &Process->VadRoot; + AddressSpace = &Process->Vm; MmLockAddressSpace(AddressSpace);
if (PBaseAddress != 0) @@ -888,7 +888,7 @@ if (PageOp != NULL) { NTSTATUS Status; - MmUnlockAddressSpace(&Process->VadRoot); + MmUnlockAddressSpace(&Process->Vm); Status = KeWaitForSingleObject(&PageOp->CompletionEvent, 0, KernelMode, @@ -899,7 +899,7 @@ DPRINT1("Failed to wait for page op\n"); KeBugCheck(MEMORY_MANAGEMENT); } - MmLockAddressSpace(&Process->VadRoot); + MmLockAddressSpace(&Process->Vm); MmReleasePageOp(PageOp); } } @@ -915,7 +915,7 @@ }
/* Actually free the memory area. */ - MmFreeMemoryArea(&Process->VadRoot, + MmFreeMemoryArea(&Process->Vm, MemoryArea, MmFreeVirtualMemoryPage, (PVOID)Process); @@ -945,7 +945,7 @@ MEMORY_AREA* MemoryArea; NTSTATUS Status; PEPROCESS Process; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; PVOID BaseAddress; ULONG RegionSize;
@@ -974,7 +974,7 @@ return(Status); }
- AddressSpace = &Process->VadRoot; + AddressSpace = &Process->Vm;
MmLockAddressSpace(AddressSpace); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress); @@ -1024,7 +1024,7 @@
NTSTATUS NTAPI -MmProtectAnonMem(PMM_AVL_TABLE AddressSpace, +MmProtectAnonMem(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID BaseAddress, ULONG Length,
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -172,7 +172,7 @@
/* Initialize the Addresss Space */ KeInitializeGuardedMutex(&Process->AddressCreationLock); - Process->VadRoot.BalancedRoot.u1.Parent = NULL; + Process->Vm.WorkingSetExpansionLinks.Flink = NULL;
/* The process now has an address space */ Process->HasAddressSpace = TRUE;
Modified: trunk/reactos/ntoskrnl/mm/marea.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=407... ============================================================================== --- trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -160,18 +160,18 @@ }
#ifdef VALIDATE_MEMORY_AREAS -static VOID MmVerifyMemoryAreas(PMM_AVL_TABLE AddressSpace) +static VOID MmVerifyMemoryAreas(PMMSUPPORT AddressSpace) { PMEMORY_AREA Node;
ASSERT(AddressSpace != NULL);
/* Special case for empty tree. */ - if (AddressSpace->BalancedRoot.u1.Parent == NULL) + if (AddressSpace->WorkingSetExpansionLinks.Flink == NULL) return;
/* Traverse the tree from left to right. */ - for (Node = MmIterateFirstNode(AddressSpace->BalancedRoot.u1.Parent); + for (Node = MmIterateFirstNode(AddressSpace->WorkingSetExpansionLinks.Flink); Node != NULL; Node = MmIterateNextNode(Node)) { @@ -186,18 +186,18 @@ #endif
VOID NTAPI -MmDumpMemoryAreas(PMM_AVL_TABLE AddressSpace) +MmDumpMemoryAreas(PMMSUPPORT AddressSpace) { PMEMORY_AREA Node;
DbgPrint("MmDumpMemoryAreas()\n");
/* Special case for empty tree. */ - if (AddressSpace->BalancedRoot.u1.Parent == NULL) + if (AddressSpace->WorkingSetExpansionLinks.Flink == NULL) return;
/* Traverse the tree from left to right. */ - for (Node = MmIterateFirstNode((PMEMORY_AREA)AddressSpace->BalancedRoot.u1.Parent); + for (Node = MmIterateFirstNode((PMEMORY_AREA)AddressSpace->WorkingSetExpansionLinks.Flink); Node != NULL; Node = MmIterateNextNode(Node)) { @@ -211,10 +211,10 @@
PMEMORY_AREA NTAPI MmLocateMemoryAreaByAddress( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID Address) { - PMEMORY_AREA Node = (PMEMORY_AREA)AddressSpace->BalancedRoot.u1.Parent; + PMEMORY_AREA Node = (PMEMORY_AREA)AddressSpace->WorkingSetExpansionLinks.Flink;
DPRINT("MmLocateMemoryAreaByAddress(AddressSpace %p, Address %p)\n", AddressSpace, Address); @@ -241,7 +241,7 @@
PMEMORY_AREA NTAPI MmLocateMemoryAreaByRegion( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID Address, ULONG_PTR Length) { @@ -251,11 +251,11 @@ MmVerifyMemoryAreas(AddressSpace);
/* Special case for empty tree. */ - if (AddressSpace->BalancedRoot.u1.Parent == NULL) + if (AddressSpace->WorkingSetExpansionLinks.Flink == NULL) return NULL;
/* Traverse the tree from left to right. */ - for (Node = MmIterateFirstNode((PMEMORY_AREA)AddressSpace->BalancedRoot.u1.Parent); + for (Node = MmIterateFirstNode((PMEMORY_AREA)AddressSpace->WorkingSetExpansionLinks.Flink); Node != NULL; Node = MmIterateNextNode(Node)) { @@ -302,11 +302,11 @@
static VOID MmCompressHelper( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, ULONG Count) { PMEMORY_AREA Root = NULL; - PMEMORY_AREA Red = (PMEMORY_AREA)AddressSpace->BalancedRoot.u1.Parent; + PMEMORY_AREA Red = (PMEMORY_AREA)AddressSpace->WorkingSetExpansionLinks.Flink; PMEMORY_AREA Black = Red->LeftChild;
while (Count--) @@ -314,7 +314,7 @@ if (Root) Root->LeftChild = Black; else - AddressSpace->BalancedRoot.u1.Parent = (PVOID)Black; + AddressSpace->WorkingSetExpansionLinks.Flink = (PVOID)Black; Black->Parent = Root; Red->LeftChild = Black->RightChild; if (Black->RightChild) @@ -341,7 +341,7 @@
static VOID MmRebalanceTree( - PMM_AVL_TABLE AddressSpace) + PMMSUPPORT AddressSpace) { PMEMORY_AREA PreviousNode; PMEMORY_AREA CurrentNode; @@ -354,7 +354,7 @@ /* Transform the tree into Vine. */
PreviousNode = NULL; - CurrentNode = (PMEMORY_AREA)AddressSpace->BalancedRoot.u1.Parent; + CurrentNode = (PMEMORY_AREA)AddressSpace->WorkingSetExpansionLinks.Flink; while (CurrentNode != NULL) { if (CurrentNode->RightChild == NULL) @@ -379,7 +379,7 @@ if (PreviousNode != NULL) PreviousNode->LeftChild = TempNode; else - AddressSpace->BalancedRoot.u1.Parent = (PVOID)TempNode; + AddressSpace->WorkingSetExpansionLinks.Flink = (PVOID)TempNode; TempNode->Parent = PreviousNode; } } @@ -410,7 +410,7 @@
static VOID MmInsertMemoryArea( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PMEMORY_AREA marea) { PMEMORY_AREA Node; @@ -419,14 +419,14 @@
MmVerifyMemoryAreas(AddressSpace);
- if (AddressSpace->BalancedRoot.u1.Parent == NULL) - { - AddressSpace->BalancedRoot.u1.Parent = (PVOID)marea; + if (AddressSpace->WorkingSetExpansionLinks.Flink == NULL) + { + AddressSpace->WorkingSetExpansionLinks.Flink = (PVOID)marea; marea->LeftChild = marea->RightChild = marea->Parent = NULL; return; }
- Node = (PMEMORY_AREA)AddressSpace->BalancedRoot.u1.Parent; + Node = (PMEMORY_AREA)AddressSpace->WorkingSetExpansionLinks.Flink; do { DPRINT("marea->EndingAddress: %p Node->StartingAddress: %p\n", @@ -466,7 +466,7 @@
static PVOID MmFindGapBottomUp( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, ULONG_PTR Length, ULONG_PTR Granularity) { @@ -486,7 +486,7 @@ AlignedAddress = MM_ROUND_UP(LowestAddress, Granularity);
/* Special case for empty tree. */ - if (AddressSpace->BalancedRoot.u1.Parent == NULL) + if (AddressSpace->WorkingSetExpansionLinks.Flink == NULL) { if ((ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length) { @@ -498,7 +498,7 @@ }
/* Go to the node with lowest address in the tree. */ - FirstNode = Node = MmIterateFirstNode((PMEMORY_AREA)AddressSpace->BalancedRoot.u1.Parent); + FirstNode = Node = MmIterateFirstNode((PMEMORY_AREA)AddressSpace->WorkingSetExpansionLinks.Flink);
/* Traverse the tree from left to right. */ PreviousNode = Node; @@ -544,7 +544,7 @@
static PVOID MmFindGapTopDown( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, ULONG_PTR Length, ULONG_PTR Granularity) { @@ -567,7 +567,7 @@ return NULL;
/* Special case for empty tree. */ - if (AddressSpace->BalancedRoot.u1.Parent == NULL) + if (AddressSpace->WorkingSetExpansionLinks.Flink == NULL) { if (AlignedAddress >= LowestAddress) { @@ -579,7 +579,7 @@ }
/* Go to the node with highest address in the tree. */ - Node = MmIterateLastNode((PMEMORY_AREA)AddressSpace->BalancedRoot.u1.Parent); + Node = MmIterateLastNode((PMEMORY_AREA)AddressSpace->WorkingSetExpansionLinks.Flink);
/* Check if there is enough space after the last memory area. */ if (Node->EndingAddress <= AlignedAddress) @@ -630,7 +630,7 @@
PVOID NTAPI MmFindGap( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, ULONG_PTR Length, ULONG_PTR Granularity, BOOLEAN TopDown) @@ -643,10 +643,10 @@
ULONG_PTR NTAPI MmFindGapAtAddress( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID Address) { - PMEMORY_AREA Node = (PMEMORY_AREA)AddressSpace->BalancedRoot.u1.Parent; + PMEMORY_AREA Node = (PMEMORY_AREA)AddressSpace->WorkingSetExpansionLinks.Flink; PMEMORY_AREA RightNeighbour = NULL; PVOID LowestAddress = MmGetAddressSpaceOwner(AddressSpace) ? MM_LOWEST_USER_ADDRESS : MmSystemRangeStart; PVOID HighestAddress = MmGetAddressSpaceOwner(AddressSpace) ? @@ -725,7 +725,7 @@
NTSTATUS NTAPI MmFreeMemoryArea( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PMM_FREE_PAGE_FUNC FreePage, PVOID FreePageContext) @@ -789,7 +789,7 @@ ParentReplace = &MemoryArea->Parent->RightChild; } else - ParentReplace = (PMEMORY_AREA*)&AddressSpace->BalancedRoot.u1.Parent; + ParentReplace = (PMEMORY_AREA*)&AddressSpace->WorkingSetExpansionLinks.Flink;
if (MemoryArea->RightChild == NULL) { @@ -867,7 +867,7 @@
NTSTATUS NTAPI MmFreeMemoryAreaByPtr( - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID BaseAddress, PMM_FREE_PAGE_FUNC FreePage, PVOID FreePageContext) @@ -918,7 +918,7 @@ */
NTSTATUS NTAPI -MmCreateMemoryArea(PMM_AVL_TABLE AddressSpace, +MmCreateMemoryArea(PMMSUPPORT AddressSpace, ULONG Type, PVOID *BaseAddress, ULONG_PTR Length, @@ -1042,7 +1042,7 @@
VOID NTAPI MmReleaseMemoryAreaIfDecommitted(PEPROCESS Process, - PMM_AVL_TABLE AddressSpace, + PMMSUPPORT AddressSpace, PVOID BaseAddress) { PMEMORY_AREA MemoryArea;
Modified: trunk/reactos/ntoskrnl/mm/mdlsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mdlsup.c?rev=40... ============================================================================== --- trunk/reactos/ntoskrnl/mm/mdlsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/mdlsup.c [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -366,12 +366,12 @@ ASSERT(Mdl->Process == PsGetCurrentProcess());
/* Find the memory area */ - MemoryArea = MmLocateMemoryAreaByAddress(&Mdl->Process->VadRoot, + MemoryArea = MmLocateMemoryAreaByAddress(&Mdl->Process->Vm, BaseAddress); ASSERT(MemoryArea);
/* Free it */ - MmFreeMemoryArea(&Mdl->Process->VadRoot, + MmFreeMemoryArea(&Mdl->Process->Vm, MemoryArea, NULL, NULL); @@ -395,7 +395,7 @@ PFN_TYPE Page; PEPROCESS CurrentProcess; PETHREAD Thread; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; KIRQL OldIrql = KeGetCurrentIrql(); DPRINT("Probing MDL: %p\n", Mdl);
@@ -480,7 +480,7 @@ Mdl->Process = CurrentProcess;
/* Use the process lock */ - AddressSpace = &CurrentProcess->VadRoot; + AddressSpace = &CurrentProcess->Vm; }
@@ -758,8 +758,8 @@
CurrentProcess = PsGetCurrentProcess();
- MmLockAddressSpace(&CurrentProcess->VadRoot); - Status = MmCreateMemoryArea(&CurrentProcess->VadRoot, + MmLockAddressSpace(&CurrentProcess->Vm); + Status = MmCreateMemoryArea(&CurrentProcess->Vm, MEMORY_AREA_MDL_MAPPING, &Base, PageCount * PAGE_SIZE, @@ -768,7 +768,7 @@ (Base != NULL), 0, BoundaryAddressMultiple); - MmUnlockAddressSpace(&CurrentProcess->VadRoot); + MmUnlockAddressSpace(&CurrentProcess->Vm); if (!NT_SUCCESS(Status)) { if (Mdl->MdlFlags & MDL_MAPPING_CAN_FAIL)
Modified: trunk/reactos/ntoskrnl/mm/mm.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mm.c?rev=40713&... ============================================================================== --- trunk/reactos/ntoskrnl/mm/mm.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/mm.c [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -22,7 +22,7 @@
MM_STATS MmStats;
-PMM_AVL_TABLE MmKernelAddressSpace; +PMMSUPPORT MmKernelAddressSpace;
/* FUNCTIONS ****************************************************************/
@@ -81,7 +81,7 @@ */ { MEMORY_AREA* MemoryArea; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace;
if (VirtualAddress >= MmSystemRangeStart) { @@ -89,7 +89,7 @@ } else { - AddressSpace = &PsGetCurrentProcess()->VadRoot; + AddressSpace = &PsGetCurrentProcess()->Vm; }
MmLockAddressSpace(AddressSpace); @@ -111,7 +111,7 @@ ULONG_PTR Address, BOOLEAN FromMdl) { - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; MEMORY_AREA* MemoryArea; NTSTATUS Status; BOOLEAN Locked = FromMdl; @@ -146,7 +146,7 @@ } else { - AddressSpace = &PsGetCurrentProcess()->VadRoot; + AddressSpace = &PsGetCurrentProcess()->Vm; }
if (!FromMdl) @@ -211,7 +211,7 @@ ULONG_PTR Address, BOOLEAN FromMdl) { - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; MEMORY_AREA* MemoryArea; NTSTATUS Status; BOOLEAN Locked = FromMdl; @@ -242,7 +242,7 @@ } else { - AddressSpace = &PsGetCurrentProcess()->VadRoot; + AddressSpace = &PsGetCurrentProcess()->Vm; }
if (!FromMdl)
Modified: trunk/reactos/ntoskrnl/mm/procsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/procsup.c?rev=4... ============================================================================== --- trunk/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -80,7 +80,7 @@ PVOID BaseAddress) { NTSTATUS Status; - PMM_AVL_TABLE ProcessAddressSpace = &Process->VadRoot; + PMMSUPPORT ProcessAddressSpace = &Process->Vm; PMEMORY_AREA MemoryArea; PHYSICAL_ADDRESS BoundaryAddressMultiple; PVOID AllocatedBase = BaseAddress; @@ -163,7 +163,7 @@ MmDeleteTeb(PEPROCESS Process, PTEB Teb) { - PMM_AVL_TABLE ProcessAddressSpace = &Process->VadRoot; + PMMSUPPORT ProcessAddressSpace = &Process->Vm; PMEMORY_AREA MemoryArea;
/* Lock the Address Space */ @@ -486,7 +486,7 @@ PMEMORY_AREA MemoryArea; PHYSICAL_ADDRESS BoundaryAddressMultiple; NTSTATUS Status; - PMM_AVL_TABLE ProcessAddressSpace = &Process->VadRoot; + PMMSUPPORT ProcessAddressSpace = &Process->Vm; BoundaryAddressMultiple.QuadPart = 0;
/* Create the shared data page */ @@ -512,7 +512,7 @@ IN POBJECT_NAME_INFORMATION *AuditName OPTIONAL) { NTSTATUS Status; - PMM_AVL_TABLE ProcessAddressSpace = &Process->VadRoot; + PMMSUPPORT ProcessAddressSpace = &Process->Vm; PVOID BaseAddress; PMEMORY_AREA MemoryArea; PHYSICAL_ADDRESS BoundaryAddressMultiple; @@ -523,7 +523,7 @@
/* Initialize the Addresss Space lock */ KeInitializeGuardedMutex(&Process->AddressCreationLock); - Process->VadRoot.BalancedRoot.u1.Parent = NULL; + Process->Vm.WorkingSetExpansionLinks.Flink = NULL;
/* Acquire the Lock */ MmLockAddressSpace(ProcessAddressSpace); @@ -684,17 +684,17 @@ DPRINT("MmDeleteProcessAddressSpace(Process %x (%s))\n", Process, Process->ImageFileName);
- MmLockAddressSpace(&Process->VadRoot); - - while ((MemoryArea = (PMEMORY_AREA)Process->VadRoot.BalancedRoot.u1.Parent) != NULL) + MmLockAddressSpace(&Process->Vm); + + while ((MemoryArea = (PMEMORY_AREA)Process->Vm.WorkingSetExpansionLinks.Flink) != NULL) { switch (MemoryArea->Type) { case MEMORY_AREA_SECTION_VIEW: Address = (PVOID)MemoryArea->StartingAddress; - MmUnlockAddressSpace(&Process->VadRoot); + MmUnlockAddressSpace(&Process->Vm); MmUnmapViewOfSection(Process, Address); - MmLockAddressSpace(&Process->VadRoot); + MmLockAddressSpace(&Process->Vm); break;
case MEMORY_AREA_VIRTUAL_MEMORY: @@ -704,7 +704,7 @@
case MEMORY_AREA_SHARED_DATA: case MEMORY_AREA_NO_ACCESS: - MmFreeMemoryArea(&Process->VadRoot, + MmFreeMemoryArea(&Process->Vm, MemoryArea, NULL, NULL); @@ -721,7 +721,7 @@
Mmi386ReleaseMmInfo(Process);
- MmUnlockAddressSpace(&Process->VadRoot); + MmUnlockAddressSpace(&Process->Vm);
DPRINT("Finished MmReleaseMmInfo()\n"); return(STATUS_SUCCESS);
Modified: trunk/reactos/ntoskrnl/mm/region.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/region.c?rev=40... ============================================================================== --- trunk/reactos/ntoskrnl/mm/region.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/region.c [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -33,7 +33,7 @@ static PMM_REGION MmSplitRegion(PMM_REGION InitialRegion, PVOID InitialBaseAddress, PVOID StartAddress, ULONG Length, ULONG NewType, - ULONG NewProtect, PMM_AVL_TABLE AddressSpace, + ULONG NewProtect, PMMSUPPORT AddressSpace, PMM_ALTER_REGION_FUNC AlterFunc) { PMM_REGION NewRegion1; @@ -105,7 +105,7 @@
NTSTATUS NTAPI -MmAlterRegion(PMM_AVL_TABLE AddressSpace, PVOID BaseAddress, +MmAlterRegion(PMMSUPPORT AddressSpace, PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID StartAddress, ULONG Length, ULONG NewType, ULONG NewProtect, PMM_ALTER_REGION_FUNC AlterFunc) {
Modified: trunk/reactos/ntoskrnl/mm/rmap.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/rmap.c?rev=4071... ============================================================================== --- trunk/reactos/ntoskrnl/mm/rmap.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/rmap.c [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -58,7 +58,7 @@ { PMM_RMAP_ENTRY entry; PMEMORY_AREA MemoryArea; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; ULONG Type; PVOID Address; PEPROCESS Process; @@ -91,7 +91,7 @@ { return Status; } - AddressSpace = &Process->VadRoot; + AddressSpace = &Process->Vm; } else { @@ -192,7 +192,7 @@ { PMM_RMAP_ENTRY entry; PMEMORY_AREA MemoryArea; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; ULONG Type; PVOID Address; PEPROCESS Process; @@ -222,7 +222,7 @@ { return Status; } - AddressSpace = &Process->VadRoot; + AddressSpace = &Process->Vm; } else {
Modified: trunk/reactos/ntoskrnl/mm/section.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=4... ============================================================================== --- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -152,7 +152,7 @@ { PROS_SECTION_OBJECT Section; PMEMORY_AREA MemoryArea; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; POBJECT_NAME_INFORMATION ModuleNameInformation; NTSTATUS Status = STATUS_ADDRESS_NOT_ASSOCIATED;
@@ -163,7 +163,7 @@ } else { - AddressSpace = &PsGetCurrentProcess()->VadRoot; + AddressSpace = &PsGetCurrentProcess()->Vm; }
/* Lock address space */ @@ -753,7 +753,7 @@
NTSTATUS NTAPI -MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, +MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, BOOLEAN Locked) @@ -1273,7 +1273,7 @@
NTSTATUS NTAPI -MmAccessFaultSectionView(PMM_AVL_TABLE AddressSpace, +MmAccessFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, BOOLEAN Locked) @@ -1458,7 +1458,7 @@ PageOutContext = (MM_SECTION_PAGEOUT_CONTEXT*)Context; if (Process) { - MmLockAddressSpace(&Process->VadRoot); + MmLockAddressSpace(&Process->Vm); }
MmDeleteVirtualMapping(Process, @@ -1482,7 +1482,7 @@ } if (Process) { - MmUnlockAddressSpace(&Process->VadRoot); + MmUnlockAddressSpace(&Process->Vm); }
if (PageOutContext->Private) @@ -1495,7 +1495,7 @@
NTSTATUS NTAPI -MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, +MmPageOutSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA* MemoryArea, PVOID Address, PMM_PAGEOP PageOp) @@ -1849,7 +1849,7 @@
NTSTATUS NTAPI -MmWritePageSectionView(PMM_AVL_TABLE AddressSpace, +MmWritePageSectionView(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID Address, PMM_PAGEOP PageOp) @@ -1996,7 +1996,7 @@ }
static VOID -MmAlterViewAttributes(PMM_AVL_TABLE AddressSpace, +MmAlterViewAttributes(PMMSUPPORT AddressSpace, PVOID BaseAddress, ULONG RegionSize, ULONG OldType, @@ -2061,7 +2061,7 @@
NTSTATUS NTAPI -MmProtectSectionView(PMM_AVL_TABLE AddressSpace, +MmProtectSectionView(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID BaseAddress, ULONG Length, @@ -3611,7 +3611,7 @@ }
static NTSTATUS -MmMapViewOfSegment(PMM_AVL_TABLE AddressSpace, +MmMapViewOfSegment(PMMSUPPORT AddressSpace, PROS_SECTION_OBJECT Section, PMM_SECTION_SEGMENT Segment, PVOID* BaseAddress, @@ -3722,7 +3722,7 @@ PROS_SECTION_OBJECT Section; PEPROCESS Process; KPROCESSOR_MODE PreviousMode; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; NTSTATUS Status = STATUS_SUCCESS; ULONG tmpProtect;
@@ -3801,7 +3801,7 @@ return(Status); }
- AddressSpace = &Process->VadRoot; + AddressSpace = &Process->Vm;
Status = ObReferenceObjectByHandle(SectionHandle, SECTION_MAP_READ, @@ -3883,10 +3883,10 @@ NTSTATUS Status; PROS_SECTION_OBJECT Section; PMM_SECTION_SEGMENT Segment; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; PEPROCESS Process;
- AddressSpace = (PMM_AVL_TABLE)Context; + AddressSpace = (PMMSUPPORT)Context; Process = MmGetAddressSpaceOwner(AddressSpace);
Address = (PVOID)PAGE_ROUND_DOWN(Address); @@ -3980,7 +3980,7 @@ }
static NTSTATUS -MmUnmapViewOfSegment(PMM_AVL_TABLE AddressSpace, +MmUnmapViewOfSegment(PMMSUPPORT AddressSpace, PVOID BaseAddress) { NTSTATUS Status; @@ -4040,7 +4040,7 @@ { NTSTATUS Status; PMEMORY_AREA MemoryArea; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; PROS_SECTION_OBJECT Section; PMM_PAGEOP PageOp; ULONG_PTR Offset; @@ -4051,7 +4051,7 @@
ASSERT(Process);
- AddressSpace = &Process->VadRoot; + AddressSpace = &Process->Vm;
MmLockAddressSpace(AddressSpace); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, @@ -4441,7 +4441,7 @@ PVOID Result; MEMORY_AREA* marea; NTSTATUS Status; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; PHYSICAL_ADDRESS BoundaryAddressMultiple;
DPRINT("MmAllocateSection(Length %x)\n",Length); @@ -4537,7 +4537,7 @@ IN ULONG Protect) { PROS_SECTION_OBJECT Section; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; ULONG ViewOffset; NTSTATUS Status = STATUS_SUCCESS;
@@ -4550,7 +4550,7 @@
Section = (PROS_SECTION_OBJECT)SectionObject; - AddressSpace = &Process->VadRoot; + AddressSpace = &Process->Vm;
AllocationType |= (Section->AllocationAttributes & SEC_NO_CHANGE);
@@ -4815,7 +4815,7 @@ IN OUT PULONG ViewSize) { PROS_SECTION_OBJECT Section; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; NTSTATUS Status;
DPRINT("MmMapViewInSystemSpace() called\n"); @@ -4875,7 +4875,7 @@ NTSTATUS NTAPI MmUnmapViewInSystemSpace (IN PVOID MappedBase) { - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; NTSTATUS Status;
DPRINT("MmUnmapViewInSystemSpace() called\n");
Modified: trunk/reactos/ntoskrnl/mm/virtual.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/virtual.c?rev=4... ============================================================================== --- trunk/reactos/ntoskrnl/mm/virtual.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/virtual.c [iso-8859-1] Mon Apr 27 14:12:57 2009 @@ -421,7 +421,7 @@ NTSTATUS Status; PEPROCESS Process; MEMORY_AREA* MemoryArea; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace;
Status = ObReferenceObjectByHandle(ProcessHandle, PROCESS_QUERY_INFORMATION, @@ -436,7 +436,7 @@ return(Status); }
- AddressSpace = &Process->VadRoot; + AddressSpace = &Process->Vm;
MmLockAddressSpace(AddressSpace); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address); @@ -576,7 +576,7 @@ OUT PULONG OldAccessProtection OPTIONAL) { PMEMORY_AREA MemoryArea; - PMM_AVL_TABLE AddressSpace; + PMMSUPPORT AddressSpace; ULONG OldAccessProtection_; NTSTATUS Status;
@@ -585,7 +585,7 @@ PAGE_ROUND_DOWN(*BaseAddress); *BaseAddress = (PVOID)PAGE_ROUND_DOWN(*BaseAddress);
- AddressSpace = &Process->VadRoot; + AddressSpace = &Process->Vm;
MmLockAddressSpace(AddressSpace); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, *BaseAddress);