clarify the purpose of this project
[nyanglibc.git] / rt / aio_notify.shared.s
blob32946747726ea1eb9cee2a74b6e5e1143a439fe8
1 .text
2 .p2align 4,,15
3 .type notify_func_wrapper, @function
4 notify_func_wrapper:
5 pushq %r12
6 pushq %rbp
7 pushq %rbx
8 movq %rdi, %rbx
9 addq $-128, %rsp
10 movq %rsp, %rbp
11 movq %rbp, %rdi
12 call sigemptyset@PLT
13 movl $8, %r10d
14 xorl %edx, %edx
15 movq %rbp, %rsi
16 movl $2, %edi
17 movl $14, %eax
18 #APP
19 # 34 "../sysdeps/unix/sysv/linux/aio_misc.h" 1
20 syscall
22 # 0 "" 2
23 #NO_APP
24 movq 8(%rbx), %r12
25 movq %rbx, %rdi
26 movq (%rbx), %rbp
27 call free@PLT
28 movq %r12, %rdi
29 call *%rbp
30 subq $-128, %rsp
31 xorl %eax, %eax
32 popq %rbx
33 popq %rbp
34 popq %r12
35 ret
36 .size notify_func_wrapper, .-notify_func_wrapper
37 .p2align 4,,15
38 .globl __aio_notify_only
39 .hidden __aio_notify_only
40 .type __aio_notify_only, @function
41 __aio_notify_only:
42 pushq %r12
43 pushq %rbp
44 pushq %rbx
45 movq %rdi, %rbx
46 subq $80, %rsp
47 movl 12(%rdi), %edx
48 cmpl $2, %edx
49 je .L14
50 xorl %eax, %eax
51 testl %edx, %edx
52 jne .L4
53 call getpid@PLT
54 movl 8(%rbx), %edi
55 movq (%rbx), %rsi
56 movl %eax, %edx
57 call __aio_sigqueue
58 sarl $31, %eax
59 .L4:
60 addq $80, %rsp
61 popq %rbx
62 popq %rbp
63 popq %r12
64 ret
65 .p2align 4,,10
66 .p2align 3
67 .L14:
68 movq 24(%rdi), %r12
69 testq %r12, %r12
70 je .L15
71 .L6:
72 movl $16, %edi
73 call malloc@PLT
74 movq %rax, %rbp
75 movl $-1, %eax
76 testq %rbp, %rbp
77 je .L4
78 movq 16(%rbx), %rax
79 leaq notify_func_wrapper(%rip), %rdx
80 leaq 8(%rsp), %rdi
81 movq %rbp, %rcx
82 movq %r12, %rsi
83 movq %rax, 0(%rbp)
84 movq (%rbx), %rax
85 movq %rax, 8(%rbp)
86 call pthread_create@PLT
87 movl %eax, %edx
88 xorl %eax, %eax
89 testl %edx, %edx
90 jns .L4
91 movq %rbp, %rdi
92 call free@PLT
93 movl $-1, %eax
94 jmp .L4
95 .p2align 4,,10
96 .p2align 3
97 .L15:
98 leaq 16(%rsp), %r12
99 movq %r12, %rdi
100 call pthread_attr_init@PLT
101 movl $1, %esi
102 movq %r12, %rdi
103 call pthread_attr_setdetachstate@PLT
104 jmp .L6
105 .size __aio_notify_only, .-__aio_notify_only
106 .section .rodata.str1.8,"aMS",@progbits,1
107 .align 8
108 .LC0:
109 .string "The futex facility returned an unexpected error code.\n"
110 .text
111 .p2align 4,,15
112 .globl __aio_notify
113 .hidden __aio_notify
114 .type __aio_notify, @function
115 __aio_notify:
116 pushq %r13
117 pushq %r12
118 pushq %rbp
119 pushq %rbx
120 movq %rdi, %rbx
121 subq $8, %rsp
122 movq 40(%rdi), %rbp
123 leaq 32(%rbp), %rdi
124 call __aio_notify_only
125 testl %eax, %eax
126 je .L17
127 movq errno@gottpoff(%rip), %rax
128 movq $-1, 120(%rbp)
129 movl %fs:(%rax), %eax
130 movl %eax, 112(%rbp)
131 .L17:
132 movq 48(%rbx), %rbx
133 testq %rbx, %rbx
134 je .L16
135 movl $202, %r12d
136 jmp .L25
137 .p2align 4,,10
138 .p2align 3
139 .L19:
140 subl $1, (%rcx)
141 je .L37
142 .L22:
143 testq %r13, %r13
144 movq %r13, %rbx
145 je .L16
146 .L25:
147 movq 24(%rbx), %rdi
148 movq (%rbx), %r13
149 movq 16(%rbx), %rcx
150 testq %rdi, %rdi
151 jne .L19
152 movq 8(%rbx), %rax
153 testq %rax, %rax
154 je .L20
155 cmpq $-1, 120(%rbp)
156 jne .L20
157 movl $-1, (%rax)
158 .L20:
159 movl (%rcx), %eax
160 testl %eax, %eax
161 je .L22
162 subl $1, (%rcx)
163 jne .L22
164 xorl %r10d, %r10d
165 movl $1, %edx
166 movl $129, %esi
167 movq %rcx, %rdi
168 movl %r12d, %eax
169 #APP
170 # 209 "../sysdeps/nptl/futex-internal.h" 1
171 syscall
173 # 0 "" 2
174 #NO_APP
175 cmpq $-4096, %rax
176 jbe .L22
177 cmpl $-22, %eax
178 je .L22
179 cmpl $-14, %eax
180 je .L22
181 leaq .LC0(%rip), %rdi
182 call __libc_fatal@PLT
183 .p2align 4,,10
184 .p2align 3
185 .L37:
186 call __aio_notify_only
187 movq 16(%rbx), %rdi
188 movq %r13, %rbx
189 call free@PLT
190 testq %r13, %r13
191 jne .L25
192 .L16:
193 addq $8, %rsp
194 popq %rbx
195 popq %rbp
196 popq %r12
197 popq %r13
199 .size __aio_notify, .-__aio_notify
200 .hidden __aio_sigqueue