clarify the purpose of this project
[nyanglibc.git] / rt / aio_suspend.shared.s
blobcf547a19803fc0ecd7584a4a879f192eab797628
1 .text
2 .section .rodata.str1.8,"aMS",@progbits,1
3 .align 8
4 .LC0:
5 .string "../sysdeps/pthread/aio_suspend.c"
6 .align 8
7 .LC1:
8 .string "status == 0 || status == EAGAIN"
9 .text
10 .p2align 4,,15
11 .type do_aio_misc_wait, @function
12 do_aio_misc_wait:
13 .LFB89:
14 pushq %r13
15 pushq %r12
16 pushq %rbp
17 pushq %rbx
18 xorl %ebp, %ebp
19 subq $8, %rsp
20 movl (%rdi), %ebx
21 testl %ebx, %ebx
22 jne .L22
23 addq $8, %rsp
24 movl %ebp, %eax
25 popq %rbx
26 popq %rbp
27 popq %r12
28 popq %r13
29 ret
30 .p2align 4,,10
31 .p2align 3
32 .L22:
33 movq %rdi, %r12
34 leaq __aio_requests_mutex(%rip), %rdi
35 movq %rsi, %r13
36 call pthread_mutex_unlock@PLT
37 jmp .L4
38 .p2align 4,,10
39 .p2align 3
40 .L24:
41 movl (%r12), %ebx
42 testl %ebx, %ebx
43 je .L23
44 .L4:
45 xorl %r8d, %r8d
46 movq %r13, %rcx
47 movl $1, %edx
48 movl %ebx, %esi
49 movq %r12, %rdi
50 call __futex_abstimed_wait_cancelable64@PLT
51 cmpl $11, %eax
52 movl %eax, %ebp
53 je .L24
54 cmpl $4, %eax
55 je .L5
56 cmpl $110, %eax
57 jne .L25
58 movl $11, %ebp
59 .L5:
60 leaq __aio_requests_mutex(%rip), %rdi
61 call pthread_mutex_lock@PLT
62 addq $8, %rsp
63 movl %ebp, %eax
64 popq %rbx
65 popq %rbp
66 popq %r12
67 popq %r13
68 ret
69 .p2align 4,,10
70 .p2align 3
71 .L23:
72 xorl %ebp, %ebp
73 jmp .L5
74 .p2align 4,,10
75 .p2align 3
76 .L25:
77 cmpl $75, %eax
78 je .L5
79 testl %eax, %eax
80 je .L5
81 leaq __PRETTY_FUNCTION__.9114(%rip), %rcx
82 leaq .LC0(%rip), %rsi
83 leaq .LC1(%rip), %rdi
84 movl $101, %edx
85 call __assert_fail@PLT
86 .LFE89:
87 .size do_aio_misc_wait, .-do_aio_misc_wait
88 .section .rodata.str1.1,"aMS",@progbits,1
89 .LC2:
90 .string "requestlist[cnt] != NULL"
91 .section .rodata.str1.8
92 .align 8
93 .LC3:
94 .string "param->requestlist[cnt] != NULL"
95 .text
96 .p2align 4,,15
97 .globl __aio_suspend
98 .type __aio_suspend, @function
99 __aio_suspend:
100 .LFB90:
101 pushq %rbp
102 movq %rsp, %rbp
103 pushq %r15
104 pushq %r14
105 pushq %r13
106 pushq %r12
107 pushq %rbx
108 subq $104, %rsp
109 testl %esi, %esi
110 movl %esi, -96(%rbp)
111 movq %rdx, -112(%rbp)
112 js .L90
113 movslq -96(%rbp), %rsi
114 movq %rdi, %rbx
115 leaq __aio_requests_mutex(%rip), %rdi
116 movl $1, -68(%rbp)
117 movq %rsi, %rax
118 movq %rsi, %r15
119 movq %rsi, -128(%rbp)
120 salq $5, %rax
121 movq %rax, -136(%rbp)
122 addq $16, %rax
123 subq %rax, %rsp
124 leaq 22(,%rsi,8), %rax
125 movq %rsp, -120(%rbp)
126 andq $-16, %rax
127 subq %rax, %rsp
128 call pthread_mutex_lock@PLT
129 testl %r15d, %r15d
130 movq %rsp, %r14
131 je .L91
132 movl -96(%rbp), %eax
133 movq -120(%rbp), %r15
134 movb $0, -89(%rbp)
135 leal -1(%rax), %r13d
136 leaq 1(%r13), %rax
137 xorl %r13d, %r13d
138 movq %rax, -88(%rbp)
139 leaq -68(%rbp), %rax
140 movq %rax, -104(%rbp)
141 .p2align 4,,10
142 .p2align 3
143 .L36:
144 movq (%rbx,%r13,8), %rdi
145 movl %r13d, %r12d
146 testq %rdi, %rdi
147 je .L32
148 cmpl $115, 112(%rdi)
149 jne .L88
150 .LEHB0:
151 call __aio_find_req
152 testq %rax, %rax
153 movq %rax, (%r14,%r13,8)
154 je .L88
155 movq 48(%rax), %rsi
156 movq -104(%rbp), %rcx
157 movq $0, 8(%r15)
158 movq $0, 24(%r15)
159 movb $1, -89(%rbp)
160 movq %rsi, (%r15)
161 movq %rcx, 16(%r15)
162 movq %r15, 48(%rax)
163 .L32:
164 leal 1(%r13), %r12d
165 addq $32, %r15
166 addq $1, %r13
167 cmpq -88(%rbp), %r13
168 jne .L36
169 .L88:
170 cmpl %r12d, -96(%rbp)
171 movzbl -89(%rbp), %r15d
172 sete %al
173 andl %eax, %r15d
174 cmpq $0, -112(%rbp)
175 je .L37
176 leaq -64(%rbp), %r13
177 movl $1, %edi
178 movq %r13, %rsi
179 call __clock_gettime@PLT
180 .LEHE0:
181 movq -112(%rbp), %rax
182 movq (%rax), %rdx
183 movq 8(%rax), %rax
184 addq -56(%rbp), %rax
185 addq -64(%rbp), %rdx
186 cmpq $999999999, %rax
187 movq %rdx, -64(%rbp)
188 movq %rax, -56(%rbp)
189 jle .L89
190 subq $1000000000, %rax
191 addq $1, %rdx
192 movq %rax, -56(%rbp)
193 movq %rdx, -64(%rbp)
194 .L89:
195 testb %r15b, %r15b
196 je .L31
197 movq %r13, -112(%rbp)
198 .L39:
199 movq -112(%rbp), %rsi
200 leaq -68(%rbp), %rdi
201 .LEHB1:
202 call do_aio_misc_wait
203 .LEHE1:
204 movl %eax, %r13d
205 .L41:
206 movslq %r12d, %r8
207 movq -120(%rbp), %r10
208 subl $1, %r12d
209 movq %r8, %rsi
210 movslq %r12d, %r12
211 salq $3, %r8
212 negq %rsi
213 addq %r8, %rbx
214 leaq (%r14,%r12,8), %r9
215 salq $3, %rsi
216 xorl %eax, %eax
217 subq $32, %r10
218 jmp .L47
219 .p2align 4,,10
220 .p2align 3
221 .L42:
222 subq $8, %rax
223 .L47:
224 cmpq %rax, %rsi
225 je .L92
226 movq -8(%rbx,%rax), %rdx
227 testq %rdx, %rdx
228 je .L42
229 cmpl $115, 112(%rdx)
230 jne .L42
231 movq (%r9,%rax), %rdx
232 testq %rdx, %rdx
233 je .L93
234 movq 48(%rdx), %rcx
235 testq %rcx, %rcx
236 je .L42
237 leaq (%r8,%rax), %rdi
238 leaq (%r10,%rdi,4), %rdi
239 cmpq %rdi, %rcx
240 jne .L45
241 jmp .L94
242 .p2align 4,,10
243 .p2align 3
244 .L58:
245 movq %rdx, %rcx
246 .L45:
247 movq (%rcx), %rdx
248 testq %rdx, %rdx
249 je .L42
250 cmpq %rdi, %rdx
251 jne .L58
252 movq %rcx, %rdi
253 .L46:
254 movq (%rdx), %rdx
255 movq %rdx, (%rdi)
256 jmp .L42
257 .p2align 4,,10
258 .p2align 3
259 .L37:
260 testb %r15b, %r15b
261 jne .L39
262 .L31:
263 xorl %r13d, %r13d
264 jmp .L41
265 .p2align 4,,10
266 .p2align 3
267 .L92:
268 testl %r13d, %r13d
269 je .L49
270 movq errno@gottpoff(%rip), %rax
271 movl %r13d, %fs:(%rax)
272 movl $-1, %r13d
273 .L49:
274 leaq __aio_requests_mutex(%rip), %rdi
275 call pthread_mutex_unlock@PLT
276 .L26:
277 leaq -40(%rbp), %rsp
278 movl %r13d, %eax
279 popq %rbx
280 popq %r12
281 popq %r13
282 popq %r14
283 popq %r15
284 popq %rbp
286 .L94:
287 leaq 48(%rdx), %rdi
288 movq %rcx, %rdx
289 jmp .L46
290 .L90:
291 movq errno@gottpoff(%rip), %rax
292 movl $-1, %r13d
293 movl $22, %fs:(%rax)
294 jmp .L26
295 .L91:
296 xorl %r12d, %r12d
297 cmpq $0, -112(%rbp)
298 je .L31
299 leaq -64(%rbp), %rsi
300 movl $1, %edi
301 xorl %r12d, %r12d
302 .LEHB2:
303 call __clock_gettime@PLT
304 movq -112(%rbp), %rax
305 movq -64(%rbp), %rdx
306 addq (%rax), %rdx
307 movq 8(%rax), %rax
308 addq -56(%rbp), %rax
309 movq %rdx, -64(%rbp)
310 cmpq $999999999, %rax
311 movq %rax, -56(%rbp)
312 jle .L31
313 subq $1000000000, %rax
314 addq $1, %rdx
315 movq %rax, -56(%rbp)
316 movq %rdx, -64(%rbp)
317 jmp .L31
318 .L93:
319 leaq __PRETTY_FUNCTION__.9133(%rip), %rcx
320 leaq .LC0(%rip), %rsi
321 leaq .LC2(%rip), %rdi
322 movl $207, %edx
323 call __assert_fail@PLT
324 .L60:
325 leaq __aio_requests_mutex(%rip), %rdi
326 movq %rax, %r12
327 call pthread_mutex_lock@PLT
328 movq -120(%rbp), %rax
329 movq -136(%rbp), %rcx
330 leaq -32(%rax,%rcx), %rdx
331 .L51:
332 cmpl $0, -128(%rbp)
333 jle .L95
334 movq -128(%rbp), %rax
335 movq -8(%rbx,%rax,8), %rax
336 testq %rax, %rax
337 je .L52
338 cmpl $115, 112(%rax)
339 je .L96
340 .L52:
341 subq $1, -128(%rbp)
342 subq $32, %rdx
343 jmp .L51
344 .L95:
345 leaq __aio_requests_mutex(%rip), %rdi
346 call pthread_mutex_unlock@PLT
347 movq %r12, %rdi
348 call _Unwind_Resume@PLT
349 .LEHE2:
350 .L96:
351 movq -128(%rbp), %rax
352 movq -8(%r14,%rax,8), %rax
353 testq %rax, %rax
354 je .L97
355 leaq 48(%rax), %rcx
356 movq 48(%rax), %rax
357 .L54:
358 testq %rax, %rax
359 je .L52
360 cmpq %rdx, %rax
361 movq (%rax), %rsi
362 je .L98
363 movq %rax, %rcx
364 movq %rsi, %rax
365 jmp .L54
366 .L97:
367 leaq __PRETTY_FUNCTION__.9097(%rip), %rcx
368 leaq .LC0(%rip), %rsi
369 leaq .LC3(%rip), %rdi
370 movl $73, %edx
371 call __assert_fail@PLT
372 .L98:
373 movq %rsi, (%rcx)
374 jmp .L52
375 .LFE90:
376 .globl __gcc_personality_v0
377 .section .gcc_except_table,"a",@progbits
378 .LLSDA90:
379 .byte 0xff
380 .byte 0xff
381 .byte 0x1
382 .uleb128 .LLSDACSE90-.LLSDACSB90
383 .LLSDACSB90:
384 .uleb128 .LEHB0-.LFB90
385 .uleb128 .LEHE0-.LEHB0
386 .uleb128 0
387 .uleb128 0
388 .uleb128 .LEHB1-.LFB90
389 .uleb128 .LEHE1-.LEHB1
390 .uleb128 .L60-.LFB90
391 .uleb128 0
392 .uleb128 .LEHB2-.LFB90
393 .uleb128 .LEHE2-.LEHB2
394 .uleb128 0
395 .uleb128 0
396 .LLSDACSE90:
397 .text
398 .size __aio_suspend, .-__aio_suspend
399 .weak aio_suspend
400 .set aio_suspend,__aio_suspend
401 .weak aio_suspend64
402 .set aio_suspend64,aio_suspend
403 .section .rodata.str1.16,"aMS",@progbits,1
404 .align 16
405 .type __PRETTY_FUNCTION__.9114, @object
406 .size __PRETTY_FUNCTION__.9114, 17
407 __PRETTY_FUNCTION__.9114:
408 .string "do_aio_misc_wait"
409 .section .rodata.str1.8
410 .align 8
411 .type __PRETTY_FUNCTION__.9097, @object
412 .size __PRETTY_FUNCTION__.9097, 8
413 __PRETTY_FUNCTION__.9097:
414 .string "cleanup"
415 .align 8
416 .type __PRETTY_FUNCTION__.9133, @object
417 .size __PRETTY_FUNCTION__.9133, 14
418 __PRETTY_FUNCTION__.9133:
419 .string "__aio_suspend"
420 .hidden DW.ref.__gcc_personality_v0
421 .weak DW.ref.__gcc_personality_v0
422 .section .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
423 .align 8
424 .type DW.ref.__gcc_personality_v0, @object
425 .size DW.ref.__gcc_personality_v0, 8
426 DW.ref.__gcc_personality_v0:
427 .quad __gcc_personality_v0
428 .hidden __aio_find_req
429 .hidden __aio_requests_mutex