summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/MemoryInitPei
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-09-09 14:48:25 +0000
committerabiesheuvel <abiesheuvel@Edk2>2015-09-09 14:48:25 +0000
commit984ec7588d569cc35dcbdd3c45a86088c4366eeb (patch)
tree9e8b2131036b1e3d968ecc1658949c96060c0eef /ArmPlatformPkg/MemoryInitPei
parent8483681426b5a33e9d186758c47def0f1fcd86e2 (diff)
downloadedk2-platforms-984ec7588d569cc35dcbdd3c45a86088c4366eeb.tar.xz
ArmPlatformPkg/MemoryInitPeim: handle memory above 4 GB on 32-bit ARM
Make sure that the PEI memory region is carved out of memory that is 32-bit addressable, by taking MAX_ADDRESS into account (which is defined as '4 GB - 1' on ARM) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18426 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/MemoryInitPei')
-rwxr-xr-xArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
index 93ab16ca4a..25baac170c 100755
--- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
+++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
@@ -96,7 +96,7 @@ InitializeMemory (
{
EFI_STATUS Status;
UINTN SystemMemoryBase;
- UINTN SystemMemoryTop;
+ UINT64 SystemMemoryTop;
UINTN FdBase;
UINTN FdTop;
UINTN UefiMemoryBase;
@@ -115,7 +115,10 @@ InitializeMemory (
ASSERT (PcdGet64 (PcdSystemMemorySize) != 0);
SystemMemoryBase = (UINTN)PcdGet64 (PcdSystemMemoryBase);
- SystemMemoryTop = SystemMemoryBase + (UINTN)PcdGet64 (PcdSystemMemorySize);
+ SystemMemoryTop = SystemMemoryBase + PcdGet64 (PcdSystemMemorySize);
+ if (SystemMemoryTop - 1 > MAX_ADDRESS) {
+ SystemMemoryTop = (UINT64)MAX_ADDRESS + 1;
+ }
FdBase = (UINTN)PcdGet64 (PcdFdBaseAddress);
FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize);