clarify the purpose of this project
[nyanglibc.git] / sunrpc / xdr_stdio.shared.s
blobf48c6004ce88876b9690bf0589db9ff8d920df1d
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .symver __EI_xdrstdio_create, xdrstdio_create@GLIBC_2.2.5
7 #NO_APP
8 .p2align 4,,15
9 .type xdrstdio_inline, @function
10 xdrstdio_inline:
11 xorl %eax, %eax
12 ret
13 .size xdrstdio_inline, .-xdrstdio_inline
14 .p2align 4,,15
15 .type xdrstdio_putint32, @function
16 xdrstdio_putint32:
17 subq $24, %rsp
18 movl (%rsi), %eax
19 movq 24(%rdi), %rcx
20 leaq 12(%rsp), %rdi
21 movl $1, %edx
22 movl $4, %esi
23 bswap %eax
24 movl %eax, 12(%rsp)
25 call __GI__IO_fwrite
26 cmpq $1, %rax
27 sete %al
28 addq $24, %rsp
29 movzbl %al, %eax
30 ret
31 .size xdrstdio_putint32, .-xdrstdio_putint32
32 .p2align 4,,15
33 .type xdrstdio_putlong, @function
34 xdrstdio_putlong:
35 subq $24, %rsp
36 movq (%rsi), %rax
37 movq 24(%rdi), %rcx
38 leaq 12(%rsp), %rdi
39 movl $1, %edx
40 movl $4, %esi
41 bswap %eax
42 movl %eax, 12(%rsp)
43 call __GI__IO_fwrite
44 cmpq $1, %rax
45 sete %al
46 addq $24, %rsp
47 movzbl %al, %eax
48 ret
49 .size xdrstdio_putlong, .-xdrstdio_putlong
50 .p2align 4,,15
51 .type xdrstdio_getint32, @function
52 xdrstdio_getint32:
53 pushq %rbx
54 movl $1, %edx
55 movq %rsi, %rbx
56 movl $4, %esi
57 subq $16, %rsp
58 movq 24(%rdi), %rcx
59 leaq 12(%rsp), %rdi
60 call __GI__IO_fread
61 xorl %edx, %edx
62 cmpq $1, %rax
63 jne .L7
64 movl 12(%rsp), %eax
65 movl $1, %edx
66 bswap %eax
67 movl %eax, (%rbx)
68 .L7:
69 addq $16, %rsp
70 movl %edx, %eax
71 popq %rbx
72 ret
73 .size xdrstdio_getint32, .-xdrstdio_getint32
74 .p2align 4,,15
75 .type xdrstdio_getlong, @function
76 xdrstdio_getlong:
77 pushq %rbx
78 movl $1, %edx
79 movq %rsi, %rbx
80 movl $4, %esi
81 subq $16, %rsp
82 movq 24(%rdi), %rcx
83 leaq 12(%rsp), %rdi
84 call __GI__IO_fread
85 xorl %edx, %edx
86 cmpq $1, %rax
87 jne .L12
88 movl 12(%rsp), %eax
89 movl $1, %edx
90 bswap %eax
91 movl %eax, %eax
92 movq %rax, (%rbx)
93 .L12:
94 addq $16, %rsp
95 movl %edx, %eax
96 popq %rbx
97 ret
98 .size xdrstdio_getlong, .-xdrstdio_getlong
99 .p2align 4,,15
100 .type xdrstdio_destroy, @function
101 xdrstdio_destroy:
102 movq 24(%rdi), %rdi
103 jmp __GI__IO_fflush
104 .size xdrstdio_destroy, .-xdrstdio_destroy
105 .p2align 4,,15
106 .type xdrstdio_setpos, @function
107 xdrstdio_setpos:
108 subq $8, %rsp
109 movq 24(%rdi), %rdi
110 movl %esi, %esi
111 xorl %edx, %edx
112 call __GI_fseek
113 notl %eax
114 addq $8, %rsp
115 shrl $31, %eax
117 .size xdrstdio_setpos, .-xdrstdio_setpos
118 .p2align 4,,15
119 .type xdrstdio_getpos, @function
120 xdrstdio_getpos:
121 subq $8, %rsp
122 movq 24(%rdi), %rdi
123 call __GI__IO_ftell
124 addq $8, %rsp
126 .size xdrstdio_getpos, .-xdrstdio_getpos
127 .p2align 4,,15
128 .type xdrstdio_putbytes, @function
129 xdrstdio_putbytes:
130 testl %edx, %edx
131 jne .L31
132 movl $1, %eax
134 .p2align 4,,10
135 .p2align 3
136 .L31:
137 subq $8, %rsp
138 movq 24(%rdi), %rcx
139 movq %rsi, %rax
140 movq %rax, %rdi
141 movslq %edx, %rsi
142 movl $1, %edx
143 call __GI__IO_fwrite
144 cmpq $1, %rax
145 sete %al
146 addq $8, %rsp
147 movzbl %al, %eax
149 .size xdrstdio_putbytes, .-xdrstdio_putbytes
150 .p2align 4,,15
151 .type xdrstdio_getbytes, @function
152 xdrstdio_getbytes:
153 testl %edx, %edx
154 jne .L41
155 movl $1, %eax
157 .p2align 4,,10
158 .p2align 3
159 .L41:
160 subq $8, %rsp
161 movq 24(%rdi), %rcx
162 movq %rsi, %rax
163 movq %rax, %rdi
164 movslq %edx, %rsi
165 movl $1, %edx
166 call __GI__IO_fread
167 cmpq $1, %rax
168 sete %al
169 addq $8, %rsp
170 movzbl %al, %eax
172 .size xdrstdio_getbytes, .-xdrstdio_getbytes
173 .p2align 4,,15
174 .globl __GI_xdrstdio_create
175 .hidden __GI_xdrstdio_create
176 .type __GI_xdrstdio_create, @function
177 __GI_xdrstdio_create:
178 leaq xdrstdio_ops(%rip), %rax
179 movl %edx, (%rdi)
180 movq %rsi, 24(%rdi)
181 movl $0, 40(%rdi)
182 movq $0, 32(%rdi)
183 movq %rax, 8(%rdi)
185 .size __GI_xdrstdio_create, .-__GI_xdrstdio_create
186 .globl __EI_xdrstdio_create
187 .set __EI_xdrstdio_create,__GI_xdrstdio_create
188 .section .data.rel.ro.local,"aw",@progbits
189 .align 32
190 .type xdrstdio_ops, @object
191 .size xdrstdio_ops, 80
192 xdrstdio_ops:
193 .quad xdrstdio_getlong
194 .quad xdrstdio_putlong
195 .quad xdrstdio_getbytes
196 .quad xdrstdio_putbytes
197 .quad xdrstdio_getpos
198 .quad xdrstdio_setpos
199 .quad xdrstdio_inline
200 .quad xdrstdio_destroy
201 .quad xdrstdio_getint32
202 .quad xdrstdio_putint32