]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c
ArmPkg/ArmPkg.dec: Redefined PcdSystemMemory(Base|Size) as UINT64
[mirror_edk2.git] / ArmPlatformPkg / Library / ArmPlatformGlobalVariableLib / PrePi / PrePiArmPlatformGlobalVariableLib.c
index 47430e302b99b55c41b175e7363a9ae6a0054d50..02cbb00daf479f5b7e4376dca02c69328b08f3a4 100644 (file)
@@ -19,8 +19,8 @@
 #include <Library/PcdLib.h>\r
 #include <Library/DebugLib.h>\r
 \r
-#define IS_XIP() (((UINT32)PcdGet32 (PcdFdBaseAddress) > (UINT32)(PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize))) || \\r
-                  ((PcdGet32 (PcdFdBaseAddress) + PcdGet32 (PcdFdSize)) < PcdGet32 (PcdSystemMemoryBase)))\r
+#define IS_XIP() (((UINT32)PcdGet32 (PcdFdBaseAddress) > (UINT32)(PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize))) || \\r
+                  ((PcdGet32 (PcdFdBaseAddress) + PcdGet32 (PcdFdSize)) < PcdGet64 (PcdSystemMemoryBase)))\r
 \r
 // Declared by ArmPlatformPkg/PrePi Module\r
 extern UINTN mGlobalVariableBase;\r
@@ -40,7 +40,7 @@ ArmPlatformGetGlobalVariable (
   if (IS_XIP()) {\r
     // In Case of XIP, we expect the Primary Stack at the top of the System Memory\r
     // The size must be 64bit aligned to allow 64bit variable to be aligned\r
-    GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);\r
+    GlobalVariableBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);\r
   } else {\r
     GlobalVariableBase = mGlobalVariableBase;\r
   }\r
@@ -69,7 +69,7 @@ ArmPlatformSetGlobalVariable (
   if (IS_XIP()) {\r
     // In Case of XIP, we expect the Primary Stack at the top of the System Memory\r
     // The size must be 64bit aligned to allow 64bit variable to be aligned\r
-    GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);\r
+    GlobalVariableBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);\r
   } else {\r
     GlobalVariableBase = mGlobalVariableBase;\r
   }\r
@@ -96,7 +96,7 @@ ArmPlatformGetGlobalVariableAddress (
   if (IS_XIP()) {\r
     // In Case of XIP, we expect the Primary Stack at the top of the System Memory\r
     // The size must be 64bit aligned to allow 64bit variable to be aligned\r
-    GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);\r
+    GlobalVariableBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);\r
   } else {\r
     GlobalVariableBase = mGlobalVariableBase;\r
   }\r