Remove building with NOCRYPTO option
[minix3.git] / lib / libc / arch / or1k / sys / ptrace.S
blob56da80edc7b55c33c70c3cbea49fce5e1226976a
1 /*      $NetBSD: ptrace.S,v 1.1 2014/09/03 19:34:26 matt Exp $  */
3 #include "SYS.h"
4 #include "assym.h"
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)
19 ENTRY(ptrace)
20 #ifdef _REENTRANT
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
27 #ifdef __PIC__
28         l.sw    XCALLFRAME_GP(r1),r16
29         PIC_GOTSETUP(r16)
30 #endif
32         l.addi  r1,r1,-XCALLFRAMELEN
33         l.jal   PLT(_C_LABEL(__errno))
34         l.nop
35         l.sw    0(r11),r0
36         l.addi  r1,r1,XCALLFRAMELEN
38 #ifdef __PIC__
39         l.lwz   r16,XCALLFRAME_GP(r1)
40 #endif
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)
47 #else
48 #ifdef __PIC__
49         l.or    r8,r9,r0
50         PIC_GOTSETUP(r7)
51         lwz     r7,_C_LABEL(errno)@got(r7)
52         l.or    r9,r8,r0
53 #else
54         l.movhi r7,hi(_C_LABEL(errno))
55         l.ori   r7,r7,lo(_C_LABEL(errno))
56 #endif /* __PIC__ */
57 #endif /* _REENTRANT */
58         l.sw    0(r7),r0
59         _DOSYSCALL(ptrace)
60         l.bf    _C_LABEL(__cerror)
61         l.nop
62         l.jr    lr
63         l.nop
64 END(ptrace)