utils_asm: Save/restore CYC_OVRD register

This keeps the previous WFI setting instead of unconditionally flipping
to 3 then back to 2.

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2023-04-18 21:03:57 +09:00
parent b067f26971
commit 8cf0df0553

View file

@ -153,7 +153,11 @@ put_simd_state:
.globl deep_wfi
.type deep_wfi, @function
deep_wfi:
str x30, [sp, #-16]!
mrs x0, SYS_IMP_APL_CYC_OVRD
orr x1, x0, #(3L << 24)
msr SYS_IMP_APL_CYC_OVRD, x1
stp x30, x0, [sp, #-16]!
stp x28, x29, [sp, #-16]!
stp x26, x27, [sp, #-16]!
stp x24, x25, [sp, #-16]!
@ -161,22 +165,16 @@ deep_wfi:
stp x20, x21, [sp, #-16]!
stp x18, x19, [sp, #-16]!
mrs x0, SYS_IMP_APL_CYC_OVRD
orr x0, x0, #(3L << 24)
msr SYS_IMP_APL_CYC_OVRD, x0
wfi
mrs x0, SYS_IMP_APL_CYC_OVRD
bic x0, x0, #(1L << 24)
msr SYS_IMP_APL_CYC_OVRD, x0
ldp x18, x19, [sp], #16
ldp x20, x21, [sp], #16
ldp x22, x23, [sp], #16
ldp x24, x25, [sp], #16
ldp x26, x27, [sp], #16
ldp x28, x29, [sp], #16
ldr x30, [sp], #16
ldp x30, x0, [sp], #16
msr SYS_IMP_APL_CYC_OVRD, x0
ret