]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/PrePeiCore/Arm/PrePeiCoreEntryPoint.S
ARM Packages: Replaced the macro GetCorePositionFromMpId() by the ArmPlatformGetCoreP...
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / Arm / PrePeiCoreEntryPoint.S
index 1fb8570eb397c9399dabe037243de03118f54545..3b463eabee35150985fde70392a9956332ddc60d 100644 (file)
@@ -20,6 +20,7 @@
 .align 3\r
 \r
 GCC_ASM_IMPORT(CEntryPoint)\r
+GCC_ASM_IMPORT(ArmPlatformGetCorePosition)\r
 GCC_ASM_IMPORT(ArmPlatformIsPrimaryCore)\r
 GCC_ASM_IMPORT(ArmReadMpidr)\r
 GCC_ASM_EXPORT(_ModuleEntryPoint)\r
@@ -47,8 +48,10 @@ ASM_PFX(_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    ASM_PFX(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
@@ -56,7 +59,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