]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/PrePi/PrePi.c
ARM Packages: Rename PcdNormal* into Pcd* PCDs
[mirror_edk2.git] / ArmPlatformPkg / PrePi / PrePi.c
index 7fe6fc36fa1ed91f94af2adbd5a4d2976653a21a..64c371c8037d12641cdb6aac3f3df260c3370653 100755 (executable)
@@ -15,6 +15,7 @@
 #include <PiPei.h>\r
 \r
 #include <Library/DebugAgentLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
 #include <Library/PrePiLib.h>\r
 #include <Library/IoLib.h>\r
 #include <Library/PrintLib.h>\r
@@ -78,7 +79,6 @@ PrePiMain (
   SaveAndSetDebugTimerInterrupt (TRUE);\r
 \r
   UefiMemoryTop = UefiMemoryBase + FixedPcdGet32 (PcdSystemMemoryUefiRegionSize);\r
-  StacksSize = PcdGet32 (PcdCPUCoresNonSecStackSize) * PcdGet32 (PcdMPCoreMaxCores);\r
   StacksBase = UefiMemoryTop - StacksSize;\r
 \r
   // Check the PcdCPUCoresNonSecStackBase match with the calculated StackBase\r
@@ -98,6 +98,7 @@ PrePiMain (
   ASSERT_EFI_ERROR (Status);\r
 \r
   // Create the Stacks HOB (reserve the memory for all stacks)\r
+  StacksSize = PcdGet32 (PcdCPUCorePrimaryStackSize) + (FixedPcdGet32(PcdClusterCount) * 4 * FixedPcdGet32(PcdCPUCoreSecondaryStackSize));\r
   BuildStackHob (StacksBase, StacksSize);\r
 \r
   // Set the Boot Mode\r
@@ -135,13 +136,13 @@ PrePiMain (
 \r
 VOID\r
 CEntryPoint (\r
-  IN  UINTN                     CoreId,\r
+  IN  UINTN                     MpId,\r
   IN  UINTN                     UefiMemoryBase\r
   )\r
 {\r
   UINT64   StartTimeStamp;\r
  \r
-  if ((CoreId == ARM_PRIMARY_CORE) && PerformanceMeasurementEnabled ()) {\r
+  if (IS_PRIMARY_CORE(MpId) && PerformanceMeasurementEnabled ()) {\r
     // Initialize the Timer Library to setup the Timer HW controller\r
     TimerConstructor ();\r
     // We cannot call yet the PerformanceLib because the HOB List has not been initialized\r
@@ -167,11 +168,11 @@ CEntryPoint (
   ArmWriteVBar ((UINT32)PrePiVectorTable);\r
 \r
   // If not primary Jump to Secondary Main\r
-  if (CoreId == ARM_PRIMARY_CORE) {\r
+  if (IS_PRIMARY_CORE(MpId)) {\r
     // Goto primary Main.\r
     PrimaryMain (UefiMemoryBase, StartTimeStamp);\r
   } else {\r
-    SecondaryMain (CoreId);\r
+    SecondaryMain (MpId);\r
   }\r
 \r
   // DXE Core should always load and never return\r