https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3c585d0e3879a8d445c04dd038158d88a98c3292

commit 3c585d0e3879a8d445c04dd038158d88a98c3292
Author:     Vadim Galyant <[email protected]>
AuthorDate: Fri Jan 24 09:29:40 2020 +0900
Commit:     Thomas Faber <[email protected]>
CommitDate: Mon Apr 6 11:16:34 2020 +0200

    [NTOS:MM] Since the _MMPTE_SUBSECTION structure for x86 (without PAE) uses 
the SubsectionAddressLow truncated by the least significant three bits, the 
_CONTROL_AREA, _LARGE_CONTROL_AREA, _SUBSECTION, _MSUBSECTION structures must 
be 8-byte aligned.
    Corresponding checks in MmArmInitSystem() have been removed.
---
 ntoskrnl/mm/ARM3/mminit.c | 4 ----
 sdk/include/ndk/mmtypes.h | 8 ++++++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ntoskrnl/mm/ARM3/mminit.c b/ntoskrnl/mm/ARM3/mminit.c
index bcccc0c5a5e..b83588a4cca 100644
--- a/ntoskrnl/mm/ARM3/mminit.c
+++ b/ntoskrnl/mm/ARM3/mminit.c
@@ -2298,10 +2298,6 @@ MmArmInitSystem(IN ULONG Phase,
         MiInitMachineDependent(LoaderBlock);
 
 #if DBG
-        /* The subection PTE format depends on things being 8-byte aligned */
-        ASSERT((sizeof(CONTROL_AREA) % 8) == 0);
-        ASSERT((sizeof(SUBSECTION) % 8) == 0);
-
         /* Prototype PTEs are assumed to be in paged pool, so check if the 
math works */
         PointerPte = (PMMPTE)MmPagedPoolStart;
         MI_MAKE_PROTOTYPE_PTE(&TempPte, PointerPte);
diff --git a/sdk/include/ndk/mmtypes.h b/sdk/include/ndk/mmtypes.h
index 5c271938320..a19b5f1ee60 100644
--- a/sdk/include/ndk/mmtypes.h
+++ b/sdk/include/ndk/mmtypes.h
@@ -505,7 +505,7 @@ typedef struct _MMSUBSECTION_FLAGS2
 } MMSUBSECTION_FLAGS2;
 
 //
-// Control Area Structures
+// Control Area Structures (8-byte aligned)
 //
 typedef struct _CONTROL_AREA
 {
@@ -528,6 +528,7 @@ typedef struct _CONTROL_AREA
     ULONG WritableUserReferences;
     ULONG QuadwordPad;
 } CONTROL_AREA, *PCONTROL_AREA;
+C_ASSERT((sizeof(CONTROL_AREA) % 8) == 0);
 
 typedef struct _LARGE_CONTROL_AREA
 {
@@ -553,9 +554,10 @@ typedef struct _LARGE_CONTROL_AREA
     LIST_ENTRY UserGlobalList;
     ULONG SessionId;
 } LARGE_CONTROL_AREA, *PLARGE_CONTROL_AREA;
+C_ASSERT((sizeof(LARGE_CONTROL_AREA) % 8) == 0);
 
 //
-// Subsection and Mapped Subsection
+// Subsection and Mapped Subsection (8-byte aligned)
 //
 typedef struct _SUBSECTION
 {
@@ -572,6 +574,7 @@ typedef struct _SUBSECTION
     ULONG PtesInSubsection;
     struct _SUBSECTION *NextSubsection;
 } SUBSECTION, *PSUBSECTION;
+C_ASSERT((sizeof(SUBSECTION) % 8) == 0);
 
 typedef struct _MSUBSECTION
 {
@@ -595,6 +598,7 @@ typedef struct _MSUBSECTION
         MMSUBSECTION_FLAGS2 SubsectionFlags2;
     } u2;
 } MSUBSECTION, *PMSUBSECTION;
+C_ASSERT((sizeof(MSUBSECTION) % 8) == 0);
 
 //
 // Segment Object

Reply via email to