Skip restoring more registers when returning from an exception taken in

the kernel. These registers are all callee saved, and as such will be
restored before returning to the exception handler.

Userland still needs these registers to be restored as they may be changed
by the kernel and we don't currently track these places.
This commit is contained in:
andrew 2015-12-14 10:06:01 +00:00
parent 123d7ec9f3
commit e716cf7cfe

View File

@ -90,15 +90,19 @@ __FBSDID("$FreeBSD$");
ldp x14, x15, [sp, #(TF_X + 14 * 8)] ldp x14, x15, [sp, #(TF_X + 14 * 8)]
ldp x16, x17, [sp, #(TF_X + 16 * 8)] ldp x16, x17, [sp, #(TF_X + 16 * 8)]
.if \el == 0 .if \el == 0
/*
* We only restore the callee saved registers when returning to
* userland as they may have been updated by a system call or signal.
*/
ldp x18, x19, [sp, #(TF_X + 18 * 8)] ldp x18, x19, [sp, #(TF_X + 18 * 8)]
.else
ldr x19, [sp, #(TF_X + 19 * 8)]
.endif
ldp x20, x21, [sp, #(TF_X + 20 * 8)] ldp x20, x21, [sp, #(TF_X + 20 * 8)]
ldp x22, x23, [sp, #(TF_X + 22 * 8)] ldp x22, x23, [sp, #(TF_X + 22 * 8)]
ldp x24, x25, [sp, #(TF_X + 24 * 8)] ldp x24, x25, [sp, #(TF_X + 24 * 8)]
ldp x26, x27, [sp, #(TF_X + 26 * 8)] ldp x26, x27, [sp, #(TF_X + 26 * 8)]
ldp x28, x29, [sp, #(TF_X + 28 * 8)] ldp x28, x29, [sp, #(TF_X + 28 * 8)]
.else
ldr x29, [sp, #(TF_X + 29 * 8)]
.endif
.if \el == 0 .if \el == 0
add sp, sp, #(TF_SIZE + 16) add sp, sp, #(TF_SIZE + 16)
.else .else