]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/PrePi/PrePi.c
MdeModulePkg/Bds: Fix a bug that may causes S4 fails to resume
[mirror_edk2.git] / ArmPlatformPkg / PrePi / PrePi.c
index b563b5ee3a8f6009cecbb3fd907366a7e7d6f3ed..e548ccace09730b78851b987d7b902a5bb7a84c5 100644 (file)
 #include "PrePi.h"\r
 #include "LzmaDecompress.h"\r
 \r
-#define IS_XIP() (((UINT32)FixedPcdGet32 (PcdFdBaseAddress) > mSystemMemoryEnd) || \\r
-                  ((FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) < FixedPcdGet64 (PcdSystemMemoryBase)))\r
+#define IS_XIP() (((UINT64)FixedPcdGet64 (PcdFdBaseAddress) > mSystemMemoryEnd) || \\r
+                  ((FixedPcdGet64 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) < FixedPcdGet64 (PcdSystemMemoryBase)))\r
+\r
+UINT64 mSystemMemoryEnd = FixedPcdGet64(PcdSystemMemoryBase) +\r
+                          FixedPcdGet64(PcdSystemMemorySize) - 1;\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -86,8 +89,8 @@ PrePiMain (
 \r
   // If ensure the FD is either part of the System Memory or totally outside of the System Memory (XIP)\r
   ASSERT (IS_XIP() ||\r
-          ((FixedPcdGet32 (PcdFdBaseAddress) >= FixedPcdGet64 (PcdSystemMemoryBase)) &&\r
-           ((UINT32)(FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) <= (UINT32)mSystemMemoryEnd)));\r
+          ((FixedPcdGet64 (PcdFdBaseAddress) >= FixedPcdGet64 (PcdSystemMemoryBase)) &&\r
+           ((UINT64)(FixedPcdGet64 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) <= (UINT64)mSystemMemoryEnd)));\r
 \r
   // Initialize the architecture specific bits\r
   ArchInitialize ();\r
@@ -183,8 +186,6 @@ CEntryPoint (
 {\r
   UINT64   StartTimeStamp;\r
 \r
-  ASSERT(!ArmIsMpCore() || (PcdGet32 (PcdCoreCount) > 1));\r
-\r
   // Initialize the platform specific controllers\r
   ArmPlatformInitialize (MpId);\r
 \r