clarify the purpose of this project
[nyanglibc.git] / io / lockf64.shared.s
blobd759c4fb8a9dbc4f80e7354377cdb592ab7c58d2
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl __lockf64
9 .type __lockf64, @function
10 __lockf64:
11 pushq %rbx
12 pxor %xmm0, %xmm0
13 subq $32, %rsp
14 cmpl $1, %esi
15 movups %xmm0, 4(%rsp)
16 movq $0, 20(%rsp)
17 movl $0, 28(%rsp)
18 movl $65537, (%rsp)
19 movq %rdx, 16(%rsp)
20 je .L3
21 jle .L14
22 cmpl $2, %esi
23 je .L6
24 cmpl $3, %esi
25 jne .L2
26 xorl %edx, %edx
27 xorl %eax, %eax
28 movl $5, %esi
29 movw %dx, (%rsp)
30 movq %rsp, %rdx
31 call __GI___fcntl
32 testl %eax, %eax
33 js .L11
34 cmpw $2, (%rsp)
35 je .L10
36 movl 24(%rsp), %ebx
37 call __GI___getpid
38 cmpl %eax, %ebx
39 jne .L15
40 .L10:
41 addq $32, %rsp
42 xorl %eax, %eax
43 popq %rbx
44 ret
45 .p2align 4,,10
46 .p2align 3
47 .L6:
48 movq %rsp, %rdx
49 movl $6, %esi
50 xorl %eax, %eax
51 call __GI___fcntl64
52 .L1:
53 addq $32, %rsp
54 popq %rbx
55 ret
56 .p2align 4,,10
57 .p2align 3
58 .L14:
59 testl %esi, %esi
60 jne .L2
61 movl $2, %eax
62 movq %rsp, %rdx
63 movl $6, %esi
64 movw %ax, (%rsp)
65 xorl %eax, %eax
66 call __GI___fcntl64
67 addq $32, %rsp
68 popq %rbx
69 ret
70 .p2align 4,,10
71 .p2align 3
72 .L2:
73 movq __libc_errno@gottpoff(%rip), %rax
74 movl $22, %fs:(%rax)
75 addq $32, %rsp
76 movl $-1, %eax
77 popq %rbx
78 ret
79 .p2align 4,,10
80 .p2align 3
81 .L3:
82 movq %rsp, %rdx
83 movl $7, %esi
84 xorl %eax, %eax
85 call __GI___fcntl64
86 addq $32, %rsp
87 popq %rbx
88 ret
89 .L15:
90 movq __libc_errno@gottpoff(%rip), %rax
91 movl $13, %fs:(%rax)
92 movl $-1, %eax
93 jmp .L1
94 .L11:
95 movl $-1, %eax
96 jmp .L1
97 .size __lockf64, .-__lockf64
98 .weak lockf64
99 .set lockf64,__lockf64
100 .weak lockf
101 .set lockf,lockf64