clarify the purpose of this project
[nyanglibc.git] / nptl / tpp.s
blob00e1ec7b9212632da34919c4ce777349d5b7004b
1 .text
2 .p2align 4,,15
3 .globl __init_sched_fifo_prio
4 .type __init_sched_fifo_prio, @function
5 __init_sched_fifo_prio:
6 subq $8, %rsp
7 movl $1, %edi
8 call __sched_get_priority_max@PLT
9 movl %eax, __sched_fifo_max_prio(%rip)
10 movl $1, %edi
11 call __sched_get_priority_min@PLT
12 movl %eax, __sched_fifo_min_prio(%rip)
13 addq $8, %rsp
14 ret
15 .size __init_sched_fifo_prio, .-__init_sched_fifo_prio
16 .section .rodata.str1.1,"aMS",@progbits,1
17 .LC0:
18 .string "tpp.c"
19 .section .rodata.str1.8,"aMS",@progbits,1
20 .align 8
21 .LC1:
22 .string "new_prio == -1 || (new_prio >= fifo_min_prio && new_prio <= fifo_max_prio)"
23 .align 8
24 .LC2:
25 .string "previous_prio == -1 || (previous_prio >= fifo_min_prio && previous_prio <= fifo_max_prio)"
26 .text
27 .p2align 4,,15
28 .globl __pthread_tpp_change_priority
29 .type __pthread_tpp_change_priority, @function
30 __pthread_tpp_change_priority:
31 pushq %r15
32 pushq %r14
33 pushq %r13
34 pushq %r12
35 movl %edi, %r12d
36 pushq %rbp
37 pushq %rbx
38 movl %esi, %ebp
39 subq $24, %rsp
40 movq %fs:16, %r14
41 #APP
42 # 55 "tpp.c" 1
43 movq %fs:1712,%rbx
44 # 0 "" 2
45 #NO_APP
46 testq %rbx, %rbx
47 movl __sched_fifo_min_prio(%rip), %r13d
48 movl __sched_fifo_max_prio(%rip), %r15d
49 je .L87
50 .L5:
51 cmpl $-1, %ebp
52 je .L9
53 cmpl %ebp, %r13d
54 jg .L48
55 cmpl %ebp, %r15d
56 jl .L48
57 cmpl $-1, %r12d
58 je .L88
59 .L41:
60 cmpl %r12d, %r13d
61 jg .L49
62 cmpl %r12d, %r15d
63 jl .L49
64 cmpl $-1, %ebp
65 movl (%rbx), %r15d
66 je .L14
67 .L39:
68 movl %ebp, %eax
69 subl %r13d, %eax
70 cltq
71 leaq (%rbx,%rax,4), %rdx
72 movl 4(%rdx), %eax
73 cmpl $-1, %eax
74 je .L46
75 addl $1, %eax
76 cmpl %ebp, %r15d
77 movl %eax, 4(%rdx)
78 jge .L89
79 cmpl $-1, %r12d
80 jne .L90
81 .L20:
82 leaq 1560(%r14), %r12
83 xorl %eax, %eax
84 movl $1, %edx
85 lock cmpxchgl %edx, (%r12)
86 jne .L91
87 .L21:
88 movl 780(%r14), %eax
89 movl %ebp, (%rbx)
90 testb $32, %al
91 je .L22
92 .L86:
93 testb $64, %al
94 je .L92
95 .L29:
96 movl 1592(%r14), %eax
97 cmpl %ebp, %eax
98 movl %eax, 12(%rsp)
99 jge .L93
100 movl %ebp, 12(%rsp)
101 .L32:
102 movl 1596(%r14), %esi
103 movl 720(%r14), %edi
104 leaq 12(%rsp), %rdx
105 call __sched_setscheduler@PLT
106 testl %eax, %eax
107 js .L94
108 .L34:
109 xorl %ebx, %ebx
110 .L31:
111 xorl %eax, %eax
112 #APP
113 # 154 "tpp.c" 1
114 xchgl %eax, 1560(%r14)
115 # 0 "" 2
116 #NO_APP
117 cmpl $1, %eax
118 jle .L4
119 xorl %r10d, %r10d
120 movl $1, %edx
121 movl $129, %esi
122 movq %r12, %rdi
123 movl $202, %eax
124 #APP
125 # 154 "tpp.c" 1
126 syscall
128 # 0 "" 2
129 #NO_APP
130 jmp .L4
131 .p2align 4,,10
132 .p2align 3
133 .L89:
134 cmpl $-1, %r12d
135 je .L35
136 .L14:
137 movl %r12d, %eax
138 subl %r13d, %eax
139 cltq
140 leaq (%rbx,%rax,4), %rdx
141 subl $1, 4(%rdx)
142 jne .L35
143 cmpl %r15d, %r12d
144 jne .L35
145 cmpl %r12d, %ebp
146 jge .L35
147 .L42:
148 leal -1(%r12), %ebp
149 cmpl %ebp, %r13d
150 jg .L17
151 movl %ebp, %eax
152 subl %r13d, %eax
153 cltq
154 movl 4(%rbx,%rax,4), %esi
155 testl %esi, %esi
156 jne .L17
157 subl $2, %r12d
158 movslq %r12d, %rax
159 subl %r13d, %r12d
160 movslq %r12d, %r12
161 subq %rax, %r12
162 leaq (%rbx,%r12,4), %rdx
163 jmp .L18
164 .p2align 4,,10
165 .p2align 3
166 .L19:
167 subq $1, %rax
168 movl 8(%rdx,%rax,4), %ecx
169 testl %ecx, %ecx
170 jne .L17
171 .L18:
172 cmpl %eax, %r13d
173 movl %eax, %ebp
174 jle .L19
175 .L17:
176 cmpl %ebp, %r15d
177 jne .L20
178 .p2align 4,,10
179 .p2align 3
180 .L35:
181 xorl %ebx, %ebx
182 .L4:
183 addq $24, %rsp
184 movl %ebx, %eax
185 popq %rbx
186 popq %rbp
187 popq %r12
188 popq %r13
189 popq %r14
190 popq %r15
192 .p2align 4,,10
193 .p2align 3
194 .L88:
195 movl (%rbx), %r15d
196 jmp .L39
197 .p2align 4,,10
198 .p2align 3
199 .L9:
200 cmpl $-1, %r12d
201 jne .L41
202 jmp .L35
203 .p2align 4,,10
204 .p2align 3
205 .L87:
206 cmpl $-1, %r13d
207 je .L47
208 cmpl $-1, %r15d
209 je .L47
210 .L6:
211 movl %r15d, %eax
212 movl $1, %esi
213 subl %r13d, %eax
214 addl $1, %eax
215 cltq
216 leaq 4(,%rax,4), %rdi
217 call calloc@PLT
218 testq %rax, %rax
219 movq %rax, %rbx
220 je .L45
221 leal -1(%r13), %eax
222 movl %eax, (%rbx)
223 #APP
224 # 79 "tpp.c" 1
225 movq %rbx,%fs:1712
226 # 0 "" 2
227 #NO_APP
228 jmp .L5
229 .p2align 4,,10
230 .p2align 3
231 .L93:
232 cmpl %r15d, %eax
233 jl .L32
234 jmp .L34
235 .p2align 4,,10
236 .p2align 3
237 .L94:
238 movq errno@gottpoff(%rip), %rax
239 movl %fs:(%rax), %ebx
240 jmp .L31
241 .p2align 4,,10
242 .p2align 3
243 .L22:
244 movl 720(%r14), %edi
245 leaq 1592(%r14), %rsi
246 call __sched_getparam@PLT
247 testl %eax, %eax
248 je .L27
249 testb $64, 780(%r14)
250 movq errno@gottpoff(%rip), %rax
251 movl %fs:(%rax), %ebx
252 je .L26
253 .L28:
254 testl %ebx, %ebx
255 jne .L31
256 jmp .L29
257 .p2align 4,,10
258 .p2align 3
259 .L92:
260 xorl %ebx, %ebx
261 .L26:
262 movl 720(%r14), %edi
263 call __sched_getscheduler@PLT
264 cmpl $-1, %eax
265 movl %eax, 1596(%r14)
266 je .L95
267 orl $64, 780(%r14)
268 jmp .L28
269 .p2align 4,,10
270 .p2align 3
271 .L46:
272 movl $11, %ebx
273 jmp .L4
274 .p2align 4,,10
275 .p2align 3
276 .L47:
277 call __init_sched_fifo_prio
278 movl __sched_fifo_min_prio(%rip), %r13d
279 movl __sched_fifo_max_prio(%rip), %r15d
280 jmp .L6
281 .p2align 4,,10
282 .p2align 3
283 .L27:
284 movl 780(%r14), %eax
285 movl %eax, %edx
286 orl $32, %edx
287 movl %edx, 780(%r14)
288 jmp .L86
289 .p2align 4,,10
290 .p2align 3
291 .L95:
292 movq errno@gottpoff(%rip), %rax
293 movl %fs:(%rax), %ebx
294 jmp .L28
295 .p2align 4,,10
296 .p2align 3
297 .L45:
298 movl $12, %ebx
299 jmp .L4
300 .p2align 4,,10
301 .p2align 3
302 .L91:
303 movq %r12, %rdi
304 call __lll_lock_wait_private@PLT
305 jmp .L21
306 .L49:
307 leaq __PRETTY_FUNCTION__.7807(%rip), %rcx
308 leaq .LC0(%rip), %rsi
309 leaq .LC2(%rip), %rdi
310 movl $87, %edx
311 call __assert_fail@PLT
312 .L48:
313 leaq __PRETTY_FUNCTION__.7807(%rip), %rcx
314 leaq .LC0(%rip), %rsi
315 leaq .LC1(%rip), %rdi
316 movl $84, %edx
317 call __assert_fail@PLT
318 .L90:
319 movl %r12d, %eax
320 subl %r13d, %eax
321 cltq
322 leaq (%rbx,%rax,4), %rdx
323 subl $1, 4(%rdx)
324 jne .L20
325 cmpl %r12d, %ebp
326 jge .L20
327 cmpl %r12d, %r15d
328 je .L42
329 jmp .L20
330 .size __pthread_tpp_change_priority, .-__pthread_tpp_change_priority
331 .p2align 4,,15
332 .globl __pthread_current_priority
333 .type __pthread_current_priority, @function
334 __pthread_current_priority:
335 pushq %rbp
336 pushq %rbx
337 subq $8, %rsp
338 movq %fs:16, %rbx
339 movl 780(%rbx), %eax
340 andl $96, %eax
341 cmpl $96, %eax
342 je .L115
343 leaq 1560(%rbx), %rbp
344 xorl %eax, %eax
345 movl $1, %edx
346 lock cmpxchgl %edx, 0(%rbp)
347 jne .L116
348 .L99:
349 movl 780(%rbx), %eax
350 testb $32, %al
351 je .L117
352 .L100:
353 testb $64, %al
354 je .L118
355 .L107:
356 movl 1592(%rbx), %r8d
357 .L103:
358 xorl %eax, %eax
359 #APP
360 # 192 "tpp.c" 1
361 xchgl %eax, 1560(%rbx)
362 # 0 "" 2
363 #NO_APP
364 cmpl $1, %eax
365 jg .L119
366 .L96:
367 addq $8, %rsp
368 movl %r8d, %eax
369 popq %rbx
370 popq %rbp
372 .p2align 4,,10
373 .p2align 3
374 .L115:
375 movl 1592(%rbx), %r8d
376 addq $8, %rsp
377 popq %rbx
378 popq %rbp
379 movl %r8d, %eax
381 .p2align 4,,10
382 .p2align 3
383 .L117:
384 movl 720(%rbx), %edi
385 leaq 1592(%rbx), %rsi
386 call __sched_getparam@PLT
387 testl %eax, %eax
388 jne .L101
389 movl 780(%rbx), %eax
390 orl $32, %eax
391 movl %eax, 780(%rbx)
392 jmp .L100
393 .p2align 4,,10
394 .p2align 3
395 .L116:
396 movq %rbp, %rdi
397 call __lll_lock_wait_private@PLT
398 jmp .L99
399 .p2align 4,,10
400 .p2align 3
401 .L118:
402 movl 720(%rbx), %edi
403 call __sched_getscheduler@PLT
404 cmpl $-1, %eax
405 movl %eax, 1596(%rbx)
406 jne .L120
407 .L114:
408 movl $-1, %r8d
409 jmp .L103
410 .p2align 4,,10
411 .p2align 3
412 .L101:
413 testb $64, 780(%rbx)
414 jne .L114
415 movl 720(%rbx), %edi
416 call __sched_getscheduler@PLT
417 cmpl $-1, %eax
418 movl %eax, 1596(%rbx)
419 je .L114
420 orl $64, 780(%rbx)
421 jmp .L114
422 .p2align 4,,10
423 .p2align 3
424 .L119:
425 xorl %r10d, %r10d
426 movl $1, %edx
427 movl $129, %esi
428 movq %rbp, %rdi
429 movl $202, %eax
430 #APP
431 # 192 "tpp.c" 1
432 syscall
434 # 0 "" 2
435 #NO_APP
436 jmp .L96
437 .L120:
438 orl $64, 780(%rbx)
439 jmp .L107
440 .size __pthread_current_priority, .-__pthread_current_priority
441 .section .rodata.str1.16,"aMS",@progbits,1
442 .align 16
443 .type __PRETTY_FUNCTION__.7807, @object
444 .size __PRETTY_FUNCTION__.7807, 30
445 __PRETTY_FUNCTION__.7807:
446 .string "__pthread_tpp_change_priority"
447 .globl __sched_fifo_max_prio
448 .data
449 .align 4
450 .type __sched_fifo_max_prio, @object
451 .size __sched_fifo_max_prio, 4
452 __sched_fifo_max_prio:
453 .long -1
454 .globl __sched_fifo_min_prio
455 .align 4
456 .type __sched_fifo_min_prio, @object
457 .size __sched_fifo_min_prio, 4
458 __sched_fifo_min_prio:
459 .long -1