summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/PrePi/PrePi.c
diff options
context:
space:
mode:
authorOlivier Martin <Olivier.Martin@arm.com>2015-07-06 16:56:31 +0000
committeroliviermartin <oliviermartin@Edk2>2015-07-06 16:56:31 +0000
commit5dbacdb21b59748e885c2eccae370b81271ab795 (patch)
tree69f477c94ae7e754ab9214a222134e9d07c4ae89 /ArmPlatformPkg/PrePi/PrePi.c
parent40a3f38f67cee7046feb5a5666883cc75a6962ff (diff)
downloadedk2-platforms-5dbacdb21b59748e885c2eccae370b81271ab795.tar.xz
ArmPlatformPkg/PrePi: Make dynamic the top of the System Memory
This change allows to change the top of the System Memory that was hardcoded by: FixedPcdGet64 (PcdSystemMemoryBase) + FixedPcdGet64 (PcdSystemMemorySize) It allows to add support when the Trusted Firmware reserves the top of the System Memory as Trusted. The size of this region might not be known in advance. Note: The reason why the start of the System Memory has not been made dynamic is because the early code calculates where to place the stack from the top of the System Memory. So there is no need to make the start of the System Memory a dynamic value at the early stage of the boot phase. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17835 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/PrePi/PrePi.c')
-rwxr-xr-xArmPlatformPkg/PrePi/PrePi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
index 9a5e067ef5..99afe6fa90 100755
--- a/ArmPlatformPkg/PrePi/PrePi.c
+++ b/ArmPlatformPkg/PrePi/PrePi.c
@@ -30,7 +30,7 @@
#include "PrePi.h"
#include "LzmaDecompress.h"
-#define IS_XIP() (((UINT32)FixedPcdGet32 (PcdFdBaseAddress) > (UINT32)(FixedPcdGet64 (PcdSystemMemoryBase) + FixedPcdGet32 (PcdSystemMemorySize))) || \
+#define IS_XIP() (((UINT32)FixedPcdGet32 (PcdFdBaseAddress) > mSystemMemoryEnd) || \
((FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) < FixedPcdGet64 (PcdSystemMemoryBase)))
// Not used when PrePi in run in XIP mode
@@ -109,7 +109,7 @@ PrePiMain (
// If ensure the FD is either part of the System Memory or totally outside of the System Memory (XIP)
ASSERT (IS_XIP() ||
((FixedPcdGet32 (PcdFdBaseAddress) >= FixedPcdGet64 (PcdSystemMemoryBase)) &&
- ((UINT32)(FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) <= (UINT32)(FixedPcdGet64 (PcdSystemMemoryBase) + FixedPcdGet64 (PcdSystemMemorySize)))));
+ ((UINT32)(FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) <= (UINT32)mSystemMemoryEnd)));
// Initialize the architecture specific bits
ArchInitialize ();