Rework exception entry to help with DTrace. We now store the stack pointer

before adjusting it to store any registers. This is needed as DTrace may
need to adjust the kernel stack pointer, and previously the new stack
pointer would have needed to be checked incase it was changed.
This commit is contained in:
Andrew Turner 2015-06-06 21:52:46 +00:00
parent 42d3029556
commit 284743a867

View file

@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$");
.text
.macro save_registers el
.if \el == 1
mov x18, sp
.endif
stp x28, x29, [sp, #-16]!
stp x26, x27, [sp, #-16]!
stp x24, x25, [sp, #-16]!
@ -51,22 +54,20 @@ __FBSDID("$FreeBSD$");
mrs x10, elr_el1
mrs x11, spsr_el1
.if \el == 0
mrs x12, sp_el0
.else
mov x12, sp
mrs x18, sp_el0
.endif
stp x10, x11, [sp, #-16]!
stp x12, lr, [sp, #-16]!
stp x18, lr, [sp, #-16]!
mrs x18, tpidr_el1
.endm
.macro restore_registers el
ldp x12, lr, [sp], #16
msr daifset, #2 /* Disable interrupts, x18 may change
* in the interrupt exception handler */
ldp x18, lr, [sp], #16
ldp x10, x11, [sp], #16
.if \el == 0
msr sp_el0, x12
.else
mov sp, x12
msr sp_el0, x18
.endif
msr spsr_el1, x11
msr elr_el1, x10
@ -89,6 +90,10 @@ __FBSDID("$FreeBSD$");
ldp x24, x25, [sp], #16
ldp x26, x27, [sp], #16
ldp x28, x29, [sp], #16
.if \el == 1
mov sp, x18
mrs x18, tpidr_el1
.endif
.endm
.macro do_ast