clarify the purpose of this project
[nyanglibc.git] / shadow / lckpwdf.s
blobb73c48f9c05175e9bb2742e5f4f540c74f8ae4c0
1 .text
2 .p2align 4,,15
3 .type noop_handler, @function
4 noop_handler:
5 rep ret
6 .size noop_handler, .-noop_handler
7 .section .rodata.str1.1,"aMS",@progbits,1
8 .LC0:
9 .string "/etc/.pwd.lock"
10 .text
11 .p2align 4,,15
12 .globl __lckpwdf
13 .type __lckpwdf, @function
14 __lckpwdf:
15 pushq %r14
16 pushq %r13
17 pushq %r12
18 pushq %rbp
19 pushq %rbx
20 subq $608, %rsp
21 movl lock_fd(%rip), %ebp
22 cmpl $-1, %ebp
23 jne .L10
24 #APP
25 # 98 "lckpwdf.c" 1
26 movl %fs:24,%eax
27 # 0 "" 2
28 #NO_APP
29 testl %eax, %eax
30 jne .L6
31 movl $1, %edx
32 #APP
33 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
34 cmpxchgl %edx, lock(%rip)
35 # 0 "" 2
36 #NO_APP
37 .L7:
38 leaq .LC0(%rip), %rdi
39 xorl %eax, %eax
40 movl $384, %edx
41 movl $524353, %esi
42 call __open
43 cmpl $-1, %eax
44 movl %eax, %ebx
45 movl %eax, lock_fd(%rip)
46 jne .L8
47 #APP
48 # 104 "lckpwdf.c" 1
49 movl %fs:24,%eax
50 # 0 "" 2
51 #NO_APP
52 testl %eax, %eax
53 jne .L9
54 .L20:
55 subl $1, lock(%rip)
56 .L3:
57 addq $608, %rsp
58 movl %ebx, %eax
59 popq %rbx
60 popq %rbp
61 popq %r12
62 popq %r13
63 popq %r14
64 ret
65 .p2align 4,,10
66 .p2align 3
67 .L8:
68 leaq 448(%rsp), %rsi
69 xorl %eax, %eax
70 movl $17, %ecx
71 leaq 288(%rsp), %r12
72 movq $-1, %r13
73 leaq 16(%rsi), %rdx
74 movq %r13, 456(%rsp)
75 movq %rdx, %rdi
76 movq %r12, %rdx
77 rep stosq
78 leaq noop_handler(%rip), %rax
79 movl $14, %edi
80 movq %rax, 448(%rsp)
81 call __sigaction
82 testl %eax, %eax
83 jns .L11
84 .L28:
85 movl lock_fd(%rip), %edi
86 testl %edi, %edi
87 jns .L29
88 .L15:
89 #APP
90 # 128 "lckpwdf.c" 1
91 movl %fs:24,%eax
92 # 0 "" 2
93 #NO_APP
94 testl %eax, %eax
95 jne .L16
96 subl $1, lock(%rip)
97 movl %ebp, %ebx
98 jmp .L3
99 .p2align 4,,10
100 .p2align 3
101 .L11:
102 leaq 32(%rsp), %r14
103 leaq 160(%rsp), %rsi
104 movl $1, %edi
105 movq $8192, 160(%rsp)
106 movq %r14, %rdx
107 call __sigprocmask
108 testl %eax, %eax
109 js .L30
110 movl $15, %edi
111 call alarm
112 pxor %xmm0, %xmm0
113 movl lock_fd(%rip), %edi
114 movq %rsp, %rdx
115 xorl %eax, %eax
116 movl $1, %ecx
117 movl $7, %esi
118 movw %cx, (%rsp)
119 movups %xmm0, 2(%rsp)
120 movw %ax, 30(%rdx)
121 movq $0, 18(%rdx)
122 xorl %eax, %eax
123 movl $0, 26(%rdx)
124 call __fcntl
125 xorl %edi, %edi
126 movl %eax, %ebx
127 call alarm
128 xorl %edx, %edx
129 movq %r14, %rsi
130 movl $2, %edi
131 call __sigprocmask
132 xorl %edx, %edx
133 movq %r12, %rsi
134 movl $14, %edi
135 call __sigaction
136 testl %ebx, %ebx
137 js .L31
138 .L17:
139 #APP
140 # 140 "lckpwdf.c" 1
141 movl %fs:24,%eax
142 # 0 "" 2
143 #NO_APP
144 testl %eax, %eax
145 je .L20
146 xorl %eax, %eax
147 #APP
148 # 140 "lckpwdf.c" 1
149 xchgl %eax, lock(%rip)
150 # 0 "" 2
151 #NO_APP
152 cmpl $1, %eax
153 jle .L3
154 .L21:
155 xorl %r10d, %r10d
156 movl $1, %edx
157 movl $129, %esi
158 leaq lock(%rip), %rdi
159 movl $202, %eax
160 #APP
161 # 140 "lckpwdf.c" 1
162 syscall
164 # 0 "" 2
165 #NO_APP
166 jmp .L3
167 .p2align 4,,10
168 .p2align 3
169 .L29:
170 call __close
171 movl %r13d, lock_fd(%rip)
172 jmp .L15
173 .p2align 4,,10
174 .p2align 3
175 .L30:
176 xorl %edx, %edx
177 movq %r12, %rsi
178 movl $14, %edi
179 call __sigaction
180 jmp .L28
181 .p2align 4,,10
182 .p2align 3
183 .L9:
184 xorl %eax, %eax
185 #APP
186 # 104 "lckpwdf.c" 1
187 xchgl %eax, lock(%rip)
188 # 0 "" 2
189 #NO_APP
190 cmpl $1, %eax
191 jg .L21
192 .L10:
193 movl $-1, %ebx
194 jmp .L3
195 .p2align 4,,10
196 .p2align 3
197 .L6:
198 xorl %eax, %eax
199 movl $1, %edx
200 lock cmpxchgl %edx, lock(%rip)
201 je .L7
202 leaq lock(%rip), %rdi
203 call __lll_lock_wait_private
204 jmp .L7
205 .p2align 4,,10
206 .p2align 3
207 .L31:
208 movl lock_fd(%rip), %edi
209 testl %edi, %edi
210 js .L17
211 call __close
212 movl %r13d, lock_fd(%rip)
213 jmp .L17
214 .p2align 4,,10
215 .p2align 3
216 .L16:
217 xorl %eax, %eax
218 #APP
219 # 128 "lckpwdf.c" 1
220 xchgl %eax, lock(%rip)
221 # 0 "" 2
222 #NO_APP
223 cmpl $1, %eax
224 jle .L10
225 xorl %r10d, %r10d
226 movl $1, %edx
227 movl $129, %esi
228 leaq lock(%rip), %rdi
229 movl $202, %eax
230 #APP
231 # 128 "lckpwdf.c" 1
232 syscall
234 # 0 "" 2
235 #NO_APP
236 movl %ebp, %ebx
237 jmp .L3
238 .size __lckpwdf, .-__lckpwdf
239 .weak lckpwdf
240 .set lckpwdf,__lckpwdf
241 .p2align 4,,15
242 .globl __ulckpwdf
243 .type __ulckpwdf, @function
244 __ulckpwdf:
245 movl lock_fd(%rip), %r8d
246 cmpl $-1, %r8d
247 je .L41
248 subq $8, %rsp
249 #APP
250 # 156 "lckpwdf.c" 1
251 movl %fs:24,%eax
252 # 0 "" 2
253 #NO_APP
254 testl %eax, %eax
255 jne .L34
256 movl $1, %edx
257 #APP
258 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
259 cmpxchgl %edx, lock(%rip)
260 # 0 "" 2
261 #NO_APP
262 .L35:
263 movl lock_fd(%rip), %edi
264 call __close
265 movl $-1, lock_fd(%rip)
266 movl %eax, %r8d
267 #APP
268 # 164 "lckpwdf.c" 1
269 movl %fs:24,%eax
270 # 0 "" 2
271 #NO_APP
272 testl %eax, %eax
273 jne .L36
274 subl $1, lock(%rip)
275 .L32:
276 movl %r8d, %eax
277 addq $8, %rsp
279 .p2align 4,,10
280 .p2align 3
281 .L34:
282 xorl %eax, %eax
283 movl $1, %edx
284 lock cmpxchgl %edx, lock(%rip)
285 je .L35
286 leaq lock(%rip), %rdi
287 call __lll_lock_wait_private
288 jmp .L35
289 .p2align 4,,10
290 .p2align 3
291 .L36:
292 xorl %eax, %eax
293 #APP
294 # 164 "lckpwdf.c" 1
295 xchgl %eax, lock(%rip)
296 # 0 "" 2
297 #NO_APP
298 cmpl $1, %eax
299 jle .L32
300 xorl %r10d, %r10d
301 movl $1, %edx
302 movl $129, %esi
303 leaq lock(%rip), %rdi
304 movl $202, %eax
305 #APP
306 # 164 "lckpwdf.c" 1
307 syscall
309 # 0 "" 2
310 #NO_APP
311 jmp .L32
312 .p2align 4,,10
313 .p2align 3
314 .L41:
315 movl %r8d, %eax
317 .size __ulckpwdf, .-__ulckpwdf
318 .weak ulckpwdf
319 .set ulckpwdf,__ulckpwdf
320 .local lock
321 .comm lock,4,4
322 .data
323 .align 4
324 .type lock_fd, @object
325 .size lock_fd, 4
326 lock_fd:
327 .long -1
328 .hidden __lll_lock_wait_private
329 .hidden __close
330 .hidden __fcntl
331 .hidden alarm
332 .hidden __sigprocmask
333 .hidden __sigaction
334 .hidden __open