clarify the purpose of this project
[nyanglibc.git] / rt / timer_create.s
blobc81e755fbf3635627457ada7419aca26d4074f74
1 .text
2 .p2align 4,,15
3 .globl __timer_create_new
4 .type __timer_create_new, @function
5 __timer_create_new:
6 pushq %r14
7 pushq %r13
8 pushq %r12
9 pushq %rbp
10 movq %rdx, %r12
11 pushq %rbx
12 movq %rsi, %rbp
13 movl $-6, %ebx
14 subq $96, %rsp
15 cmpl $2, %edi
16 je .L2
17 movl %edi, %ebx
18 cmpl $3, %edi
19 movl $-2, %eax
20 cmove %eax, %ebx
21 .L2:
22 testq %rbp, %rbp
23 je .L3
24 cmpl $2, 12(%rbp)
25 je .L22
26 .L4:
27 leaq 28(%rsp), %rdx
28 movq %rbp, %rsi
29 movl %ebx, %edi
30 movl $222, %eax
31 #APP
32 # 68 "../sysdeps/unix/sysv/linux/timer_create.c" 1
33 syscall
35 # 0 "" 2
36 #NO_APP
37 cmpq $-4096, %rax
38 ja .L23
39 movslq 28(%rsp), %rax
40 movq %rax, (%r12)
41 xorl %eax, %eax
42 .L1:
43 addq $96, %rsp
44 popq %rbx
45 popq %rbp
46 popq %r12
47 popq %r13
48 popq %r14
49 ret
50 .p2align 4,,10
51 .p2align 3
52 .L3:
53 movq $0, 32(%rsp)
54 movq $14, 40(%rsp)
55 leaq 32(%rsp), %rbp
56 jmp .L4
57 .p2align 4,,10
58 .p2align 3
59 .L23:
60 movq errno@gottpoff(%rip), %rdx
61 negl %eax
62 movl %eax, %fs:(%rdx)
63 addq $96, %rsp
64 movl $-1, %eax
65 popq %rbx
66 popq %rbp
67 popq %r12
68 popq %r13
69 popq %r14
70 ret
71 .p2align 4,,10
72 .p2align 3
73 .L22:
74 movq __start_helper_thread@GOTPCREL(%rip), %rsi
75 leaq __helper_once(%rip), %rdi
76 call pthread_once@PLT
77 movl __helper_tid(%rip), %eax
78 testl %eax, %eax
79 je .L24
80 movl $88, %edi
81 call malloc@PLT
82 testq %rax, %rax
83 movq %rax, %r13
84 je .L9
85 movq 0(%rbp), %rax
86 leaq 24(%r13), %r14
87 movq %r14, %rdi
88 movq %rax, 16(%r13)
89 movq 16(%rbp), %rax
90 movq %rax, 8(%r13)
91 call pthread_attr_init@PLT
92 movq 24(%rbp), %rax
93 testq %rax, %rax
94 je .L10
95 movl (%rax), %edx
96 movl %edx, 24(%r13)
97 movl 4(%rax), %edx
98 movl %edx, 28(%r13)
99 movl 8(%rax), %edx
100 movl %edx, 32(%r13)
101 movq 16(%rax), %rdx
102 movq %rdx, 40(%r13)
103 movq 24(%rax), %rdx
104 movq 32(%rax), %rax
105 movq %rdx, 48(%r13)
106 movq %rax, 56(%r13)
107 .L10:
108 movq %r14, %rdi
109 movl $1, %esi
110 call pthread_attr_setdetachstate@PLT
111 movabsq $17179869216, %rax
112 pxor %xmm0, %xmm0
113 movq %rax, 40(%rsp)
114 movl __helper_tid(%rip), %eax
115 leaq 32(%rsp), %rsi
116 movq $0, 84(%rsp)
117 movl $0, 92(%rsp)
118 movq %r13, %rdx
119 movups %xmm0, 52(%rsp)
120 movl %eax, 48(%rsp)
121 movq %r13, 32(%rsp)
122 movl %ebx, %edi
123 movups %xmm0, 68(%rsp)
124 movl $222, %eax
125 #APP
126 # 125 "../sysdeps/unix/sysv/linux/timer_create.c" 1
127 syscall
129 # 0 "" 2
130 #NO_APP
131 cmpl $-4096, %eax
132 ja .L25
133 leaq __active_timer_sigev_thread_lock(%rip), %rdi
134 call pthread_mutex_lock@PLT
135 movq __active_timer_sigev_thread(%rip), %rax
136 leaq __active_timer_sigev_thread_lock(%rip), %rdi
137 movq %r13, __active_timer_sigev_thread(%rip)
138 movq %rax, 80(%r13)
139 shrq %r13
140 call pthread_mutex_unlock@PLT
141 movabsq $-9223372036854775808, %rax
142 orq %rax, %r13
143 xorl %eax, %eax
144 movq %r13, (%r12)
145 jmp .L1
146 .L24:
147 movq errno@gottpoff(%rip), %rax
148 movl $11, %fs:(%rax)
149 .L9:
150 movl $-1, %eax
151 jmp .L1
152 .L25:
153 movq %r13, %rdi
154 movq %rax, 8(%rsp)
155 call free@PLT
156 movq 8(%rsp), %rax
157 movq errno@gottpoff(%rip), %rdx
158 negl %eax
159 movl %eax, %fs:(%rdx)
160 jmp .L9
161 .size __timer_create_new, .-__timer_create_new
162 .weak timer_create
163 .set timer_create,__timer_create_new