blob: c731e8023d3e7c6333ae091f39ca76aedf332603 [file] [log] [blame]
David S. Miller6eda3a72008-04-28 00:47:20 -07001 .globl utrap_trap
2 .type utrap_trap,#function
3utrap_trap: /* %g3=handler,%g4=level */
4 TRAP_LOAD_THREAD_REG(%g6, %g1)
5 ldx [%g6 + TI_UTRAPS], %g1
6 brnz,pt %g1, invoke_utrap
7 nop
8
9 ba,pt %xcc, etrap
10 rd %pc, %g7
11 mov %l4, %o1
12 call bad_trap
13 add %sp, PTREGS_OFF, %o0
David S. Miller49fa5232016-04-27 17:27:37 -040014 ba,a,pt %xcc, rtrap
David S. Miller6eda3a72008-04-28 00:47:20 -070015
16invoke_utrap:
17 sllx %g3, 3, %g3
18 ldx [%g1 + %g3], %g1
19 save %sp, -128, %sp
20 rdpr %tstate, %l6
21 rdpr %cwp, %l7
22 andn %l6, TSTATE_CWP, %l6
23 wrpr %l6, %l7, %tstate
24 rdpr %tpc, %l6
25 rdpr %tnpc, %l7
26 wrpr %g1, 0, %tnpc
27 done
28 .size utrap_trap,.-utrap_trap