clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_cancel.s
blob99a0373e394e6f9fd7a90980150e93a69d6c26ef
1 .text
2 #APP
3 .globl __pthread_create
4 #NO_APP
5 .p2align 4,,15
6 .globl __pthread_cancel
7 .type __pthread_cancel, @function
8 __pthread_cancel:
9 movl 720(%rdi), %eax
10 testl %eax, %eax
11 jle .L8
12 leaq 776(%rdi), %rcx
13 .L3:
14 movl 776(%rdi), %eax
15 movl %eax, %edx
16 orl $12, %edx
17 cmpl %edx, %eax
18 je .L13
19 movl %edx, %esi
20 andl $-69, %esi
21 cmpl $10, %esi
22 je .L18
23 #APP
24 # 82 "pthread_cancel.c" 1
25 movl $1,%fs:24
26 # 0 "" 2
27 #NO_APP
28 movq __libc_multiple_threads_ptr(%rip), %rsi
29 movl $1, (%rsi)
30 movl $1, __pthread_multiple_threads(%rip)
31 lock cmpxchgl %edx, (%rcx)
32 jne .L3
33 .L13:
34 xorl %eax, %eax
35 ret
36 .p2align 4,,10
37 .p2align 3
38 .L18:
39 movl %eax, %edx
40 orl $4, %edx
41 lock cmpxchgl %edx, (%rcx)
42 jne .L3
43 pushq %rbx
44 movq %rdi, %rbx
45 call __getpid@PLT
46 movl 720(%rbx), %esi
47 movl %eax, %edi
48 movl $32, %edx
49 movl $234, %eax
50 #APP
51 # 70 "pthread_cancel.c" 1
52 syscall
54 # 0 "" 2
55 #NO_APP
56 cmpl $-4096, %eax
57 jbe .L7
58 negl %eax
59 popq %rbx
60 ret
61 .p2align 4,,10
62 .p2align 3
63 .L7:
64 xorl %eax, %eax
65 popq %rbx
66 ret
67 .p2align 4,,10
68 .p2align 3
69 .L8:
70 movl $3, %eax
71 ret
72 .size __pthread_cancel, .-__pthread_cancel
73 .weak pthread_cancel
74 .set pthread_cancel,__pthread_cancel