INCLUDE AsmMacroIoLib.inc\r
\r
IMPORT CEntryPoint\r
+ IMPORT ArmReadMpidr\r
EXPORT _ModuleEntryPoint\r
\r
PRESERVE8\r
StartupAddr DCD CEntryPoint\r
\r
_ModuleEntryPoint\r
- // Identify CPU ID\r
- mrc p15, 0, r0, c0, c0, 5\r
- and r0, #0xf\r
+ // Get ID of this CPU in Multicore system\r
+ bl ArmReadMpidr\r
+ LoadConstantToReg (FixedPcdGet32(PcdArmPrimaryCoreMask), r1)\r
+ and r5, r0, r1\r
\r
_SetSVCMode\r
// Enter SVC mode\r
ldr r2, StartupAddr\r
\r
// Jump to PrePiCore C code\r
- // r0 = core_id\r
+ // r0 = MpId\r
// r1 = UefiMemoryBase\r
blx r2\r
\r