clarify the purpose of this project
[nyanglibc.git] / misc / ptrace.shared.s
blob616122fb4d2efe396a29c983ee63312414dd7269
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl ptrace
9 .type ptrace, @function
10 ptrace:
11 leaq 8(%rsp), %rax
12 leal -1(%rdi), %r8d
13 movq %rsi, -40(%rsp)
14 movq %rdx, -32(%rsp)
15 movq %rcx, -24(%rsp)
16 leaq -80(%rsp), %r10
17 movq %rax, -64(%rsp)
18 leaq -48(%rsp), %rax
19 cmpl $3, %r8d
20 movl 8(%rax), %esi
21 movq 16(%rax), %rdx
22 movq %rax, -56(%rsp)
23 cmovnb 24(%rax), %r10
24 movl $101, %eax
25 movl $24, -72(%rsp)
26 #APP
27 # 45 "../sysdeps/unix/sysv/linux/ptrace.c" 1
28 syscall
30 # 0 "" 2
31 #NO_APP
32 cmpq $-4096, %rax
33 ja .L16
34 testq %rax, %rax
35 js .L1
36 cmpl $2, %r8d
37 jbe .L17
38 .L1:
39 rep ret
40 .p2align 4,,10
41 .p2align 3
42 .L17:
43 movq __libc_errno@gottpoff(%rip), %rax
44 movl $0, %fs:(%rax)
45 movq -80(%rsp), %rax
46 ret
47 .p2align 4,,10
48 .p2align 3
49 .L16:
50 movq __libc_errno@gottpoff(%rip), %rdx
51 negl %eax
52 movl %eax, %fs:(%rdx)
53 movq $-1, %rax
54 ret
55 .size ptrace, .-ptrace