]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/PrePeiCore/Arm/PrePeiCoreEntryPoint.asm
ARM Packages: Replaced the macro GetCorePositionFromMpId() by the ArmPlatformGetCoreP...
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / Arm / PrePeiCoreEntryPoint.asm
index 3b756b492a565d21f185237954ad2dc1a2828749..1510fb84d03936c0ae28139309a3a064a42e8ded 100644 (file)
@@ -19,6 +19,7 @@
   INCLUDE AsmMacroIoLib.inc\r
   \r
   IMPORT  CEntryPoint\r
+  IMPORT  ArmPlatformGetCorePosition\r
   IMPORT  ArmPlatformIsPrimaryCore\r
   IMPORT  ArmReadMpidr\r
   EXPORT  _ModuleEntryPoint\r
@@ -49,8 +50,10 @@ _ModuleEntryPoint
 _SetupSecondaryCoreStack\r
   // r1 contains the base of the secondary stacks\r
 \r
-  // Get the Core Position (ClusterId * 4) + CoreId\r
-  GetCorePositionFromMpId(r0, r5, r2)\r
+  // Get the Core Position\r
+  mov   r6, r1      // Save base of the secondary stacks\r
+  mov   r0, r5\r
+  bl    ArmPlatformGetCorePosition\r
   // The stack starts at the top of the stack region. Add '1' to the Core Position to get the top of the stack\r
   add   r0, r0, #1\r
 \r
@@ -58,7 +61,7 @@ _SetupSecondaryCoreStack
   LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r2)\r
   mul   r0, r0, r2\r
   // SP = StackBase + StackOffset\r
-  add   sp, r1, r0\r
+  add   sp, r6, r0\r
 \r
 _PrepareArguments\r
   // The PEI Core Entry Point has been computed by GenFV and stored in the second entry of the Reset Vector\r