\r
_SetSVCMode\r
// Enter SVC mode, Disable FIQ and IRQ\r
- mov r1, #0x13|0x80|0x40\r
+ mov r1, #0x13 :OR: 0x80 :OR: 0x40\r
msr CPSR_c, r1\r
\r
// Check if we can install the stack at the top of the System Memory or if we need\r
LoadConstantToReg (FixedPcdGet32(PcdFdBaseAddress), r2)\r
LoadConstantToReg (FixedPcdGet32(PcdFdSize), r3)\r
sub r3, r3, #1\r
- add r3, r3, r2 // r4 = FdTop = PcdFdBaseAddress + PcdFdSize\r
+ add r3, r3, r2 // r3 = FdTop = PcdFdBaseAddress + PcdFdSize\r
\r
// UEFI Memory Size (stacks are allocated in this region)\r
LoadConstantToReg (FixedPcdGet32(PcdSystemMemoryUefiRegionSize), r4)\r
// Stack for the primary core = PrimaryCoreStack\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
sub r7, r1, r2\r
- // Stack for the secondary core = Number of Cluster * (4 Core per cluster) * SecondaryStackSize\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
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3)\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
add r1, r7, r2\r
\r
- // r7 = The base of the MpCore Stacks\r
+ // r7 = The base of the MpCore Stacks (primary stack + cluster_count * 4 * secondary stacks)\r
// r1 = The base of the secondary Stacks = Top of the Primary stack\r
\r
// Is it the Primary Core ?\r
// r1 = The base of the secondary Stacks\r
\r
// Get the position of the cores (ClusterId * 4) + CoreId\r
- GetCorePositionInStack(r0, r5, r4)\r
+ GetCorePositionFromMpId(r0, r5, r4)\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
// Get the offset for the Secondary Stack\r