svn commit: r284103 - head/sys/arm64/arm64
Andrew Turner
andrew at FreeBSD.org
Sat Jun 6 21:52:47 UTC 2015
Author: andrew
Date: Sat Jun 6 21:52:46 2015
New Revision: 284103
URL: https://svnweb.freebsd.org/changeset/base/284103
Log:
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.
Modified:
head/sys/arm64/arm64/exception.S
Modified: head/sys/arm64/arm64/exception.S
==============================================================================
--- head/sys/arm64/arm64/exception.S Sat Jun 6 21:11:17 2015 (r284102)
+++ head/sys/arm64/arm64/exception.S Sat Jun 6 21:52:46 2015 (r284103)
@@ -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
More information about the svn-src-all
mailing list