From d6607d8b3000188cd7f0d6cbb9372ec69ad9ae8d Mon Sep 17 00:00:00 2001 From: Andrei Warkentin Date: Thu, 5 Mar 2020 07:55:58 +0000 Subject: [PATCH] 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 --- ArmPlatformPkg/PrePi/PrePi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.2