X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPlatformPkg%2FPrePeiCore%2FAArch64%2FPrePeiCoreEntryPoint.S;h=9e2e49d62fa3726ef17b33f58d7cf107c13a96cd;hp=34bf3a4e68318d29058c751338e0ce22b2339d92;hb=0bcf71c13c8ce9ad254da901420badb74420a6df;hpb=91673dfdfe78906023f07e585002689e8baf654e diff --git a/ArmPlatformPkg/PrePeiCore/AArch64/PrePeiCoreEntryPoint.S b/ArmPlatformPkg/PrePeiCore/AArch64/PrePeiCoreEntryPoint.S index 34bf3a4e68..9e2e49d62f 100644 --- a/ArmPlatformPkg/PrePeiCore/AArch64/PrePeiCoreEntryPoint.S +++ b/ArmPlatformPkg/PrePeiCore/AArch64/PrePeiCoreEntryPoint.S @@ -12,23 +12,8 @@ // #include -#include -#include -#include -.text -.align 3 - -GCC_ASM_IMPORT(CEntryPoint) -GCC_ASM_IMPORT(ArmPlatformGetCorePosition) -GCC_ASM_IMPORT(ArmPlatformIsPrimaryCore) -GCC_ASM_IMPORT(ArmReadMpidr) -GCC_ASM_IMPORT(ArmPlatformPeiBootAction) -GCC_ASM_EXPORT(_ModuleEntryPoint) - -StartupAddr: .8byte CEntryPoint - -ASM_PFX(_ModuleEntryPoint): +ASM_FUNC(_ModuleEntryPoint) // Do early platform specific actions bl ASM_PFX(ArmPlatformPeiBootAction) @@ -60,9 +45,7 @@ ASM_PFX(MainEntryPoint): bl ASM_PFX(ArmPlatformIsPrimaryCore) // Get the top of the primary stacks (and the base of the secondary stacks) - LoadConstantToReg (FixedPcdGet64(PcdCPUCoresStackBase), x1) - LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), x2) - add x1, x1, x2 + MOV64 (x1, FixedPcdGet64(PcdCPUCoresStackBase) + FixedPcdGet32(PcdCPUCorePrimaryStackSize)) // x0 is equal to 1 if I am the primary core cmp x0, #1 @@ -79,20 +62,22 @@ _SetupSecondaryCoreStack: add x0, x0, #1 // StackOffset = CorePos * StackSize - LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), x2) + MOV32 (x2, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)) mul x0, x0, x2 // SP = StackBase + StackOffset add sp, x6, x0 _PrepareArguments: // The PEI Core Entry Point has been computed by GenFV and stored in the second entry of the Reset Vector - LoadConstantToReg (FixedPcdGet64(PcdFvBaseAddress), x2) - add x2, x2, #8 - ldr x1, [x2] + MOV64 (x2, FixedPcdGet64(PcdFvBaseAddress)) + ldr x1, [x2, #8] // Move sec startup address into a data register // Ensure we're jumping to FV version of the code (not boot remapped alias) - ldr x3, StartupAddr + ldr x3, =ASM_PFX(CEntryPoint) + + // Set the frame pointer to NULL so any backtraces terminate here + mov x29, xzr // Jump to PrePeiCore C code // x0 = mp_id @@ -102,4 +87,10 @@ _PrepareArguments: _SetupPrimaryCoreStack: mov sp, x1 + MOV64 (x8, FixedPcdGet64 (PcdCPUCoresStackBase)) + MOV64 (x9, FixedPcdGet32 (PcdInitValueInTempStack) |\ + FixedPcdGet32 (PcdInitValueInTempStack) << 32) +0:stp x9, x9, [x8], #16 + cmp x8, x1 + b.lt 0b b _PrepareArguments