\r
GCC_ASM_IMPORT(CEntryPoint)\r
GCC_ASM_IMPORT(ArmReadMpidr)\r
-GCC_ASM_IMPORT(ArmIsMPCore)\r
+GCC_ASM_IMPORT(ArmIsMpCore)\r
GCC_ASM_EXPORT(_ModuleEntryPoint)\r
\r
StartupAddr: .word CEntryPoint\r
add r1, r1, r2 // r1 = SystemMemoryTop = PcdSystemMemoryBase + PcdSystemMemorySize\r
\r
// Calculate Top of the Firmware Device\r
- LoadConstantToReg (FixedPcdGet32(PcdNormalFdBaseAddress), r2)\r
- LoadConstantToReg (FixedPcdGet32(PcdNormalFdSize), r3)\r
- add r3, r3, r2 // r4 = FdTop = PcdNormalFdBaseAddress + PcdNormalFdSize\r
+ LoadConstantToReg (FixedPcdGet32(PcdFdBaseAddress), r2)\r
+ LoadConstantToReg (FixedPcdGet32(PcdFdSize), r3)\r
+ add r3, r3, r2 // r4 = FdTop = PcdFdBaseAddress + PcdFdSize\r
\r
// UEFI Memory Size (stacks are allocated in this region)\r
LoadConstantToReg (FixedPcdGet32(PcdSystemMemoryUefiRegionSize), r4)\r
_GetStackBase:\r
// Compute Base of Normal stacks for CPU Cores\r
// Is it MpCore system\r
- bl ArmIsMPCore\r
+ bl ASM_PFX(ArmIsMpCore)\r
cmp r0, #0\r
// Case it is not an MP Core system. Just setup the primary core\r
beq _SetupUnicoreStack\r
\r
\r
_PrepareArguments:\r
+ mov r0, r5\r
+ mov r1, r6\r
+ mov r2, r7\r
+ mov r3, sp\r
+\r
// Move sec startup address into a data register\r
// Ensure we're jumping to FV version of the code (not boot remapped alias)\r
- ldr r2, StartupAddr\r
+ ldr r4, StartupAddr\r
\r
// Jump to PrePiCore C code\r
// r0 = MpId\r
// r1 = UefiMemoryBase\r
- blx r2\r
+ // r2 = StacksBase\r
+ // r3 = GlobalVariableBase\r
+ blx r4\r
\r
_NeverReturn:\r
b _NeverReturn\r