clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_cancel.shared.s
blobc06e2d2921b3e702fd3b22c3103edeb38845da2c
1 .text
2 .p2align 4,,15
3 .globl __pthread_cancel
4 .type __pthread_cancel, @function
5 __pthread_cancel:
6 movl 720(%rdi), %eax
7 testl %eax, %eax
8 jle .L8
9 pushq %rbx
10 movq %rdi, %rbx
11 call pthread_cancel_init
12 leaq 776(%rbx), %rcx
13 .L3:
14 movl 776(%rbx), %eax
15 movl %eax, %edx
16 orl $12, %edx
17 cmpl %edx, %eax
18 je .L7
19 movl %edx, %esi
20 andl $-69, %esi
21 cmpl $10, %esi
22 je .L17
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 .L7:
34 xorl %eax, %eax
35 popq %rbx
36 ret
37 .p2align 4,,10
38 .p2align 3
39 .L17:
40 movl %eax, %edx
41 orl $4, %edx
42 lock cmpxchgl %edx, (%rcx)
43 jne .L3
44 call __getpid@PLT
45 movl 720(%rbx), %esi
46 movl %eax, %edi
47 movl $32, %edx
48 movl $234, %eax
49 #APP
50 # 70 "pthread_cancel.c" 1
51 syscall
53 # 0 "" 2
54 #NO_APP
55 cmpl $-4096, %eax
56 jbe .L7
57 negl %eax
58 popq %rbx
59 ret
60 .p2align 4,,10
61 .p2align 3
62 .L8:
63 movl $3, %eax
64 ret
65 .size __pthread_cancel, .-__pthread_cancel
66 .weak pthread_cancel
67 .set pthread_cancel,__pthread_cancel
68 .hidden __pthread_multiple_threads
69 .hidden __libc_multiple_threads_ptr
70 .hidden pthread_cancel_init