[NTOS]: Fix 4MB assumptions and use PDE_MAPPED_VA instead, which accurately describes the address space mapped by a PDE (which is different on PAE, x64, ARM, etc).

svn path=/trunk/; revision=47175
This commit is contained in:
Sir Richard
2010-05-12 18:42:05 +00:00
parent 944fe46d70
commit 291fb765f3
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -339,7 +339,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
MmNonPagedSystemStart = (PVOID)((ULONG_PTR)MmNonPagedPoolStart -
(MmNumberOfSystemPtes + 1) * PAGE_SIZE);
MmNonPagedSystemStart = (PVOID)((ULONG_PTR)MmNonPagedSystemStart &
~((4 * 1024 * 1024) - 1));
~(PDE_MAPPED_VA - 1));
//
// Don't let it go below the minimum
@@ -387,7 +387,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
//
MmPfnDatabase[0] = (PVOID)0xB0000000;
MmPfnDatabase[1] = &MmPfnDatabase[0][MmHighestPhysicalPage];
ASSERT(((ULONG_PTR)MmPfnDatabase[0] & ((4 * 1024 * 1024) - 1)) == 0);
ASSERT(((ULONG_PTR)MmPfnDatabase[0] & (PDE_MAPPED_VA - 1)) == 0);
//
// Non paged pool comes after the PFN database
+2 -2
View File
@@ -1725,8 +1725,8 @@ MmArmInitSystem(IN ULONG Phase,
//
MmBootImageSize = KeLoaderBlock->Extension->LoaderPagesSpanned;
MmBootImageSize *= PAGE_SIZE;
MmBootImageSize = (MmBootImageSize + (4 * 1024 * 1024) - 1) & ~((4 * 1024 * 1024) - 1);
ASSERT((MmBootImageSize % (4 * 1024 * 1024)) == 0);
MmBootImageSize = (MmBootImageSize + PDE_MAPPED_VA - 1) & ~(PDE_MAPPED_VA - 1);
ASSERT((MmBootImageSize % PDE_MAPPED_VA) == 0);
//
// Set the size of session view, pool, and image