// );\r
ASM_FUNC(ArmPlatformStackSet)\r
// Save parameters\r
- mov x6, x3\r
- mov x5, x2\r
- mov x4, x1\r
- mov x3, x0\r
+ mov x26, x3\r
+ mov x25, x2\r
+ mov x24, x1\r
+ mov x23, x0\r
\r
// Save the Link register\r
- mov x7, x30\r
+ mov x27, x30\r
\r
// Identify Stack\r
mov x0, x1\r
cmp x0, #1\r
\r
// Restore parameters\r
- mov x0, x3\r
- mov x1, x4\r
- mov x2, x5\r
- mov x3, x6\r
+ mov x0, x23\r
+ mov x1, x24\r
+ mov x2, x25\r
+ mov x3, x26\r
\r
// Restore the Link register\r
- mov x30, x7\r
+ mov x30, x27\r
\r
b.ne 0f\r
\r
// IN UINTN SecondaryStackSize\r
// );\r
ASM_FUNC(ArmPlatformStackSetPrimary)\r
- // Save the Link register\r
- mov x4, x30\r
-\r
- // Add stack of primary stack to StackBase\r
+ // Add size of primary stack to StackBase\r
add x0, x0, x2\r
\r
// Compute SecondaryCoresCount * SecondaryCoreStackSize\r
// Set Primary Stack ((StackBase + PrimaryStackSize) + (SecondaryCoresCount * SecondaryCoreStackSize))\r
add sp, x0, x3\r
\r
- br x4\r
+ ret\r
\r
//VOID\r
//ArmPlatformStackSetSecondary (\r
// );\r
ASM_FUNC(ArmPlatformStackSetSecondary)\r
// Save the Link register\r
- mov x4, x30\r
+ mov x24, x30\r
mov sp, x0\r
\r
// Get Core Position\r
mov x0, x1\r
bl ASM_PFX(ArmPlatformGetCorePosition)\r
- mov x5, x0\r
+ mov x25, x0\r
\r
// Get Primary Core Position\r
bl ASM_PFX(ArmPlatformGetPrimaryCoreMpId)\r
bl ASM_PFX(ArmPlatformGetCorePosition)\r
\r
// Get Secondary Core Position. We should get consecutive secondary stack number from 1...(CoreCount-1)\r
- cmp x5, x0\r
- b.ls 1f\r
+ cmp x25, x0\r
+\r
// Decrement the position if after the primary core\r
- sub x5, x5, #1\r
-1:\r
- add x5, x5, #1\r
+ cinc x25, x25, ls\r
\r
// Compute top of the secondary stack\r
- mul x3, x3, x5\r
+ mul x3, x3, x25\r
\r
// Set stack\r
add sp, sp, x3\r
\r
- br x4\r
+ ret x24\r