\r
IMPORT CEntryPoint\r
IMPORT ArmReadMpidr\r
- IMPORT ArmIsMpCore\r
+ IMPORT ArmPlatformStackSet\r
+ \r
EXPORT _ModuleEntryPoint\r
\r
PRESERVE8\r
// r1 = The top of the Mpcore Stacks\r
// Stack for the primary core = PrimaryCoreStack\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
- sub r7, r1, r2\r
-\r
- // Stack for the secondary core = Number of Clusters * (4 Cores per cluster) * SecondaryStackSize\r
- LoadConstantToReg (FixedPcdGet32(PcdClusterCount), r2)\r
- lsl r2, r2, #2\r
+ sub r8, r1, r2\r
+\r
+ // Stack for the secondary core = Number of Cores - 1\r
+ LoadConstantToReg (FixedPcdGet32(PcdCoreCount), r0)\r
+ sub r0, r0, #1\r
+ LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r1)\r
+ mul r1, r1, r0\r
+ sub r8, r8, r1\r
+\r
+ // r8 = The base of the MpCore Stacks (primary stack & secondary stacks)\r
+ mov r0, r8\r
+ mov r1, r6\r
+ //ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize)\r
+ LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3)\r
mul r2, r2, r3\r
sub r7, r7, r2\r