X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPlatformPkg%2FPrePeiCore%2FAArch64%2FPrePeiCoreEntryPoint.S;h=9e2e49d62fa3726ef17b33f58d7cf107c13a96cd;hp=b84190cf3fd48fd9d028b9c4950fc406ea07d33c;hb=0bcf71c13c8ce9ad254da901420badb74420a6df;hpb=f8a9910c9bee387c143029c95524bc3d3286ae55 diff --git a/ArmPlatformPkg/PrePeiCore/AArch64/PrePeiCoreEntryPoint.S b/ArmPlatformPkg/PrePeiCore/AArch64/PrePeiCoreEntryPoint.S index b84190cf3f..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 (FixedPcdGet32(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 @@ -101,10 +86,11 @@ _PrepareArguments: blr x3 _SetupPrimaryCoreStack: - // x1 contains the top of the primary stack - LoadConstantToReg (FixedPcdGet32(PcdPeiGlobalVariableSize), x2) - - // The reserved space for global variable must be 16-bytes aligned for pushing - // 128-bit variable on the stack - SetPrimaryStack (x1, x2, x3, x4) + 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