clarify the purpose of this project
[nyanglibc.git] / sunrpc / svc_unix.shared.s
blobc7a4ebac13e82fef85cd0820e8f5833c6f1cac6d
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .symver __EI_svcunix_create, svcunix_create@GLIBC_2.2.5
7 .symver __EI_svcunixfd_create, svcunixfd_create@GLIBC_2.2.5
8 #NO_APP
9 .p2align 4,,15
10 .type rendezvous_stat, @function
11 rendezvous_stat:
12 movl $2, %eax
13 ret
14 .size rendezvous_stat, .-rendezvous_stat
15 .p2align 4,,15
16 .type svcunix_getargs, @function
17 svcunix_getargs:
18 movq 64(%rdi), %rdi
19 movq %rsi, %rcx
20 xorl %eax, %eax
21 movq %rdx, %rsi
22 addq $16, %rdi
23 jmp *%rcx
24 .size svcunix_getargs, .-svcunix_getargs
25 .p2align 4,,15
26 .type svcunix_freeargs, @function
27 svcunix_freeargs:
28 movq 64(%rdi), %rdi
29 movq %rsi, %rcx
30 xorl %eax, %eax
31 movq %rdx, %rsi
32 movl $2, 16(%rdi)
33 addq $16, %rdi
34 jmp *%rcx
35 .size svcunix_freeargs, .-svcunix_freeargs
36 .p2align 4,,15
37 .type svcunix_destroy, @function
38 svcunix_destroy:
39 pushq %rbp
40 pushq %rbx
41 movq %rdi, %rbx
42 subq $8, %rsp
43 movq 64(%rdi), %rbp
44 call __GI_xprt_unregister
45 movl (%rbx), %edi
46 call __GI___close
47 cmpw $0, 4(%rbx)
48 jne .L6
49 movq 24(%rbp), %rax
50 movq 56(%rax), %rax
51 testq %rax, %rax
52 je .L6
53 leaq 16(%rbp), %rdi
54 call *%rax
55 .L6:
56 movq %rbp, %rdi
57 call free@PLT
58 addq $8, %rsp
59 movq %rbx, %rdi
60 popq %rbx
61 popq %rbp
62 jmp free@PLT
63 .size svcunix_destroy, .-svcunix_destroy
64 .p2align 4,,15
65 .type svcunix_rendezvous_abort, @function
66 svcunix_rendezvous_abort:
67 subq $8, %rsp
68 call __GI_abort
69 .size svcunix_rendezvous_abort, .-svcunix_rendezvous_abort
70 .section .rodata.str1.1,"aMS",@progbits,1
71 .LC0:
72 .string "out of memory\n"
73 .LC1:
74 .string "svc_unix: makefd_xprt"
75 .LC2:
76 .string "%s: %s"
77 .text
78 .p2align 4,,15
79 .type makefd_xprt, @function
80 makefd_xprt:
81 pushq %r14
82 pushq %r13
83 movl %edx, %r14d
84 pushq %r12
85 pushq %rbp
86 movl %edi, %r12d
87 pushq %rbx
88 movl $336, %edi
89 movl %esi, %r13d
90 call malloc@PLT
91 movl $464, %edi
92 movq %rax, %rbx
93 call malloc@PLT
94 testq %rbx, %rbx
95 movq %rax, %rbp
96 je .L17
97 testq %rax, %rax
98 je .L17
99 leaq 16(%rax), %rdi
100 leaq writeunix(%rip), %r9
101 leaq readunix(%rip), %r8
102 movl $2, (%rax)
103 movq %rbx, %rcx
104 movl %r14d, %edx
105 movl %r13d, %esi
106 call __GI_xdrrec_create
107 leaq svcunix_op(%rip), %rax
108 movq %rbp, 64(%rbx)
109 addq $64, %rbp
110 movq $0, 72(%rbx)
111 movq %rbp, 48(%rbx)
112 movq %rbx, %rdi
113 movq %rax, 8(%rbx)
114 xorl %eax, %eax
115 movl $0, 16(%rbx)
116 movw %ax, 4(%rbx)
117 movl %r12d, (%rbx)
118 call __GI_xprt_register
119 .L13:
120 movq %rbx, %rax
121 popq %rbx
122 popq %rbp
123 popq %r12
124 popq %r13
125 popq %r14
127 .p2align 4,,10
128 .p2align 3
129 .L17:
130 leaq .LC0(%rip), %rsi
131 leaq __GI__libc_intl_domainname(%rip), %rdi
132 movl $5, %edx
133 call __GI___dcgettext
134 leaq .LC1(%rip), %rdx
135 leaq .LC2(%rip), %rsi
136 movq %rax, %rcx
137 xorl %edi, %edi
138 xorl %eax, %eax
139 call __fxprintf
140 movq %rbx, %rdi
141 xorl %ebx, %ebx
142 call free@PLT
143 movq %rbp, %rdi
144 call free@PLT
145 jmp .L13
146 .size makefd_xprt, .-makefd_xprt
147 .p2align 4,,15
148 .type rendezvous_request, @function
149 rendezvous_request:
150 pushq %r13
151 pushq %r12
152 pushq %rbp
153 pushq %rbx
154 movq %rdi, %rbx
155 subq $152, %rsp
156 movq 64(%rdi), %r13
157 leaq 32(%rsp), %r12
158 leaq 12(%rsp), %rbp
159 jmp .L20
160 .p2align 4,,10
161 .p2align 3
162 .L27:
163 movq __libc_errno@gottpoff(%rip), %rax
164 cmpl $4, %fs:(%rax)
165 jne .L26
166 .L20:
167 movl (%rbx), %edi
168 movq %rbp, %rdx
169 movq %r12, %rsi
170 movl $110, 12(%rsp)
171 call __GI_accept
172 testl %eax, %eax
173 js .L27
174 xorl %edx, %edx
175 movl 0(%r13), %esi
176 movl $1, %ecx
177 movw %dx, 30(%rsp)
178 movl 4(%r13), %edx
179 movl %eax, %edi
180 movq $0, 18(%rsp)
181 movl $0, 26(%rsp)
182 movw %cx, 16(%rsp)
183 call makefd_xprt
184 testq %rax, %rax
185 je .L28
186 movdqa 16(%rsp), %xmm0
187 movl 12(%rsp), %edx
188 movups %xmm0, 20(%rax)
189 movl %edx, 16(%rax)
190 .L22:
191 addq $152, %rsp
192 xorl %eax, %eax
193 popq %rbx
194 popq %rbp
195 popq %r12
196 popq %r13
198 .p2align 4,,10
199 .p2align 3
200 .L26:
201 call __svc_accept_failed
202 addq $152, %rsp
203 xorl %eax, %eax
204 popq %rbx
205 popq %rbp
206 popq %r12
207 popq %r13
209 .p2align 4,,10
210 .p2align 3
211 .L28:
212 call __svc_wait_on_error
213 jmp .L22
214 .size rendezvous_request, .-rendezvous_request
215 .p2align 4,,15
216 .type svcunix_reply, @function
217 svcunix_reply:
218 pushq %rbp
219 pushq %rbx
220 subq $8, %rsp
221 movq 64(%rdi), %rax
222 leaq 16(%rax), %rbx
223 movl $0, 16(%rax)
224 movq 8(%rax), %rax
225 movq %rbx, %rdi
226 movq %rax, (%rsi)
227 call __GI_xdr_replymsg
228 movq %rbx, %rdi
229 movl $1, %esi
230 movl %eax, %ebp
231 call __GI_xdrrec_endofrecord
232 addq $8, %rsp
233 movl %ebp, %eax
234 popq %rbx
235 popq %rbp
237 .size svcunix_reply, .-svcunix_reply
238 .p2align 4,,15
239 .type svcunix_stat, @function
240 svcunix_stat:
241 movq 64(%rdi), %rdi
242 movl (%rdi), %eax
243 testl %eax, %eax
244 jne .L41
245 rep ret
246 .p2align 4,,10
247 .p2align 3
248 .L41:
249 subq $8, %rsp
250 addq $16, %rdi
251 call __GI_xdrrec_eof
252 testl %eax, %eax
253 setne %al
254 addq $8, %rsp
255 movzbl %al, %eax
256 addl $1, %eax
258 .size svcunix_stat, .-svcunix_stat
259 .p2align 4,,15
260 .type svcunix_recv, @function
261 svcunix_recv:
262 pushq %r12
263 pushq %rbp
264 movq %rsi, %rbp
265 pushq %rbx
266 movq 64(%rdi), %rbx
267 leaq 16(%rbx), %r12
268 movl $1, 16(%rbx)
269 movq %r12, %rdi
270 call __GI_xdrrec_skiprecord
271 movq %rbp, %rsi
272 movq %r12, %rdi
273 call __GI_xdr_callmsg
274 testl %eax, %eax
275 jne .L46
276 movl $0, (%rbx)
277 popq %rbx
278 popq %rbp
279 popq %r12
281 .p2align 4,,10
282 .p2align 3
283 .L46:
284 movq 0(%rbp), %rax
285 movq %rax, 8(%rbx)
286 leaq cm(%rip), %rax
287 movl $1, 72(%rbp)
288 movl $40, 88(%rbp)
289 movq %rax, 80(%rbp)
290 movl $1, %eax
291 popq %rbx
292 popq %rbp
293 popq %r12
295 .size svcunix_recv, .-svcunix_recv
296 .p2align 4,,15
297 .type writeunix, @function
298 writeunix:
299 pushq %r15
300 pushq %r14
301 pushq %r13
302 pushq %r12
303 pushq %rbp
304 pushq %rbx
305 subq $120, %rsp
306 testl %edx, %edx
307 movq %rdi, 8(%rsp)
308 movl %edx, 28(%rsp)
309 jle .L48
310 leaq 32(%rsp), %rax
311 leaq 48(%rsp), %rbp
312 movq %rsi, %r13
313 movl %edx, %r12d
314 movq %rax, 16(%rsp)
315 .p2align 4,,10
316 .p2align 3
317 .L53:
318 movq 8(%rsp), %rax
319 movl (%rax), %ebx
320 call __GI___getpid
321 movl %eax, %r14d
322 call __geteuid
323 movl %eax, %r15d
324 call __getegid
325 movl %eax, 24+cm(%rip)
326 movabsq $8589934593, %rax
327 movl %r14d, 16+cm(%rip)
328 movq %rax, 8+cm(%rip)
329 movslq %r12d, %rax
330 movl %r15d, 20+cm(%rip)
331 movq %rax, 40(%rsp)
332 movq 16(%rsp), %rax
333 movq $28, cm(%rip)
334 movq %r13, 32(%rsp)
335 movq $1, 72(%rsp)
336 movq $0, 48(%rsp)
337 movq %rax, 64(%rsp)
338 leaq cm(%rip), %rax
339 movl $0, 56(%rsp)
340 movq $32, 88(%rsp)
341 movl $0, 96(%rsp)
342 movq %rax, 80(%rsp)
343 jmp .L49
344 .p2align 4,,10
345 .p2align 3
346 .L59:
347 movq __libc_errno@gottpoff(%rip), %rax
348 cmpl $4, %fs:(%rax)
349 jne .L58
350 .L49:
351 xorl %edx, %edx
352 movq %rbp, %rsi
353 movl %ebx, %edi
354 call __sendmsg
355 testl %eax, %eax
356 movslq %eax, %rdx
357 js .L59
358 subl %edx, %r12d
359 addq %rdx, %r13
360 testl %r12d, %r12d
361 jg .L53
362 .L48:
363 movl 28(%rsp), %eax
364 addq $120, %rsp
365 popq %rbx
366 popq %rbp
367 popq %r12
368 popq %r13
369 popq %r14
370 popq %r15
372 .p2align 4,,10
373 .p2align 3
374 .L58:
375 movq 8(%rsp), %rax
376 movq 64(%rax), %rax
377 movl $0, (%rax)
378 addq $120, %rsp
379 movl $-1, %eax
380 popq %rbx
381 popq %rbp
382 popq %r12
383 popq %r13
384 popq %r14
385 popq %r15
387 .size writeunix, .-writeunix
388 .p2align 4,,15
389 .type readunix, @function
390 readunix:
391 pushq %r14
392 pushq %r13
393 movq %rsi, %r14
394 pushq %r12
395 pushq %rbp
396 movq %rdi, %r12
397 pushq %rbx
398 movslq %edx, %r13
399 subq $96, %rsp
400 movl (%rdi), %ebx
401 leaq 8(%rsp), %rbp
402 .L65:
403 movl $1, %eax
404 movl $35000, %edx
405 movl $1, %esi
406 movq %rbp, %rdi
407 movl %ebx, 8(%rsp)
408 movw %ax, 12(%rsp)
409 call __GI___poll
410 cmpl $-1, %eax
411 je .L62
412 testl %eax, %eax
413 je .L63
414 movzwl 14(%rsp), %eax
415 testb $56, %al
416 jne .L63
417 .L64:
418 testb $1, %al
419 je .L65
420 leaq 16(%rsp), %rax
421 leaq 4(%rsp), %rcx
422 movl $4, %r8d
423 movl $16, %edx
424 movl $1, %esi
425 movl %ebx, %edi
426 movq %rax, 48(%rsp)
427 leaq cm(%rip), %rax
428 movq %r14, 16(%rsp)
429 movq %r13, 24(%rsp)
430 movq $1, 56(%rsp)
431 movq $0, 32(%rsp)
432 movl $0, 40(%rsp)
433 movq %rax, 64(%rsp)
434 movq $40, 72(%rsp)
435 movl $0, 80(%rsp)
436 movl $1, 4(%rsp)
437 call __setsockopt
438 testl %eax, %eax
439 jne .L63
440 leaq 32(%rsp), %rbp
441 jmp .L67
442 .p2align 4,,10
443 .p2align 3
444 .L68:
445 movq __libc_errno@gottpoff(%rip), %rax
446 cmpl $4, %fs:(%rax)
447 jne .L63
448 .L67:
449 xorl %edx, %edx
450 movq %rbp, %rsi
451 movl %ebx, %edi
452 call __recvmsg
453 testl %eax, %eax
454 js .L68
455 testb $8, 80(%rsp)
456 jne .L63
457 testl %eax, %eax
458 jne .L60
459 .p2align 4,,10
460 .p2align 3
461 .L63:
462 movq 64(%r12), %rax
463 movl $0, (%rax)
464 movl $-1, %eax
465 .L60:
466 addq $96, %rsp
467 popq %rbx
468 popq %rbp
469 popq %r12
470 popq %r13
471 popq %r14
473 .p2align 4,,10
474 .p2align 3
475 .L62:
476 movq __libc_errno@gottpoff(%rip), %rax
477 cmpl $4, %fs:(%rax)
478 jne .L63
479 movzwl 14(%rsp), %eax
480 jmp .L64
481 .size readunix, .-readunix
482 .section .rodata.str1.8,"aMS",@progbits,1
483 .align 8
484 .LC3:
485 .string "svc_unix.c - AF_UNIX socket creation problem"
486 .align 8
487 .LC4:
488 .string "svc_unix.c - cannot getsockname or listen"
489 .text
490 .p2align 4,,15
491 .globl __GI_svcunix_create
492 .hidden __GI_svcunix_create
493 .type __GI_svcunix_create, @function
494 __GI_svcunix_create:
495 pushq %r15
496 pushq %r14
497 pushq %r13
498 pushq %r12
499 xorl %r12d, %r12d
500 pushq %rbp
501 pushq %rbx
502 movq %rcx, %rbp
503 movl %edi, %ebx
504 subq $152, %rsp
505 cmpl $-1, %edi
506 movl %esi, 8(%rsp)
507 movl %edx, 12(%rsp)
508 movl $16, 28(%rsp)
509 je .L99
510 .L84:
511 leaq 34(%rsp), %r14
512 leaq 40(%rsp), %rdi
513 xorl %eax, %eax
514 movq $0, 34(%rsp)
515 movq $0, 134(%rsp)
516 movl $1, %edx
517 movq %r14, %rcx
518 leaq 32(%rsp), %r15
519 subq %rdi, %rcx
520 addl $108, %ecx
521 shrl $3, %ecx
522 rep stosq
523 movq %rbp, %rdi
524 movw %dx, 32(%rsp)
525 call __GI_strlen
526 leal 1(%rax), %edx
527 movq %rax, %r13
528 movq %rbp, %rsi
529 movq %r14, %rdi
530 call __GI_memcpy@PLT
531 leal 3(%r13), %edx
532 movq %r15, %rsi
533 movl %ebx, %edi
534 movl %edx, 28(%rsp)
535 call __bind
536 leaq 28(%rsp), %rdx
537 movq %r15, %rsi
538 movl %ebx, %edi
539 call __getsockname
540 testl %eax, %eax
541 je .L86
542 .L88:
543 leaq .LC4(%rip), %rsi
544 leaq __GI__libc_intl_domainname(%rip), %rdi
545 movl $5, %edx
546 call __GI___dcgettext
547 movq %rax, %rdi
548 call __GI_perror
549 testl %r12d, %r12d
550 jne .L87
551 .L98:
552 xorl %ebp, %ebp
553 .L83:
554 addq $152, %rsp
555 movq %rbp, %rax
556 popq %rbx
557 popq %rbp
558 popq %r12
559 popq %r13
560 popq %r14
561 popq %r15
563 .p2align 4,,10
564 .p2align 3
565 .L86:
566 movl $4096, %esi
567 movl %ebx, %edi
568 call __listen
569 testl %eax, %eax
570 jne .L88
571 movl $8, %edi
572 call malloc@PLT
573 movl $336, %edi
574 movq %rax, %r12
575 call malloc@PLT
576 testq %r12, %r12
577 movq %rax, %rbp
578 je .L94
579 testq %rax, %rax
580 je .L94
581 movl 8(%rsp), %eax
582 movq $0, 72(%rbp)
583 movq %rbp, %rdi
584 movdqu __GI__null_auth(%rip), %xmm0
585 movq %r12, 64(%rbp)
586 movl %ebx, 0(%rbp)
587 movl %eax, (%r12)
588 movl 12(%rsp), %eax
589 movups %xmm0, 40(%rbp)
590 movl %eax, 4(%r12)
591 movq 16+__GI__null_auth(%rip), %rax
592 movq %rax, 56(%rbp)
593 leaq svcunix_rendezvous_op(%rip), %rax
594 movq %rax, 8(%rbp)
595 movl $-1, %eax
596 movw %ax, 4(%rbp)
597 call __GI_xprt_register
598 jmp .L83
599 .p2align 4,,10
600 .p2align 3
601 .L87:
602 movl %ebx, %edi
603 call __GI___close
604 jmp .L98
605 .p2align 4,,10
606 .p2align 3
607 .L99:
608 xorl %edx, %edx
609 movl $1, %esi
610 movl $1, %edi
611 call __GI___socket
612 testl %eax, %eax
613 movl %eax, %ebx
614 movl $1, %r12d
615 jns .L84
616 leaq .LC3(%rip), %rsi
617 leaq __GI__libc_intl_domainname(%rip), %rdi
618 movl $5, %edx
619 xorl %ebp, %ebp
620 call __GI___dcgettext
621 movq %rax, %rdi
622 call __GI_perror
623 jmp .L83
624 .p2align 4,,10
625 .p2align 3
626 .L94:
627 leaq .LC0(%rip), %rsi
628 leaq __GI__libc_intl_domainname(%rip), %rdi
629 movl $5, %edx
630 call __GI___dcgettext
631 leaq __func__.11185(%rip), %rdx
632 leaq .LC2(%rip), %rsi
633 movq %rax, %rcx
634 xorl %edi, %edi
635 xorl %eax, %eax
636 call __fxprintf
637 movq %r12, %rdi
638 call free@PLT
639 movq %rbp, %rdi
640 xorl %ebp, %ebp
641 call free@PLT
642 jmp .L83
643 .size __GI_svcunix_create, .-__GI_svcunix_create
644 .globl __EI_svcunix_create
645 .set __EI_svcunix_create,__GI_svcunix_create
646 .p2align 4,,15
647 .globl __GI_svcunixfd_create
648 .hidden __GI_svcunixfd_create
649 .type __GI_svcunixfd_create, @function
650 __GI_svcunixfd_create:
651 jmp makefd_xprt
652 .size __GI_svcunixfd_create, .-__GI_svcunixfd_create
653 .globl __EI_svcunixfd_create
654 .set __EI_svcunixfd_create,__GI_svcunixfd_create
655 .section .rodata.str1.8
656 .align 8
657 .type __func__.11185, @object
658 .size __func__.11185, 15
659 __func__.11185:
660 .string "svcunix_create"
661 .local cm
662 .comm cm,40,32
663 .section .data.rel.ro.local,"aw",@progbits
664 .align 32
665 .type svcunix_rendezvous_op, @object
666 .size svcunix_rendezvous_op, 48
667 svcunix_rendezvous_op:
668 .quad rendezvous_request
669 .quad rendezvous_stat
670 .quad svcunix_rendezvous_abort
671 .quad svcunix_rendezvous_abort
672 .quad svcunix_rendezvous_abort
673 .quad svcunix_destroy
674 .align 32
675 .type svcunix_op, @object
676 .size svcunix_op, 48
677 svcunix_op:
678 .quad svcunix_recv
679 .quad svcunix_stat
680 .quad svcunix_getargs
681 .quad svcunix_reply
682 .quad svcunix_freeargs
683 .quad svcunix_destroy
684 .hidden __listen
685 .hidden __getsockname
686 .hidden __bind
687 .hidden __recvmsg
688 .hidden __setsockopt
689 .hidden __sendmsg
690 .hidden __getegid
691 .hidden __geteuid
692 .hidden __svc_wait_on_error
693 .hidden __svc_accept_failed
694 .hidden __fxprintf