Author: tkreuzer
Date: Fri Aug 18 07:13:34 2017
New Revision: 75602
URL:
http://svn.reactos.org/svn/reactos?rev=75602&view=rev
Log:
[NTOSKRNL] Remove duplicate fields from MEMORY_AREA
Modified:
trunk/reactos/ntoskrnl/include/internal/mm.h
trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
trunk/reactos/ntoskrnl/mm/marea.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] Fri Aug 18 07:13:34 2017
@@ -200,17 +200,13 @@
};
} ROS_SECTION_OBJECT, *PROS_SECTION_OBJECT;
-#define MA_GetStartingAddress(_MemoryArea) ((_MemoryArea)->StartingVpn <<
PAGE_SHIFT)
-#define MA_GetEndingAddress(_MemoryArea) (((_MemoryArea)->EndingVpn + 1) <<
PAGE_SHIFT)
+#define MA_GetStartingAddress(_MemoryArea) (MemoryArea->VadNode.StartingVpn <<
PAGE_SHIFT)
+#define MA_GetEndingAddress(_MemoryArea) ((MemoryArea->VadNode.EndingVpn + 1) <<
PAGE_SHIFT)
typedef struct _MEMORY_AREA
{
MMVAD VadNode;
- ULONG_PTR StartingVpn;
- ULONG_PTR EndingVpn;
- struct _MEMORY_AREA *Parent;
- struct _MEMORY_AREA *LeftChild;
- struct _MEMORY_AREA *RightChild;
+
ULONG Type;
ULONG Protect;
ULONG Flags;
Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/virtual.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] Fri Aug 18 07:13:34 2017
@@ -5383,10 +5383,10 @@
Vad->u.VadFlags.CommitCharge -= CommitReduction;
// For ReactOS: shrink the corresponding memory area
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
(PVOID)StartingAddress);
- ASSERT(Vad->StartingVpn == MemoryArea->StartingVpn);
- ASSERT(Vad->EndingVpn == MemoryArea->EndingVpn);
+ ASSERT(Vad->StartingVpn == MemoryArea->VadNode.StartingVpn);
+ ASSERT(Vad->EndingVpn == MemoryArea->VadNode.EndingVpn);
Vad->EndingVpn = (StartingAddress - 1) >> PAGE_SHIFT;
- MemoryArea->EndingVpn = Vad->EndingVpn;
+ MemoryArea->VadNode.EndingVpn = Vad->EndingVpn;
}
else
{
Modified: trunk/reactos/ntoskrnl/mm/marea.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=75…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] Fri Aug 18 07:13:34 2017
@@ -169,13 +169,11 @@
{
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
- marea->VadNode.StartingVpn = marea->StartingVpn;
- marea->VadNode.EndingVpn = marea->EndingVpn;
marea->VadNode.u.VadFlags.Spare = 1;
marea->VadNode.u.VadFlags.Protection = MiMakeProtectionMask(marea->Protect);
/* Build a lame VAD if this is a user-space allocation */
- if (marea->EndingVpn + 1 < (ULONG_PTR)MmSystemRangeStart >> PAGE_SHIFT)
+ if (marea->VadNode.EndingVpn + 1 < (ULONG_PTR)MmSystemRangeStart >>
PAGE_SHIFT)
{
ASSERT(Process != NULL);
if (marea->Type != MEMORY_AREA_OWNED_BY_ARM3)
@@ -354,7 +352,7 @@
//if (MemoryArea->VadNode.StartingVpn < (ULONG_PTR)MmSystemRangeStart
>> PAGE_SHIFT
if (MemoryArea->Vad)
{
- ASSERT(MemoryArea->EndingVpn + 1 < (ULONG_PTR)MmSystemRangeStart
>> PAGE_SHIFT);
+ ASSERT(MemoryArea->VadNode.EndingVpn + 1 <
(ULONG_PTR)MmSystemRangeStart >> PAGE_SHIFT);
ASSERT(MemoryArea->Type == MEMORY_AREA_SECTION_VIEW || MemoryArea->Type
== MEMORY_AREA_CACHE);
/* MmCleanProcessAddressSpace might have removed it (and this would be
MmDeleteProcessAdressSpace) */
@@ -470,8 +468,8 @@
return STATUS_NO_MEMORY;
}
- MemoryArea->StartingVpn = (ULONG_PTR)*BaseAddress >> PAGE_SHIFT;
- MemoryArea->EndingVpn = ((ULONG_PTR)*BaseAddress + tmpLength - 1) >>
PAGE_SHIFT;
+ MemoryArea->VadNode.StartingVpn = (ULONG_PTR)*BaseAddress >>
PAGE_SHIFT;
+ MemoryArea->VadNode.EndingVpn = ((ULONG_PTR)*BaseAddress + tmpLength - 1)
>> PAGE_SHIFT;
MmInsertMemoryArea(AddressSpace, MemoryArea);
}
else
@@ -508,8 +506,8 @@
}
}
- MemoryArea->StartingVpn = (ULONG_PTR)*BaseAddress >> PAGE_SHIFT;
- MemoryArea->EndingVpn = ((ULONG_PTR)*BaseAddress + tmpLength - 1) >>
PAGE_SHIFT;
+ MemoryArea->VadNode.StartingVpn = (ULONG_PTR)*BaseAddress >>
PAGE_SHIFT;
+ MemoryArea->VadNode.EndingVpn = ((ULONG_PTR)*BaseAddress + tmpLength - 1)
>> PAGE_SHIFT;
MmInsertMemoryArea(AddressSpace, MemoryArea);
}