clarify the purpose of this project
[nyanglibc.git] / rt / timer_routines.shared.s
blob37bcd71c06fd7fbf4cc087ee2ca00d43bef65d7d
1 .text
2 .p2align 4,,15
3 .type reset_helper_control, @function
4 reset_helper_control:
5 movl $0, __helper_once(%rip)
6 movl $0, __helper_tid(%rip)
7 ret
8 .size reset_helper_control, .-reset_helper_control
9 .p2align 4,,15
10 .type timer_helper_thread, @function
11 timer_helper_thread:
12 pushq %r15
13 pushq %r14
14 pushq %r13
15 pushq %r12
16 leaq timer_sigev_thread(%rip), %r13
17 pushq %rbp
18 pushq %rbx
19 leaq __active_timer_sigev_thread_lock(%rip), %r12
20 leaq sigtimer_set(%rip), %rbx
21 subq $152, %rsp
22 leaq 16(%rsp), %rbp
23 leaq 8(%rsp), %r14
24 .p2align 4,,10
25 .p2align 3
26 .L4:
27 movq %rbp, %rsi
28 movq %rbx, %rdi
29 call sigwaitinfo@PLT
30 testl %eax, %eax
31 js .L4
32 movl 24(%rsp), %eax
33 cmpl $-2, %eax
34 je .L17
35 cmpl $-6, %eax
36 jne .L4
37 xorl %edi, %edi
38 call pthread_exit@PLT
39 .p2align 4,,10
40 .p2align 3
41 .L17:
42 movq %r12, %rdi
43 movq 40(%rsp), %r15
44 call pthread_mutex_lock@PLT
45 movq __active_timer_sigev_thread(%rip), %rax
46 testq %rax, %rax
47 jne .L10
48 jmp .L7
49 .p2align 4,,10
50 .p2align 3
51 .L18:
52 movq 80(%rax), %rax
53 testq %rax, %rax
54 je .L7
55 .L10:
56 cmpq %rax, %r15
57 jne .L18
58 movl $16, %edi
59 call malloc@PLT
60 testq %rax, %rax
61 je .L7
62 movq 8(%r15), %rdx
63 leaq 24(%r15), %rsi
64 movq %rax, %rcx
65 movq %r14, %rdi
66 movq %rdx, (%rax)
67 movq 16(%r15), %rdx
68 movq %rdx, 8(%rax)
69 movq %r13, %rdx
70 call pthread_create@PLT
71 .L7:
72 movq %r12, %rdi
73 call pthread_mutex_unlock@PLT
74 jmp .L4
75 .size timer_helper_thread, .-timer_helper_thread
76 .p2align 4,,15
77 .type timer_sigev_thread, @function
78 timer_sigev_thread:
79 pushq %rbp
80 pushq %rbx
81 movq %rdi, %r8
82 movl $8, %r10d
83 xorl %edx, %edx
84 leaq sigtimer_set(%rip), %rsi
85 subq $8, %rsp
86 movl $1, %edi
87 movl $14, %eax
88 #APP
89 # 97 "../sysdeps/unix/sysv/linux/internal-signals.h" 1
90 syscall
92 # 0 "" 2
93 #NO_APP
94 movq 8(%r8), %rbp
95 movq %r8, %rdi
96 movq (%r8), %rbx
97 call free@PLT
98 movq %rbp, %rdi
99 call *%rbx
100 addq $8, %rsp
101 xorl %eax, %eax
102 popq %rbx
103 popq %rbp
105 .size timer_sigev_thread, .-timer_sigev_thread
106 .p2align 4,,15
107 .globl __start_helper_thread
108 .hidden __start_helper_thread
109 .type __start_helper_thread, @function
110 __start_helper_thread:
111 pushq %rbx
112 subq $208, %rsp
113 leaq 16(%rsp), %rbx
114 movq %rbx, %rdi
115 call pthread_attr_init@PLT
116 movq %rbx, %rdi
117 call __pthread_get_minstack@PLT
118 movq %rbx, %rdi
119 movq %rax, %rsi
120 call pthread_attr_setstacksize@PLT
121 leaq 80(%rsp), %rsi
122 movabsq $-4294967297, %rax
123 movq %rbx, %rdi
124 movq %rax, 80(%rsp)
125 call __pthread_attr_setsigmask_internal@PLT
126 testl %eax, %eax
127 jne .L26
128 leaq 8(%rsp), %rdi
129 leaq timer_helper_thread(%rip), %rdx
130 xorl %ecx, %ecx
131 movq %rbx, %rsi
132 call pthread_create@PLT
133 testl %eax, %eax
134 je .L27
135 .L24:
136 movq %rbx, %rdi
137 call pthread_attr_destroy@PLT
138 leaq reset_helper_control(%rip), %rdx
139 xorl %esi, %esi
140 xorl %edi, %edi
141 call pthread_atfork@PLT
142 addq $208, %rsp
143 popq %rbx
145 .p2align 4,,10
146 .p2align 3
147 .L27:
148 movq 8(%rsp), %rax
149 movl 720(%rax), %eax
150 movl %eax, __helper_tid(%rip)
151 jmp .L24
152 .p2align 4,,10
153 .p2align 3
154 .L26:
155 movq %rbx, %rdi
156 call pthread_attr_destroy@PLT
157 addq $208, %rsp
158 popq %rbx
160 .size __start_helper_thread, .-__start_helper_thread
161 .hidden __helper_tid
162 .comm __helper_tid,4,4
163 .hidden __helper_once
164 .comm __helper_once,4,4
165 .hidden __active_timer_sigev_thread_lock
166 .globl __active_timer_sigev_thread_lock
167 .bss
168 .align 32
169 .type __active_timer_sigev_thread_lock, @object
170 .size __active_timer_sigev_thread_lock, 40
171 __active_timer_sigev_thread_lock:
172 .zero 40
173 .hidden __active_timer_sigev_thread
174 .comm __active_timer_sigev_thread,8,8
175 .section .rodata
176 .align 32
177 .type sigtimer_set, @object
178 .size sigtimer_set, 128
179 sigtimer_set:
180 .quad 2147483648
181 .quad 0
182 .quad 0
183 .quad 0
184 .quad 0
185 .quad 0
186 .quad 0
187 .quad 0
188 .quad 0
189 .quad 0
190 .quad 0
191 .quad 0
192 .quad 0
193 .quad 0
194 .quad 0
195 .quad 0