mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-30 04:13:33 +00:00
[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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user