clarify the purpose of this project
[nyanglibc.git] / rt / librt-cancellation.s
blob14bc44c83588449e7a23d4bb6b7126bd03f4f089
1 .text
2 .p2align 4,,15
3 .globl __librt_enable_asynccancel
4 .type __librt_enable_asynccancel, @function
5 __librt_enable_asynccancel:
6 movq %fs:16, %rsi
7 #APP
8 # 35 "../nptl/cancellation.c" 1
9 movl %fs:776,%edx
10 # 0 "" 2
11 #NO_APP
12 .L3:
13 movl %edx, %ecx
14 orl $2, %ecx
15 cmpl %ecx, %edx
16 je .L1
17 movl %edx, %eax
18 lock cmpxchgl %ecx, 776(%rsi)
19 cmpl %eax, %edx
20 jne .L5
21 andl $-69, %ecx
22 cmpl $10, %ecx
23 je .L10
24 .L1:
25 movl %edx, %eax
26 ret
27 .p2align 4,,10
28 .p2align 3
29 .L5:
30 movl %eax, %edx
31 jmp .L3
32 .L10:
33 subq $8, %rsp
34 #APP
35 # 50 "../nptl/cancellation.c" 1
36 movq $-1,%fs:1584
37 # 0 "" 2
38 #NO_APP
39 movq %fs:16, %rax
40 #APP
41 # 304 "../nptl/pthreadP.h" 1
42 lock;orl $16, 776(%rax)
43 # 0 "" 2
44 # 307 "../nptl/pthreadP.h" 1
45 movq %fs:768,%rdi
46 # 0 "" 2
47 #NO_APP
48 call __pthread_unwind@PLT
49 .size __librt_enable_asynccancel, .-__librt_enable_asynccancel
50 .section .rodata.str1.8,"aMS",@progbits,1
51 .align 8
52 .LC0:
53 .string "The futex facility returned an unexpected error code.\n"
54 .text
55 .p2align 4,,15
56 .globl __librt_disable_asynccancel
57 .type __librt_disable_asynccancel, @function
58 __librt_disable_asynccancel:
59 andl $2, %edi
60 jne .L21
61 #APP
62 # 78 "../nptl/cancellation.c" 1
63 movl %fs:776,%ecx
64 # 0 "" 2
65 #NO_APP
66 movq %fs:16, %rax
67 leaq 776(%rax), %r8
68 .L13:
69 movl %ecx, %edx
70 movl %ecx, %eax
71 andl $-3, %edx
72 lock cmpxchgl %edx, (%r8)
73 cmpl %eax, %ecx
74 jne .L17
75 andl $12, %ecx
76 cmpl $4, %ecx
77 je .L24
78 .L21:
79 rep ret
80 .p2align 4,,10
81 .p2align 3
82 .L24:
83 pushq %rbx
84 movl $202, %r9d
85 movl $1, %ebx
86 .L16:
87 xorl %r10d, %r10d
88 movl $128, %esi
89 movq %r8, %rdi
90 movl %r9d, %eax
91 #APP
92 # 146 "../sysdeps/nptl/futex-internal.h" 1
93 syscall
95 # 0 "" 2
96 #NO_APP
97 cmpq $-4096, %rax
98 ja .L25
99 .L14:
100 #APP
101 # 102 "../nptl/cancellation.c" 1
102 movl %fs:776,%edx
103 # 0 "" 2
104 #NO_APP
105 movl %edx, %eax
106 andl $12, %eax
107 cmpl $4, %eax
108 je .L16
109 popq %rbx
111 .p2align 4,,10
112 .p2align 3
113 .L17:
114 movl %eax, %ecx
115 jmp .L13
116 .L25:
117 leal 11(%rax), %ecx
118 cmpl $11, %ecx
119 ja .L15
120 movq %rbx, %rax
121 salq %cl, %rax
122 testl $2177, %eax
123 jne .L14
124 .L15:
125 leaq .LC0(%rip), %rdi
126 call __libc_fatal@PLT
127 .size __librt_disable_asynccancel, .-__librt_disable_asynccancel
128 .weak __pthread_unwind