summaryrefslogtreecommitdiff
path: root/arch/sparc64/kernel/utrap.S
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-28 00:47:20 -0700
committerDavid S. Miller <davem@davemloft.net>2008-04-28 00:47:20 -0700
commit6eda3a75928a3dc1072dfffd228ab818869d83ad (patch)
tree56e44907f23134273fe383424c69df4d62c6544c /arch/sparc64/kernel/utrap.S
parent194f1a68b93e959ede6ec363db4714e630bdbb6a (diff)
sparc64: Split entry.S up into seperate files.
entry.S was a hodge-podge of several totally unrelated sets of assembler routines, ranging from FPU trap handlers to hypervisor call functions. Split it up into topic-sized pieces. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/utrap.S')
-rw-r--r--arch/sparc64/kernel/utrap.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/utrap.S b/arch/sparc64/kernel/utrap.S
new file mode 100644
index 000000000000..b7f0f3f3a909
--- /dev/null
+++ b/arch/sparc64/kernel/utrap.S
@@ -0,0 +1,29 @@
+ .globl utrap_trap
+ .type utrap_trap,#function
+utrap_trap: /* %g3=handler,%g4=level */
+ TRAP_LOAD_THREAD_REG(%g6, %g1)
+ ldx [%g6 + TI_UTRAPS], %g1
+ brnz,pt %g1, invoke_utrap
+ nop
+
+ ba,pt %xcc, etrap
+ rd %pc, %g7
+ mov %l4, %o1
+ call bad_trap
+ add %sp, PTREGS_OFF, %o0
+ ba,pt %xcc, rtrap
+ nop
+
+invoke_utrap:
+ sllx %g3, 3, %g3
+ ldx [%g1 + %g3], %g1
+ save %sp, -128, %sp
+ rdpr %tstate, %l6
+ rdpr %cwp, %l7
+ andn %l6, TSTATE_CWP, %l6
+ wrpr %l6, %l7, %tstate
+ rdpr %tpc, %l6
+ rdpr %tnpc, %l7
+ wrpr %g1, 0, %tnpc
+ done
+ .size utrap_trap,.-utrap_trap