clarify the purpose of this project
[nyanglibc.git] / misc / splice.s
blob84821d9dd82e092abc9d777855010e33c05a737f
1 .text
2 .p2align 4,,15
3 .globl splice
4 .type splice, @function
5 splice:
6 movq %rcx, %r10
7 #APP
8 # 26 "../sysdeps/unix/sysv/linux/splice.c" 1
9 movl %fs:24,%eax
10 # 0 "" 2
11 #NO_APP
12 testl %eax, %eax
13 jne .L2
14 movl $275, %eax
15 #APP
16 # 26 "../sysdeps/unix/sysv/linux/splice.c" 1
17 syscall
19 # 0 "" 2
20 #NO_APP
21 cmpq $-4096, %rax
22 ja .L9
23 rep ret
24 .p2align 4,,10
25 .p2align 3
26 .L2:
27 pushq %r15
28 pushq %r14
29 movq %r8, %r15
30 pushq %r13
31 pushq %r12
32 movq %rcx, %r14
33 pushq %rbp
34 pushq %rbx
35 movl %edx, %r13d
36 movq %rsi, %r12
37 movl %edi, %ebx
38 subq $24, %rsp
39 movl %r9d, 8(%rsp)
40 call __libc_enable_asynccancel
41 movl 8(%rsp), %r9d
42 movl %eax, %ebp
43 movq %r15, %r8
44 movq %r14, %r10
45 movl %r13d, %edx
46 movq %r12, %rsi
47 movl %ebx, %edi
48 movl $275, %eax
49 #APP
50 # 26 "../sysdeps/unix/sysv/linux/splice.c" 1
51 syscall
53 # 0 "" 2
54 #NO_APP
55 cmpq $-4096, %rax
56 ja .L10
57 .L4:
58 movl %ebp, %edi
59 movq %rax, 8(%rsp)
60 call __libc_disable_asynccancel
61 movq 8(%rsp), %rax
62 addq $24, %rsp
63 popq %rbx
64 popq %rbp
65 popq %r12
66 popq %r13
67 popq %r14
68 popq %r15
69 ret
70 .p2align 4,,10
71 .p2align 3
72 .L9:
73 movq __libc_errno@gottpoff(%rip), %rdx
74 negl %eax
75 movl %eax, %fs:(%rdx)
76 movq $-1, %rax
77 ret
78 .L10:
79 movq __libc_errno@gottpoff(%rip), %rdx
80 negl %eax
81 movl %eax, %fs:(%rdx)
82 movq $-1, %rax
83 jmp .L4
84 .size splice, .-splice
85 .hidden __libc_disable_asynccancel
86 .hidden __libc_enable_asynccancel