Skip to content

Commit 8cf0df0

Browse files
committed
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 <[email protected]>
1 parent b067f26 commit 8cf0df0

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/utils_asm.S

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,30 +153,28 @@ put_simd_state:
153153
.globl deep_wfi
154154
.type deep_wfi, @function
155155
deep_wfi:
156-
str x30, [sp, #-16]!
156+
mrs x0, SYS_IMP_APL_CYC_OVRD
157+
orr x1, x0, #(3L << 24)
158+
msr SYS_IMP_APL_CYC_OVRD, x1
159+
160+
stp x30, x0, [sp, #-16]!
157161
stp x28, x29, [sp, #-16]!
158162
stp x26, x27, [sp, #-16]!
159163
stp x24, x25, [sp, #-16]!
160164
stp x22, x23, [sp, #-16]!
161165
stp x20, x21, [sp, #-16]!
162166
stp x18, x19, [sp, #-16]!
163167

164-
mrs x0, SYS_IMP_APL_CYC_OVRD
165-
orr x0, x0, #(3L << 24)
166-
msr SYS_IMP_APL_CYC_OVRD, x0
167-
168168
wfi
169169

170-
mrs x0, SYS_IMP_APL_CYC_OVRD
171-
bic x0, x0, #(1L << 24)
172-
msr SYS_IMP_APL_CYC_OVRD, x0
173-
174170
ldp x18, x19, [sp], #16
175171
ldp x20, x21, [sp], #16
176172
ldp x22, x23, [sp], #16
177173
ldp x24, x25, [sp], #16
178174
ldp x26, x27, [sp], #16
179175
ldp x28, x29, [sp], #16
180-
ldr x30, [sp], #16
176+
ldp x30, x0, [sp], #16
177+
178+
msr SYS_IMP_APL_CYC_OVRD, x0
181179

182180
ret

0 commit comments

Comments
 (0)