summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Library
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-01 23:41:52 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-01 23:41:52 +0000
commit99565b88c1bdeae4836aab78db9c08e9511e4adc (patch)
treefccd1cf6143872a7214e385cfa3b46c2cd688eb2 /ArmPlatformPkg/Library
parent513aa3497afd3b84f6f20ed53a18534cb72b2180 (diff)
downloadedk2-platforms-99565b88c1bdeae4836aab78db9c08e9511e4adc.tar.xz
ArmPlatform/PrePi: Fixed PrePi for MP Cores platform and Global Variable region settings
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12638 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Library')
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c
index 3d050bd150..37b337bff2 100644
--- a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c
+++ b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c
@@ -18,7 +18,7 @@
#include <Library/BaseMemoryLib.h>
#include <Library/PcdLib.h>
-#define IS_XIP() ((PcdGet32 (PcdFdBaseAddress) > (PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize))) || \
+#define IS_XIP() (((UINT32)PcdGet32 (PcdFdBaseAddress) > (UINT32)(PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize))) || \
((PcdGet32 (PcdFdBaseAddress) + PcdGet32 (PcdFdSize)) < PcdGet32 (PcdSystemMemoryBase)))
// Declared by ArmPlatformPkg/PrePi Module
@@ -35,7 +35,8 @@ ArmPlatformGetGlobalVariable (
if (IS_XIP()) {
// In Case of XIP, we expect the Primary Stack at the top of the System Memory
- GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - PcdGet32 (PcdPeiGlobalVariableSize);
+ // The size must be 64bit aligned to allow 64bit variable to be aligned
+ GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
} else {
GlobalVariableBase = mGlobalVariableBase;
}
@@ -60,7 +61,8 @@ ArmPlatformSetGlobalVariable (
if (IS_XIP()) {
// In Case of XIP, we expect the Primary Stack at the top of the System Memory
- GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - PcdGet32 (PcdPeiGlobalVariableSize);
+ // The size must be 64bit aligned to allow 64bit variable to be aligned
+ GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
} else {
GlobalVariableBase = mGlobalVariableBase;
}