clarify the purpose of this project
[nyanglibc.git] / sunrpc / compat-svc_tcp.shared.s
blobe1ccddfbd00119a26a6eca416a95caff245df4cb
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .symver __EI_svcfd_create, svcfd_create@GLIBC_2.2.5
7 #NO_APP
8 .p2align 4,,15
9 .type rendezvous_stat, @function
10 rendezvous_stat:
11 movl $2, %eax
12 ret
13 .size rendezvous_stat, .-rendezvous_stat
14 .p2align 4,,15
15 .type svctcp_getargs, @function
16 svctcp_getargs:
17 movq 64(%rdi), %rdi
18 movq %rsi, %rcx
19 xorl %eax, %eax
20 movq %rdx, %rsi
21 addq $16, %rdi
22 jmp *%rcx
23 .size svctcp_getargs, .-svctcp_getargs
24 .p2align 4,,15
25 .type svctcp_freeargs, @function
26 svctcp_freeargs:
27 movq 64(%rdi), %rdi
28 movq %rsi, %rcx
29 xorl %eax, %eax
30 movq %rdx, %rsi
31 movl $2, 16(%rdi)
32 addq $16, %rdi
33 jmp *%rcx
34 .size svctcp_freeargs, .-svctcp_freeargs
35 .p2align 4,,15
36 .type svctcp_destroy, @function
37 svctcp_destroy:
38 pushq %rbp
39 pushq %rbx
40 movq %rdi, %rbx
41 subq $8, %rsp
42 movq 64(%rdi), %rbp
43 call __GI_xprt_unregister
44 movl (%rbx), %edi
45 call __GI___close
46 cmpw $0, 4(%rbx)
47 jne .L6
48 movq 24(%rbp), %rax
49 movq 56(%rax), %rax
50 testq %rax, %rax
51 je .L6
52 leaq 16(%rbp), %rdi
53 call *%rax
54 .L6:
55 movq %rbp, %rdi
56 call free@PLT
57 addq $8, %rsp
58 movq %rbx, %rdi
59 popq %rbx
60 popq %rbp
61 jmp free@PLT
62 .size svctcp_destroy, .-svctcp_destroy
63 .p2align 4,,15
64 .type svctcp_rendezvous_abort, @function
65 svctcp_rendezvous_abort:
66 subq $8, %rsp
67 call __GI_abort
68 .size svctcp_rendezvous_abort, .-svctcp_rendezvous_abort
69 .section .rodata.str1.1,"aMS",@progbits,1
70 .LC0:
71 .string "out of memory\n"
72 .LC1:
73 .string "svc_tcp: makefd_xprt"
74 .LC2:
75 .string "%s: %s"
76 .text
77 .p2align 4,,15
78 .type makefd_xprt, @function
79 makefd_xprt:
80 pushq %r14
81 pushq %r13
82 movl %edx, %r14d
83 pushq %r12
84 pushq %rbp
85 movl %edi, %r12d
86 pushq %rbx
87 movl $336, %edi
88 movl %esi, %r13d
89 call malloc@PLT
90 movl $464, %edi
91 movq %rax, %rbx
92 call malloc@PLT
93 testq %rbx, %rbx
94 movq %rax, %rbp
95 je .L17
96 testq %rax, %rax
97 je .L17
98 leaq 16(%rax), %rdi
99 leaq writetcp(%rip), %r9
100 leaq readtcp(%rip), %r8
101 movl $2, (%rax)
102 movq %rbx, %rcx
103 movl %r14d, %edx
104 movl %r13d, %esi
105 call __GI_xdrrec_create
106 leaq svctcp_op(%rip), %rax
107 movq %rbp, 64(%rbx)
108 addq $64, %rbp
109 movq $0, 72(%rbx)
110 movq %rbp, 48(%rbx)
111 movq %rbx, %rdi
112 movq %rax, 8(%rbx)
113 xorl %eax, %eax
114 movl $0, 16(%rbx)
115 movw %ax, 4(%rbx)
116 movl %r12d, (%rbx)
117 call __GI_xprt_register
118 .L13:
119 movq %rbx, %rax
120 popq %rbx
121 popq %rbp
122 popq %r12
123 popq %r13
124 popq %r14
126 .p2align 4,,10
127 .p2align 3
128 .L17:
129 leaq .LC0(%rip), %rsi
130 leaq __GI__libc_intl_domainname(%rip), %rdi
131 movl $5, %edx
132 call __GI___dcgettext
133 leaq .LC1(%rip), %rdx
134 leaq .LC2(%rip), %rsi
135 movq %rax, %rcx
136 xorl %edi, %edi
137 xorl %eax, %eax
138 call __fxprintf
139 movq %rbx, %rdi
140 xorl %ebx, %ebx
141 call free@PLT
142 movq %rbp, %rdi
143 call free@PLT
144 jmp .L13
145 .size makefd_xprt, .-makefd_xprt
146 .p2align 4,,15
147 .type rendezvous_request, @function
148 rendezvous_request:
149 pushq %r13
150 pushq %r12
151 pushq %rbp
152 pushq %rbx
153 movq %rdi, %rbx
154 subq $40, %rsp
155 movq 64(%rdi), %r13
156 leaq 16(%rsp), %r12
157 leaq 12(%rsp), %rbp
158 jmp .L20
159 .p2align 4,,10
160 .p2align 3
161 .L27:
162 movq __libc_errno@gottpoff(%rip), %rax
163 cmpl $4, %fs:(%rax)
164 jne .L26
165 .L20:
166 movl (%rbx), %edi
167 movq %rbp, %rdx
168 movq %r12, %rsi
169 movl $16, 12(%rsp)
170 call __GI_accept
171 testl %eax, %eax
172 js .L27
173 movl 4(%r13), %edx
174 movl 0(%r13), %esi
175 movl %eax, %edi
176 call makefd_xprt
177 testq %rax, %rax
178 je .L28
179 movdqa 16(%rsp), %xmm0
180 movl 12(%rsp), %edx
181 movups %xmm0, 20(%rax)
182 movl %edx, 16(%rax)
183 .L22:
184 addq $40, %rsp
185 xorl %eax, %eax
186 popq %rbx
187 popq %rbp
188 popq %r12
189 popq %r13
191 .p2align 4,,10
192 .p2align 3
193 .L26:
194 call __svc_accept_failed
195 addq $40, %rsp
196 xorl %eax, %eax
197 popq %rbx
198 popq %rbp
199 popq %r12
200 popq %r13
202 .p2align 4,,10
203 .p2align 3
204 .L28:
205 call __svc_wait_on_error
206 jmp .L22
207 .size rendezvous_request, .-rendezvous_request
208 .p2align 4,,15
209 .type svctcp_reply, @function
210 svctcp_reply:
211 pushq %rbp
212 pushq %rbx
213 subq $8, %rsp
214 movq 64(%rdi), %rax
215 leaq 16(%rax), %rbx
216 movl $0, 16(%rax)
217 movq 8(%rax), %rax
218 movq %rbx, %rdi
219 movq %rax, (%rsi)
220 call __GI_xdr_replymsg
221 movq %rbx, %rdi
222 movl $1, %esi
223 movl %eax, %ebp
224 call __GI_xdrrec_endofrecord
225 addq $8, %rsp
226 movl %ebp, %eax
227 popq %rbx
228 popq %rbp
230 .size svctcp_reply, .-svctcp_reply
231 .p2align 4,,15
232 .type svctcp_stat, @function
233 svctcp_stat:
234 movq 64(%rdi), %rdi
235 movl (%rdi), %eax
236 testl %eax, %eax
237 jne .L41
238 rep ret
239 .p2align 4,,10
240 .p2align 3
241 .L41:
242 subq $8, %rsp
243 addq $16, %rdi
244 call __GI_xdrrec_eof
245 testl %eax, %eax
246 setne %al
247 addq $8, %rsp
248 movzbl %al, %eax
249 addl $1, %eax
251 .size svctcp_stat, .-svctcp_stat
252 .p2align 4,,15
253 .type svctcp_recv, @function
254 svctcp_recv:
255 pushq %r12
256 pushq %rbp
257 movq %rsi, %r12
258 pushq %rbx
259 movq 64(%rdi), %rbx
260 leaq 16(%rbx), %rbp
261 movl $1, 16(%rbx)
262 movq %rbp, %rdi
263 call __GI_xdrrec_skiprecord
264 movq %r12, %rsi
265 movq %rbp, %rdi
266 call __GI_xdr_callmsg
267 testl %eax, %eax
268 jne .L46
269 movl $0, (%rbx)
270 popq %rbx
271 popq %rbp
272 popq %r12
274 .p2align 4,,10
275 .p2align 3
276 .L46:
277 movq (%r12), %rax
278 movq %rax, 8(%rbx)
279 movl $1, %eax
280 popq %rbx
281 popq %rbp
282 popq %r12
284 .size svctcp_recv, .-svctcp_recv
285 .p2align 4,,15
286 .type writetcp, @function
287 writetcp:
288 pushq %r13
289 pushq %r12
290 movl %edx, %r13d
291 pushq %rbp
292 pushq %rbx
293 subq $8, %rsp
294 testl %edx, %edx
295 jle .L48
296 movq %rdi, %r12
297 movq %rsi, %rbp
298 movl %edx, %ebx
299 jmp .L51
300 .p2align 4,,10
301 .p2align 3
302 .L49:
303 subl %eax, %ebx
304 cltq
305 addq %rax, %rbp
306 testl %ebx, %ebx
307 jle .L48
308 .L51:
309 movl (%r12), %edi
310 movslq %ebx, %rdx
311 movq %rbp, %rsi
312 call __GI___write
313 testl %eax, %eax
314 jns .L49
315 movq 64(%r12), %rax
316 movl $0, (%rax)
317 addq $8, %rsp
318 movl $-1, %eax
319 popq %rbx
320 popq %rbp
321 popq %r12
322 popq %r13
324 .p2align 4,,10
325 .p2align 3
326 .L48:
327 addq $8, %rsp
328 movl %r13d, %eax
329 popq %rbx
330 popq %rbp
331 popq %r12
332 popq %r13
334 .size writetcp, .-writetcp
335 .p2align 4,,15
336 .type readtcp, @function
337 readtcp:
338 pushq %r14
339 pushq %r13
340 movq %rsi, %r14
341 pushq %r12
342 pushq %rbp
343 movq %rdi, %r12
344 pushq %rbx
345 movl %edx, %r13d
346 subq $16, %rsp
347 movl (%rdi), %ebx
348 leaq 8(%rsp), %rbp
349 .L61:
350 movl $1, %eax
351 movl $35000, %edx
352 movl $1, %esi
353 movq %rbp, %rdi
354 movl %ebx, 8(%rsp)
355 movw %ax, 12(%rsp)
356 call __GI___poll
357 cmpl $-1, %eax
358 je .L56
359 testl %eax, %eax
360 je .L57
361 movzwl 14(%rsp), %eax
362 testb $56, %al
363 jne .L57
364 .L59:
365 testb $1, %al
366 je .L61
367 movslq %r13d, %rdx
368 movq %r14, %rsi
369 movl %ebx, %edi
370 call __GI___read
371 testl %eax, %eax
372 jg .L54
373 .p2align 4,,10
374 .p2align 3
375 .L57:
376 movq 64(%r12), %rax
377 movl $0, (%rax)
378 movl $-1, %eax
379 .L54:
380 addq $16, %rsp
381 popq %rbx
382 popq %rbp
383 popq %r12
384 popq %r13
385 popq %r14
387 .p2align 4,,10
388 .p2align 3
389 .L56:
390 movq __libc_errno@gottpoff(%rip), %rax
391 cmpl $4, %fs:(%rax)
392 jne .L57
393 movzwl 14(%rsp), %eax
394 jmp .L59
395 .size readtcp, .-readtcp
396 .section .rodata.str1.8,"aMS",@progbits,1
397 .align 8
398 .LC3:
399 .string "svc_tcp.c - tcp socket creation problem"
400 .align 8
401 .LC4:
402 .string "svc_tcp.c - cannot getsockname or listen"
403 .text
404 .p2align 4,,15
405 .globl __GI_svctcp_create
406 .hidden __GI_svctcp_create
407 .type __GI_svctcp_create, @function
408 __GI_svctcp_create:
409 pushq %r14
410 pushq %r13
411 xorl %r14d, %r14d
412 pushq %r12
413 pushq %rbp
414 movl %esi, %r13d
415 pushq %rbx
416 movl %edx, %r12d
417 movl %edi, %ebx
418 subq $32, %rsp
419 cmpl $-1, %edi
420 movl $16, 12(%rsp)
421 je .L90
422 .L71:
423 leaq 16(%rsp), %rbp
424 xorl %edx, %edx
425 movq $0, 18(%rsp)
426 movl $2, %ecx
427 movl %ebx, %edi
428 movl $0, 10(%rbp)
429 movw %dx, 14(%rbp)
430 movq %rbp, %rsi
431 movw %cx, 16(%rsp)
432 call __GI_bindresvport
433 testl %eax, %eax
434 jne .L91
435 .L73:
436 leaq 12(%rsp), %rdx
437 movq %rbp, %rsi
438 movl %ebx, %edi
439 call __getsockname
440 testl %eax, %eax
441 je .L74
442 .L76:
443 leaq .LC4(%rip), %rsi
444 leaq __GI__libc_intl_domainname(%rip), %rdi
445 movl $5, %edx
446 call __GI___dcgettext
447 movq %rax, %rdi
448 call __GI_perror
449 testl %r14d, %r14d
450 jne .L75
451 .L89:
452 xorl %ebp, %ebp
453 .L70:
454 addq $32, %rsp
455 movq %rbp, %rax
456 popq %rbx
457 popq %rbp
458 popq %r12
459 popq %r13
460 popq %r14
462 .p2align 4,,10
463 .p2align 3
464 .L74:
465 movl $4096, %esi
466 movl %ebx, %edi
467 call __listen
468 testl %eax, %eax
469 jne .L76
470 movl $8, %edi
471 call malloc@PLT
472 movl $336, %edi
473 movq %rax, %r14
474 call malloc@PLT
475 testq %r14, %r14
476 movq %rax, %rbp
477 je .L82
478 testq %rax, %rax
479 je .L82
480 movdqu __GI__null_auth(%rip), %xmm0
481 movq %rbp, %rdi
482 movq %r14, 64(%rax)
483 movq $0, 72(%rax)
484 movups %xmm0, 40(%rax)
485 movq 16+__GI__null_auth(%rip), %rax
486 movl %r13d, (%r14)
487 movq %rax, 56(%rbp)
488 leaq svctcp_rendezvous_op(%rip), %rax
489 movl %r12d, 4(%r14)
490 movl %ebx, 0(%rbp)
491 movq %rax, 8(%rbp)
492 movzwl 18(%rsp), %eax
493 rolw $8, %ax
494 movw %ax, 4(%rbp)
495 call __GI_xprt_register
496 addq $32, %rsp
497 movq %rbp, %rax
498 popq %rbx
499 popq %rbp
500 popq %r12
501 popq %r13
502 popq %r14
504 .p2align 4,,10
505 .p2align 3
506 .L75:
507 movl %ebx, %edi
508 call __GI___close
509 jmp .L89
510 .p2align 4,,10
511 .p2align 3
512 .L90:
513 movl $6, %edx
514 movl $1, %esi
515 movl $2, %edi
516 call __GI___socket
517 testl %eax, %eax
518 movl %eax, %ebx
519 movl $1, %r14d
520 jns .L71
521 leaq .LC3(%rip), %rsi
522 leaq __GI__libc_intl_domainname(%rip), %rdi
523 movl $5, %edx
524 xorl %ebp, %ebp
525 call __GI___dcgettext
526 movq %rax, %rdi
527 call __GI_perror
528 jmp .L70
529 .p2align 4,,10
530 .p2align 3
531 .L91:
532 movl 12(%rsp), %edx
533 xorl %eax, %eax
534 movq %rbp, %rsi
535 movl %ebx, %edi
536 movw %ax, 18(%rsp)
537 call __bind
538 jmp .L73
539 .p2align 4,,10
540 .p2align 3
541 .L82:
542 leaq .LC0(%rip), %rsi
543 leaq __GI__libc_intl_domainname(%rip), %rdi
544 movl $5, %edx
545 call __GI___dcgettext
546 leaq __func__.11235(%rip), %rdx
547 leaq .LC2(%rip), %rsi
548 movq %rax, %rcx
549 xorl %edi, %edi
550 xorl %eax, %eax
551 call __fxprintf
552 movq %r14, %rdi
553 call free@PLT
554 movq %rbp, %rdi
555 xorl %ebp, %ebp
556 call free@PLT
557 jmp .L70
558 .size __GI_svctcp_create, .-__GI_svctcp_create
559 .globl svctcp_create
560 .set svctcp_create,__GI_svctcp_create
561 .p2align 4,,15
562 .globl __GI_svcfd_create
563 .hidden __GI_svcfd_create
564 .type __GI_svcfd_create, @function
565 __GI_svcfd_create:
566 jmp makefd_xprt
567 .size __GI_svcfd_create, .-__GI_svcfd_create
568 .globl __EI_svcfd_create
569 .set __EI_svcfd_create,__GI_svcfd_create
570 .section .rodata.str1.8
571 .align 8
572 .type __func__.11235, @object
573 .size __func__.11235, 14
574 __func__.11235:
575 .string "svctcp_create"
576 .section .data.rel.ro.local,"aw",@progbits
577 .align 32
578 .type svctcp_rendezvous_op, @object
579 .size svctcp_rendezvous_op, 48
580 svctcp_rendezvous_op:
581 .quad rendezvous_request
582 .quad rendezvous_stat
583 .quad svctcp_rendezvous_abort
584 .quad svctcp_rendezvous_abort
585 .quad svctcp_rendezvous_abort
586 .quad svctcp_destroy
587 .align 32
588 .type svctcp_op, @object
589 .size svctcp_op, 48
590 svctcp_op:
591 .quad svctcp_recv
592 .quad svctcp_stat
593 .quad svctcp_getargs
594 .quad svctcp_reply
595 .quad svctcp_freeargs
596 .quad svctcp_destroy
597 .hidden __bind
598 .hidden __listen
599 .hidden __getsockname
600 .hidden __svc_wait_on_error
601 .hidden __svc_accept_failed
602 .hidden __fxprintf