clarify the purpose of this project
[nyanglibc.git] / sunrpc / svc_tcp.shared.s
blobec7ea9e5db9b99180b892217ebda5952411fc294
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .symver __EI_svctcp_create, svctcp_create@GLIBC_2.2.5
7 .symver __EI_svcfd_create, svcfd_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 svctcp_getargs, @function
17 svctcp_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 svctcp_getargs, .-svctcp_getargs
25 .p2align 4,,15
26 .type svctcp_freeargs, @function
27 svctcp_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 svctcp_freeargs, .-svctcp_freeargs
36 .p2align 4,,15
37 .type svctcp_destroy, @function
38 svctcp_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 svctcp_destroy, .-svctcp_destroy
64 .p2align 4,,15
65 .type svctcp_rendezvous_abort, @function
66 svctcp_rendezvous_abort:
67 subq $8, %rsp
68 call __GI_abort
69 .size svctcp_rendezvous_abort, .-svctcp_rendezvous_abort
70 .section .rodata.str1.1,"aMS",@progbits,1
71 .LC0:
72 .string "out of memory\n"
73 .LC1:
74 .string "svc_tcp: 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 writetcp(%rip), %r9
101 leaq readtcp(%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 svctcp_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 $40, %rsp
156 movq 64(%rdi), %r13
157 leaq 16(%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 $16, 12(%rsp)
171 call __GI_accept
172 testl %eax, %eax
173 js .L27
174 movl 4(%r13), %edx
175 movl 0(%r13), %esi
176 movl %eax, %edi
177 call makefd_xprt
178 testq %rax, %rax
179 je .L28
180 movdqa 16(%rsp), %xmm0
181 movl 12(%rsp), %edx
182 movups %xmm0, 20(%rax)
183 movl %edx, 16(%rax)
184 .L22:
185 addq $40, %rsp
186 xorl %eax, %eax
187 popq %rbx
188 popq %rbp
189 popq %r12
190 popq %r13
192 .p2align 4,,10
193 .p2align 3
194 .L26:
195 call __svc_accept_failed
196 addq $40, %rsp
197 xorl %eax, %eax
198 popq %rbx
199 popq %rbp
200 popq %r12
201 popq %r13
203 .p2align 4,,10
204 .p2align 3
205 .L28:
206 call __svc_wait_on_error
207 jmp .L22
208 .size rendezvous_request, .-rendezvous_request
209 .p2align 4,,15
210 .type svctcp_reply, @function
211 svctcp_reply:
212 pushq %rbp
213 pushq %rbx
214 subq $8, %rsp
215 movq 64(%rdi), %rax
216 leaq 16(%rax), %rbx
217 movl $0, 16(%rax)
218 movq 8(%rax), %rax
219 movq %rbx, %rdi
220 movq %rax, (%rsi)
221 call __GI_xdr_replymsg
222 movq %rbx, %rdi
223 movl $1, %esi
224 movl %eax, %ebp
225 call __GI_xdrrec_endofrecord
226 addq $8, %rsp
227 movl %ebp, %eax
228 popq %rbx
229 popq %rbp
231 .size svctcp_reply, .-svctcp_reply
232 .p2align 4,,15
233 .type svctcp_stat, @function
234 svctcp_stat:
235 movq 64(%rdi), %rdi
236 movl (%rdi), %eax
237 testl %eax, %eax
238 jne .L41
239 rep ret
240 .p2align 4,,10
241 .p2align 3
242 .L41:
243 subq $8, %rsp
244 addq $16, %rdi
245 call __GI_xdrrec_eof
246 testl %eax, %eax
247 setne %al
248 addq $8, %rsp
249 movzbl %al, %eax
250 addl $1, %eax
252 .size svctcp_stat, .-svctcp_stat
253 .p2align 4,,15
254 .type svctcp_recv, @function
255 svctcp_recv:
256 pushq %r12
257 pushq %rbp
258 movq %rsi, %r12
259 pushq %rbx
260 movq 64(%rdi), %rbx
261 leaq 16(%rbx), %rbp
262 movl $1, 16(%rbx)
263 movq %rbp, %rdi
264 call __GI_xdrrec_skiprecord
265 movq %r12, %rsi
266 movq %rbp, %rdi
267 call __GI_xdr_callmsg
268 testl %eax, %eax
269 jne .L46
270 movl $0, (%rbx)
271 popq %rbx
272 popq %rbp
273 popq %r12
275 .p2align 4,,10
276 .p2align 3
277 .L46:
278 movq (%r12), %rax
279 movq %rax, 8(%rbx)
280 movl $1, %eax
281 popq %rbx
282 popq %rbp
283 popq %r12
285 .size svctcp_recv, .-svctcp_recv
286 .p2align 4,,15
287 .type writetcp, @function
288 writetcp:
289 pushq %r13
290 pushq %r12
291 movl %edx, %r13d
292 pushq %rbp
293 pushq %rbx
294 subq $8, %rsp
295 testl %edx, %edx
296 jle .L48
297 movq %rdi, %r12
298 movq %rsi, %rbp
299 movl %edx, %ebx
300 jmp .L51
301 .p2align 4,,10
302 .p2align 3
303 .L49:
304 subl %eax, %ebx
305 cltq
306 addq %rax, %rbp
307 testl %ebx, %ebx
308 jle .L48
309 .L51:
310 movl (%r12), %edi
311 movslq %ebx, %rdx
312 movq %rbp, %rsi
313 call __GI___write
314 testl %eax, %eax
315 jns .L49
316 movq 64(%r12), %rax
317 movl $0, (%rax)
318 addq $8, %rsp
319 movl $-1, %eax
320 popq %rbx
321 popq %rbp
322 popq %r12
323 popq %r13
325 .p2align 4,,10
326 .p2align 3
327 .L48:
328 addq $8, %rsp
329 movl %r13d, %eax
330 popq %rbx
331 popq %rbp
332 popq %r12
333 popq %r13
335 .size writetcp, .-writetcp
336 .p2align 4,,15
337 .type readtcp, @function
338 readtcp:
339 pushq %r14
340 pushq %r13
341 movq %rsi, %r14
342 pushq %r12
343 pushq %rbp
344 movq %rdi, %r12
345 pushq %rbx
346 movl %edx, %r13d
347 subq $16, %rsp
348 movl (%rdi), %ebx
349 leaq 8(%rsp), %rbp
350 .L61:
351 movl $1, %eax
352 movl $35000, %edx
353 movl $1, %esi
354 movq %rbp, %rdi
355 movl %ebx, 8(%rsp)
356 movw %ax, 12(%rsp)
357 call __GI___poll
358 cmpl $-1, %eax
359 je .L56
360 testl %eax, %eax
361 je .L57
362 movzwl 14(%rsp), %eax
363 testb $56, %al
364 jne .L57
365 .L59:
366 testb $1, %al
367 je .L61
368 movslq %r13d, %rdx
369 movq %r14, %rsi
370 movl %ebx, %edi
371 call __GI___read
372 testl %eax, %eax
373 jg .L54
374 .p2align 4,,10
375 .p2align 3
376 .L57:
377 movq 64(%r12), %rax
378 movl $0, (%rax)
379 movl $-1, %eax
380 .L54:
381 addq $16, %rsp
382 popq %rbx
383 popq %rbp
384 popq %r12
385 popq %r13
386 popq %r14
388 .p2align 4,,10
389 .p2align 3
390 .L56:
391 movq __libc_errno@gottpoff(%rip), %rax
392 cmpl $4, %fs:(%rax)
393 jne .L57
394 movzwl 14(%rsp), %eax
395 jmp .L59
396 .size readtcp, .-readtcp
397 .section .rodata.str1.8,"aMS",@progbits,1
398 .align 8
399 .LC3:
400 .string "svc_tcp.c - tcp socket creation problem"
401 .align 8
402 .LC4:
403 .string "svc_tcp.c - cannot getsockname or listen"
404 .text
405 .p2align 4,,15
406 .globl __GI_svctcp_create
407 .hidden __GI_svctcp_create
408 .type __GI_svctcp_create, @function
409 __GI_svctcp_create:
410 pushq %r14
411 pushq %r13
412 xorl %r14d, %r14d
413 pushq %r12
414 pushq %rbp
415 movl %esi, %r13d
416 pushq %rbx
417 movl %edx, %r12d
418 movl %edi, %ebx
419 subq $32, %rsp
420 cmpl $-1, %edi
421 movl $16, 12(%rsp)
422 je .L90
423 .L71:
424 leaq 16(%rsp), %rbp
425 xorl %edx, %edx
426 movq $0, 18(%rsp)
427 movl $2, %ecx
428 movl %ebx, %edi
429 movl $0, 10(%rbp)
430 movw %dx, 14(%rbp)
431 movq %rbp, %rsi
432 movw %cx, 16(%rsp)
433 call __GI_bindresvport
434 testl %eax, %eax
435 jne .L91
436 .L73:
437 leaq 12(%rsp), %rdx
438 movq %rbp, %rsi
439 movl %ebx, %edi
440 call __getsockname
441 testl %eax, %eax
442 je .L74
443 .L76:
444 leaq .LC4(%rip), %rsi
445 leaq __GI__libc_intl_domainname(%rip), %rdi
446 movl $5, %edx
447 call __GI___dcgettext
448 movq %rax, %rdi
449 call __GI_perror
450 testl %r14d, %r14d
451 jne .L75
452 .L89:
453 xorl %ebp, %ebp
454 .L70:
455 addq $32, %rsp
456 movq %rbp, %rax
457 popq %rbx
458 popq %rbp
459 popq %r12
460 popq %r13
461 popq %r14
463 .p2align 4,,10
464 .p2align 3
465 .L74:
466 movl $4096, %esi
467 movl %ebx, %edi
468 call __listen
469 testl %eax, %eax
470 jne .L76
471 movl $8, %edi
472 call malloc@PLT
473 movl $336, %edi
474 movq %rax, %r14
475 call malloc@PLT
476 testq %r14, %r14
477 movq %rax, %rbp
478 je .L82
479 testq %rax, %rax
480 je .L82
481 movdqu __GI__null_auth(%rip), %xmm0
482 movq %rbp, %rdi
483 movq %r14, 64(%rax)
484 movq $0, 72(%rax)
485 movups %xmm0, 40(%rax)
486 movq 16+__GI__null_auth(%rip), %rax
487 movl %r13d, (%r14)
488 movq %rax, 56(%rbp)
489 leaq svctcp_rendezvous_op(%rip), %rax
490 movl %r12d, 4(%r14)
491 movl %ebx, 0(%rbp)
492 movq %rax, 8(%rbp)
493 movzwl 18(%rsp), %eax
494 rolw $8, %ax
495 movw %ax, 4(%rbp)
496 call __GI_xprt_register
497 addq $32, %rsp
498 movq %rbp, %rax
499 popq %rbx
500 popq %rbp
501 popq %r12
502 popq %r13
503 popq %r14
505 .p2align 4,,10
506 .p2align 3
507 .L75:
508 movl %ebx, %edi
509 call __GI___close
510 jmp .L89
511 .p2align 4,,10
512 .p2align 3
513 .L90:
514 movl $6, %edx
515 movl $1, %esi
516 movl $2, %edi
517 call __GI___socket
518 testl %eax, %eax
519 movl %eax, %ebx
520 movl $1, %r14d
521 jns .L71
522 leaq .LC3(%rip), %rsi
523 leaq __GI__libc_intl_domainname(%rip), %rdi
524 movl $5, %edx
525 xorl %ebp, %ebp
526 call __GI___dcgettext
527 movq %rax, %rdi
528 call __GI_perror
529 jmp .L70
530 .p2align 4,,10
531 .p2align 3
532 .L91:
533 movl 12(%rsp), %edx
534 xorl %eax, %eax
535 movq %rbp, %rsi
536 movl %ebx, %edi
537 movw %ax, 18(%rsp)
538 call __bind
539 jmp .L73
540 .p2align 4,,10
541 .p2align 3
542 .L82:
543 leaq .LC0(%rip), %rsi
544 leaq __GI__libc_intl_domainname(%rip), %rdi
545 movl $5, %edx
546 call __GI___dcgettext
547 leaq __func__.11235(%rip), %rdx
548 leaq .LC2(%rip), %rsi
549 movq %rax, %rcx
550 xorl %edi, %edi
551 xorl %eax, %eax
552 call __fxprintf
553 movq %r14, %rdi
554 call free@PLT
555 movq %rbp, %rdi
556 xorl %ebp, %ebp
557 call free@PLT
558 jmp .L70
559 .size __GI_svctcp_create, .-__GI_svctcp_create
560 .globl __EI_svctcp_create
561 .set __EI_svctcp_create,__GI_svctcp_create
562 .p2align 4,,15
563 .globl __GI_svcfd_create
564 .hidden __GI_svcfd_create
565 .type __GI_svcfd_create, @function
566 __GI_svcfd_create:
567 jmp makefd_xprt
568 .size __GI_svcfd_create, .-__GI_svcfd_create
569 .globl __EI_svcfd_create
570 .set __EI_svcfd_create,__GI_svcfd_create
571 .section .rodata.str1.8
572 .align 8
573 .type __func__.11235, @object
574 .size __func__.11235, 14
575 __func__.11235:
576 .string "svctcp_create"
577 .section .data.rel.ro.local,"aw",@progbits
578 .align 32
579 .type svctcp_rendezvous_op, @object
580 .size svctcp_rendezvous_op, 48
581 svctcp_rendezvous_op:
582 .quad rendezvous_request
583 .quad rendezvous_stat
584 .quad svctcp_rendezvous_abort
585 .quad svctcp_rendezvous_abort
586 .quad svctcp_rendezvous_abort
587 .quad svctcp_destroy
588 .align 32
589 .type svctcp_op, @object
590 .size svctcp_op, 48
591 svctcp_op:
592 .quad svctcp_recv
593 .quad svctcp_stat
594 .quad svctcp_getargs
595 .quad svctcp_reply
596 .quad svctcp_freeargs
597 .quad svctcp_destroy
598 .hidden __bind
599 .hidden __listen
600 .hidden __getsockname
601 .hidden __svc_wait_on_error
602 .hidden __svc_accept_failed
603 .hidden __fxprintf