]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/PrePeiCore/AArch64/PrePeiCoreEntryPoint.S
ArmPlatformPkg: clear frame pointer in startup code
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / AArch64 / PrePeiCoreEntryPoint.S
index aab5edab0c4224b3b424550c698136e8fb450ec5..9e2e49d62fa3726ef17b33f58d7cf107c13a96cd 100644 (file)
@@ -76,6 +76,9 @@ _PrepareArguments:
   // Ensure we're jumping to FV version of the code (not boot remapped alias)\r
   ldr   x3, =ASM_PFX(CEntryPoint)\r
 \r
+  // Set the frame pointer to NULL so any backtraces terminate here\r
+  mov   x29, xzr\r
+\r
   // Jump to PrePeiCore C code\r
   //    x0 = mp_id\r
   //    x1 = pei_core_address\r
@@ -84,4 +87,10 @@ _PrepareArguments:
 \r
 _SetupPrimaryCoreStack:\r
   mov   sp, x1\r
+  MOV64 (x8, FixedPcdGet64 (PcdCPUCoresStackBase))\r
+  MOV64 (x9, FixedPcdGet32 (PcdInitValueInTempStack) |\\r
+             FixedPcdGet32 (PcdInitValueInTempStack) << 32)\r
+0:stp   x9, x9, [x8], #16\r
+  cmp   x8, x1\r
+  b.lt  0b\r
   b     _PrepareArguments\r