]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/MemoryInitPeim: take MAX_ALLOC_ADDRESS into account
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 7 Dec 2018 10:59:51 +0000 (11:59 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 20 Dec 2018 10:02:30 +0000 (11:02 +0100)
Limit the PEI memory region so it will not extend beyond what we can
address architecturally when running with 4 KB pages.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c

index 389a2e6f1abdc19553a074abbc81c3954c292068..010f93add76b234fc17a078db2f6a3344e996cdd 100644 (file)
@@ -105,12 +105,12 @@ InitializeMemory (
 \r
   // Ensure PcdSystemMemorySize has been set\r
   ASSERT (PcdGet64 (PcdSystemMemorySize) != 0);\r
-  ASSERT (PcdGet64 (PcdSystemMemoryBase) < (UINT64)MAX_ADDRESS);\r
+  ASSERT (PcdGet64 (PcdSystemMemoryBase) < (UINT64)MAX_ALLOC_ADDRESS);\r
 \r
   SystemMemoryBase = (UINTN)PcdGet64 (PcdSystemMemoryBase);\r
   SystemMemoryTop = SystemMemoryBase + PcdGet64 (PcdSystemMemorySize);\r
-  if (SystemMemoryTop - 1 > MAX_ADDRESS) {\r
-    SystemMemoryTop = (UINT64)MAX_ADDRESS + 1;\r
+  if (SystemMemoryTop - 1 > MAX_ALLOC_ADDRESS) {\r
+    SystemMemoryTop = (UINT64)MAX_ALLOC_ADDRESS + 1;\r
   }\r
   FdBase = (UINTN)PcdGet64 (PcdFdBaseAddress);\r
   FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize);\r