diff options
Diffstat (limited to 'ArmPlatformPkg/MemoryInitPei')
-rwxr-xr-x | ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c index 93ab16c..25baac1 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);
|