summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2015-06-06 21:52:46 +0000
committerandrew <andrew@FreeBSD.org>2015-06-06 21:52:46 +0000
commitd7364a04aecc67f4cb8e17e16bd5edfaabbcb6e6 (patch)
tree6da62dd686f0c0ac270d2c8778ebcff129ff0073
parent80c10f52a759803aa35d99950f595630276dcce9 (diff)
downloadFreeBSD-src-d7364a04aecc67f4cb8e17e16bd5edfaabbcb6e6.zip
FreeBSD-src-d7364a04aecc67f4cb8e17e16bd5edfaabbcb6e6.tar.gz
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.
-rw-r--r--sys/arm64/arm64/exception.S21
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S
index efb1364..9568075 100644
--- a/sys/arm64/arm64/exception.S
+++ b/sys/arm64/arm64/exception.S
@@ -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
OpenPOWER on IntegriCloud