clarify the purpose of this project
[nyanglibc.git] / rt / aio_notify.s
blobf0f0febb111a38add49c83183484248700043e7c
1 .text
2 .p2align 4,,15
3 .type notify_func_wrapper, @function
4 notify_func_wrapper:
5 pushq %r12
6 pushq %rbp
7 pushq %rbx
8 movq %rdi, %rbx
9 addq $-128, %rsp
10 movq %rsp, %rbp
11 movq %rbp, %rdi
12 call sigemptyset@PLT
13 movl $8, %r10d
14 xorl %edx, %edx
15 movq %rbp, %rsi
16 movl $2, %edi
17 movl $14, %eax
18 #APP
19 # 34 "../sysdeps/unix/sysv/linux/aio_misc.h" 1
20 syscall
22 # 0 "" 2
23 #NO_APP
24 movq 8(%rbx), %r12
25 movq %rbx, %rdi
26 movq (%rbx), %rbp
27 call free@PLT
28 movq %r12, %rdi
29 call *%rbp
30 subq $-128, %rsp
31 xorl %eax, %eax
32 popq %rbx
33 popq %rbp
34 popq %r12
35 ret
36 .size notify_func_wrapper, .-notify_func_wrapper
37 .p2align 4,,15
38 .globl __aio_notify_only
39 .type __aio_notify_only, @function
40 __aio_notify_only:
41 pushq %r12
42 pushq %rbp
43 pushq %rbx
44 movq %rdi, %rbx
45 subq $80, %rsp
46 movl 12(%rdi), %edx
47 cmpl $2, %edx
48 je .L14
49 xorl %eax, %eax
50 testl %edx, %edx
51 jne .L4
52 call getpid@PLT
53 movl 8(%rbx), %edi
54 movq (%rbx), %rsi
55 movl %eax, %edx
56 call __aio_sigqueue@PLT
57 sarl $31, %eax
58 .L4:
59 addq $80, %rsp
60 popq %rbx
61 popq %rbp
62 popq %r12
63 ret
64 .p2align 4,,10
65 .p2align 3
66 .L14:
67 movq 24(%rdi), %r12
68 testq %r12, %r12
69 je .L15
70 .L6:
71 movl $16, %edi
72 call malloc@PLT
73 movq %rax, %rbp
74 movl $-1, %eax
75 testq %rbp, %rbp
76 je .L4
77 movq 16(%rbx), %rax
78 leaq notify_func_wrapper(%rip), %rdx
79 leaq 8(%rsp), %rdi
80 movq %rbp, %rcx
81 movq %r12, %rsi
82 movq %rax, 0(%rbp)
83 movq (%rbx), %rax
84 movq %rax, 8(%rbp)
85 call pthread_create@PLT
86 movl %eax, %edx
87 xorl %eax, %eax
88 testl %edx, %edx
89 jns .L4
90 movq %rbp, %rdi
91 call free@PLT
92 movl $-1, %eax
93 jmp .L4
94 .p2align 4,,10
95 .p2align 3
96 .L15:
97 leaq 16(%rsp), %r12
98 movq %r12, %rdi
99 call pthread_attr_init@PLT
100 movl $1, %esi
101 movq %r12, %rdi
102 call pthread_attr_setdetachstate@PLT
103 jmp .L6
104 .size __aio_notify_only, .-__aio_notify_only
105 .section .rodata.str1.8,"aMS",@progbits,1
106 .align 8
107 .LC0:
108 .string "The futex facility returned an unexpected error code.\n"
109 .text
110 .p2align 4,,15
111 .globl __aio_notify
112 .type __aio_notify, @function
113 __aio_notify:
114 pushq %r13
115 pushq %r12
116 pushq %rbp
117 pushq %rbx
118 movq %rdi, %rbx
119 subq $8, %rsp
120 movq 40(%rdi), %rbp
121 leaq 32(%rbp), %rdi
122 call __aio_notify_only
123 testl %eax, %eax
124 je .L17
125 movq errno@gottpoff(%rip), %rax
126 movq $-1, 120(%rbp)
127 movl %fs:(%rax), %eax
128 movl %eax, 112(%rbp)
129 .L17:
130 movq 48(%rbx), %rbx
131 testq %rbx, %rbx
132 je .L16
133 movl $202, %r12d
134 jmp .L25
135 .p2align 4,,10
136 .p2align 3
137 .L19:
138 subl $1, (%rcx)
139 je .L37
140 .L22:
141 testq %r13, %r13
142 movq %r13, %rbx
143 je .L16
144 .L25:
145 movq 24(%rbx), %rdi
146 movq (%rbx), %r13
147 movq 16(%rbx), %rcx
148 testq %rdi, %rdi
149 jne .L19
150 movq 8(%rbx), %rax
151 testq %rax, %rax
152 je .L20
153 cmpq $-1, 120(%rbp)
154 jne .L20
155 movl $-1, (%rax)
156 .L20:
157 movl (%rcx), %eax
158 testl %eax, %eax
159 je .L22
160 subl $1, (%rcx)
161 jne .L22
162 xorl %r10d, %r10d
163 movl $1, %edx
164 movl $129, %esi
165 movq %rcx, %rdi
166 movl %r12d, %eax
167 #APP
168 # 209 "../sysdeps/nptl/futex-internal.h" 1
169 syscall
171 # 0 "" 2
172 #NO_APP
173 cmpq $-4096, %rax
174 jbe .L22
175 cmpl $-22, %eax
176 je .L22
177 cmpl $-14, %eax
178 je .L22
179 leaq .LC0(%rip), %rdi
180 call __libc_fatal@PLT
181 .p2align 4,,10
182 .p2align 3
183 .L37:
184 call __aio_notify_only
185 movq 16(%rbx), %rdi
186 movq %r13, %rbx
187 call free@PLT
188 testq %r13, %r13
189 jne .L25
190 .L16:
191 addq $8, %rsp
192 popq %rbx
193 popq %rbp
194 popq %r12
195 popq %r13
197 .size __aio_notify, .-__aio_notify