diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -42,7 +42,6 @@ */ .macro save_registers_head el .if \el == 1 - mov x18, sp stp x0, x1, [sp, #-(TF_SIZE - TF_X + 128)]! .else stp x0, x1, [sp, #-(TF_SIZE - TF_X)]! @@ -61,7 +60,9 @@ stp x24, x25, [sp, #(24 * 8)] stp x26, x27, [sp, #(26 * 8)] stp x28, x29, [sp, #(28 * 8)] -.if \el == 0 +.if \el == 1 + add x18, sp, #(TF_SIZE - TF_X + 128) +.else mrs x18, sp_el0 .endif mrs x10, elr_el1