clarify the purpose of this project
[nyanglibc.git] / misc / fstab.shared.s
blob2a2943e736f8f6bd213bcd5d3d99f6dee1fcc90b
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .section .rodata.str1.1,"aMS",@progbits,1
7 .LC0:
8 .string "rq"
9 .LC1:
10 .string "rw"
11 .LC2:
12 .string "ro"
13 .LC3:
14 .string "sw"
15 .LC4:
16 .string "??"
17 .LC5:
18 .string "xx"
19 #NO_APP
20 .text
21 .p2align 4,,15
22 .type fstab_convert, @function
23 fstab_convert:
24 pushq %r12
25 pushq %rbp
26 leaq 16(%rdi), %rbp
27 pushq %rbx
28 movq 16(%rdi), %rax
29 leaq .LC1(%rip), %rsi
30 movq %rdi, %rbx
31 leaq 56(%rdi), %r12
32 movq %rax, 56(%rdi)
33 movq 24(%rdi), %rax
34 movq %rax, 64(%rdi)
35 movq 32(%rdi), %rax
36 movq %rax, 72(%rdi)
37 movq 40(%rdi), %rax
38 movq %rax, 80(%rdi)
39 movq %rbp, %rdi
40 call __GI___hasmntopt
41 testq %rax, %rax
42 leaq .LC1(%rip), %rdx
43 je .L10
44 .L2:
45 movl 48(%rbx), %eax
46 movq %rdx, 88(%rbx)
47 movl %eax, 96(%rbx)
48 movl 52(%rbx), %eax
49 movl %eax, 100(%rbx)
50 movq %r12, %rax
51 popq %rbx
52 popq %rbp
53 popq %r12
54 ret
55 .p2align 4,,10
56 .p2align 3
57 .L10:
58 leaq .LC0(%rip), %rsi
59 movq %rbp, %rdi
60 call __GI___hasmntopt
61 testq %rax, %rax
62 leaq .LC0(%rip), %rdx
63 jne .L2
64 leaq .LC2(%rip), %rsi
65 movq %rbp, %rdi
66 call __GI___hasmntopt
67 testq %rax, %rax
68 leaq .LC2(%rip), %rdx
69 jne .L2
70 leaq .LC3(%rip), %rsi
71 movq %rbp, %rdi
72 call __GI___hasmntopt
73 testq %rax, %rax
74 leaq .LC3(%rip), %rdx
75 jne .L2
76 leaq .LC5(%rip), %rsi
77 movq %rbp, %rdi
78 call __GI___hasmntopt
79 leaq .LC5(%rip), %rdx
80 testq %rax, %rax
81 leaq .LC4(%rip), %rax
82 cmove %rax, %rdx
83 jmp .L2
84 .size fstab_convert, .-fstab_convert
85 .section __libc_freeres_fn,"ax",@progbits
86 .p2align 4,,15
87 .type fstab_free, @function
88 fstab_free:
89 movq 8+fstab_state(%rip), %rdi
90 jmp free@PLT
91 .size fstab_free, .-fstab_free
92 .section .rodata.str1.1
93 .LC6:
94 .string "r"
95 .LC7:
96 .string "/etc/fstab"
97 .text
98 .p2align 4,,15
99 .type fstab_init, @function
100 fstab_init:
101 pushq %rbx
102 movl %edi, %ebx
103 subq $16, %rsp
104 cmpq $0, 8+fstab_state(%rip)
105 je .L24
106 movq fstab_state(%rip), %rdi
107 testq %rdi, %rdi
108 je .L16
109 .L26:
110 testl %ebx, %ebx
111 leaq fstab_state(%rip), %rax
112 jne .L25
113 .L12:
114 addq $16, %rsp
115 popq %rbx
117 .p2align 4,,10
118 .p2align 3
119 .L25:
120 movq %rax, 8(%rsp)
121 call __GI_rewind
122 movq 8(%rsp), %rax
123 addq $16, %rsp
124 popq %rbx
126 .p2align 4,,10
127 .p2align 3
128 .L24:
129 movl $8128, %edi
130 call malloc@PLT
131 testq %rax, %rax
132 je .L17
133 movq fstab_state(%rip), %rdi
134 movq %rax, 8+fstab_state(%rip)
135 testq %rdi, %rdi
136 jne .L26
137 .p2align 4,,10
138 .p2align 3
139 .L16:
140 leaq .LC6(%rip), %rsi
141 leaq .LC7(%rip), %rdi
142 call __GI___setmntent
143 testq %rax, %rax
144 je .L17
145 movq %rax, fstab_state(%rip)
146 addq $16, %rsp
147 leaq fstab_state(%rip), %rax
148 popq %rbx
150 .p2align 4,,10
151 .p2align 3
152 .L17:
153 xorl %eax, %eax
154 jmp .L12
155 .size fstab_init, .-fstab_init
156 .p2align 4,,15
157 .globl setfsent
158 .type setfsent, @function
159 setfsent:
160 subq $8, %rsp
161 movl $1, %edi
162 call fstab_init
163 testq %rax, %rax
164 setne %al
165 addq $8, %rsp
166 movzbl %al, %eax
168 .size setfsent, .-setfsent
169 .p2align 4,,15
170 .globl getfsent
171 .type getfsent, @function
172 getfsent:
173 pushq %rbx
174 xorl %edi, %edi
175 call fstab_init
176 testq %rax, %rax
177 je .L31
178 movq 8(%rax), %rdx
179 movq (%rax), %rdi
180 leaq 16(%rax), %rsi
181 movl $8128, %ecx
182 movq %rax, %rbx
183 call __GI___getmntent_r
184 testq %rax, %rax
185 je .L31
186 movq %rbx, %rdi
187 popq %rbx
188 jmp fstab_convert
189 .p2align 4,,10
190 .p2align 3
191 .L31:
192 xorl %eax, %eax
193 popq %rbx
195 .size getfsent, .-getfsent
196 .p2align 4,,15
197 .globl getfsspec
198 .type getfsspec, @function
199 getfsspec:
200 pushq %r12
201 pushq %rbp
202 movq %rdi, %r12
203 pushq %rbx
204 movl $1, %edi
205 call fstab_init
206 testq %rax, %rax
207 movq %rax, %rbx
208 leaq 16(%rax), %rbp
209 jne .L40
210 jmp .L39
211 .p2align 4,,10
212 .p2align 3
213 .L41:
214 movq (%rax), %rdi
215 movq %r12, %rsi
216 call __GI_strcmp
217 testl %eax, %eax
218 je .L47
219 .L40:
220 movq 8(%rbx), %rdx
221 movq (%rbx), %rdi
222 movl $8128, %ecx
223 movq %rbp, %rsi
224 call __GI___getmntent_r
225 testq %rax, %rax
226 jne .L41
227 .L39:
228 popq %rbx
229 xorl %eax, %eax
230 popq %rbp
231 popq %r12
233 .p2align 4,,10
234 .p2align 3
235 .L47:
236 movq %rbx, %rdi
237 popq %rbx
238 popq %rbp
239 popq %r12
240 jmp fstab_convert
241 .size getfsspec, .-getfsspec
242 .p2align 4,,15
243 .globl getfsfile
244 .type getfsfile, @function
245 getfsfile:
246 pushq %r12
247 pushq %rbp
248 movq %rdi, %r12
249 pushq %rbx
250 movl $1, %edi
251 call fstab_init
252 testq %rax, %rax
253 movq %rax, %rbx
254 leaq 16(%rax), %rbp
255 jne .L51
256 jmp .L50
257 .p2align 4,,10
258 .p2align 3
259 .L52:
260 movq 8(%rax), %rdi
261 movq %r12, %rsi
262 call __GI_strcmp
263 testl %eax, %eax
264 je .L58
265 .L51:
266 movq 8(%rbx), %rdx
267 movq (%rbx), %rdi
268 movl $8128, %ecx
269 movq %rbp, %rsi
270 call __GI___getmntent_r
271 testq %rax, %rax
272 jne .L52
273 .L50:
274 popq %rbx
275 xorl %eax, %eax
276 popq %rbp
277 popq %r12
279 .p2align 4,,10
280 .p2align 3
281 .L58:
282 movq %rbx, %rdi
283 popq %rbx
284 popq %rbp
285 popq %r12
286 jmp fstab_convert
287 .size getfsfile, .-getfsfile
288 .p2align 4,,15
289 .globl endfsent
290 .type endfsent, @function
291 endfsent:
292 movq fstab_state(%rip), %rdi
293 testq %rdi, %rdi
294 je .L65
295 subq $8, %rsp
296 call __GI___endmntent
297 movq $0, fstab_state(%rip)
298 addq $8, %rsp
300 .p2align 4,,10
301 .p2align 3
302 .L65:
303 rep ret
304 .size endfsent, .-endfsent
305 .section __libc_subfreeres,"aw",@progbits
306 .align 8
307 .type __elf_set___libc_subfreeres_element_fstab_free__, @object
308 .size __elf_set___libc_subfreeres_element_fstab_free__, 8
309 __elf_set___libc_subfreeres_element_fstab_free__:
310 .quad fstab_free
311 .local fstab_state
312 .comm fstab_state,104,32