ArmPlatformPkg/Sec: Simplify SetupExceptionLevel1() using a tail call

Avoid a call and use a jump instead, so that the LR value does not
need to be recorded in a different register. This is generally neater,
but it also avoids potential confusion in the debugger, given that no
frame record is created for this call.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
Ard Biesheuvel
2025-05-27 17:19:46 +02:00
committed by mergify[bot]
parent 81549ad5e5
commit 9cd4328f5e

View File

@@ -12,12 +12,8 @@
// Setup EL1 while in EL1
ASM_FUNC(SetupExceptionLevel1)
mov x5, x30 // Save LR
mov x0, #CPACR_DEFAULT
bl ASM_PFX(ArmWriteCpacr) // Enable architectural features
ret x5
b ASM_PFX(ArmWriteCpacr) // Tail call
// Setup EL2 while in EL2
ASM_FUNC(SetupExceptionLevel2)