From: Andrei Warkentin Date: Thu, 5 Mar 2020 07:55:58 +0000 (+0000) Subject: ArmPlatformPkg/PrePi: fix IS_XIP X-Git-Tag: edk2-stable202005~337 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=d6607d8b3000188cd7f0d6cbb9372ec69ad9ae8d ArmPlatformPkg/PrePi: fix IS_XIP This wasn't correctly testing for FD to be outside RAM, when RAM base immediately follows the FD. This is part of some cleanup for RPi4 in edk2-platform. Signed-off-by: Andrei Warkentin Reviewed-by: Ard Biesheuvel --- diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c index 2bb1449581..74284f1883 100644 --- a/ArmPlatformPkg/PrePi/PrePi.c +++ b/ArmPlatformPkg/PrePi/PrePi.c @@ -22,7 +22,7 @@ #include "PrePi.h" #define IS_XIP() (((UINT64)FixedPcdGet64 (PcdFdBaseAddress) > mSystemMemoryEnd) || \ - ((FixedPcdGet64 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) < FixedPcdGet64 (PcdSystemMemoryBase))) + ((FixedPcdGet64 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) <= FixedPcdGet64 (PcdSystemMemoryBase))) UINT64 mSystemMemoryEnd = FixedPcdGet64(PcdSystemMemoryBase) + FixedPcdGet64(PcdSystemMemorySize) - 1;