1 /* $NetBSD: ptrace.S,v 1.1 2014/09/03 19:34:26 matt Exp $ */
6 #if defined(LIBC_SCCS) && !defined(lint)
7 __RCSID("$NetBSD: ptrace.S,v 1.1 2014/09/03 19:34:26 matt Exp $")
8 #endif /* LIBC_SCCS && !lint */
10 #define XCALLFRAME_LR (-1*4)
11 #define XCALLFRAME_DATA (-2*4)
12 #define XCALLFRAME_ADDR (-3*4)
13 #define XCALLFRAME_PID (-4*4)
14 #define XCALLFRAME_REQUEST (-5*4)
15 #define XCALLFRAME_GP (-6*4)
16 #define XCALLFRAME_SP (-7*4)
17 #define XCALLFRAMELEN (-XCALLFRAME_SP)
21 l.sw XCALLFRAME_LR(r1),lr
22 l.sw XCALLFRAME_REQUEST(r1),r3
23 l.sw XCALLFRAME_PID(r1),r4
24 l.sw XCALLFRAME_ADDR(r1),r5
25 l.sw XCALLFRAME_DATA(r1),r6
28 l.sw XCALLFRAME_GP(r1),r16
32 l.addi r1,r1,-XCALLFRAMELEN
33 l.jal PLT(_C_LABEL(__errno))
36 l.addi r1,r1,XCALLFRAMELEN
39 l.lwz r16,XCALLFRAME_GP(r1)
42 l.lwz r6,XCALLFRAME_DATA(r1)
43 l.lwz r4,XCALLFRAME_PID(r1)
44 l.lwz r5,XCALLFRAME_ADDR(r1)
45 l.lwz r3,XCALLFRAME_REQUEST(r1)
46 l.lwz lr,XCALLFRAME_LR(r1)
51 lwz r7,_C_LABEL(errno)@got(r7)
54 l.movhi r7,hi(_C_LABEL(errno))
55 l.ori r7,r7,lo(_C_LABEL(errno))
57 #endif /* _REENTRANT */
60 l.bf _C_LABEL(__cerror)