clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_setattr_default_np.s
blob1a8086b53b947ccb74f9dc11e1ed16876bebaa65
1 .text
2 .p2align 4,,15
3 .globl pthread_setattr_default_np
4 .type pthread_setattr_default_np, @function
5 pthread_setattr_default_np:
6 pushq %r13
7 pushq %r12
8 pushq %rbp
9 pushq %rbx
10 subq $72, %rsp
11 movl 4(%rdi), %ebp
12 cmpl $2, %ebp
13 ja .L6
14 movl (%rdi), %r12d
15 movq %rdi, %rbx
16 testl %r12d, %r12d
17 jg .L4
18 .L7:
19 movq 32(%rbx), %rax
20 subq $1, %rax
21 cmpq $16382, %rax
22 jbe .L6
23 testb $8, 8(%rbx)
24 jne .L6
25 movq %rbx, %rsi
26 movq %rsp, %rdi
27 call __pthread_attr_copy@PLT
28 testl %eax, %eax
29 movl %eax, %ebx
30 jne .L1
31 movl $1, %edx
32 lock cmpxchgl %edx, __default_pthread_attr_lock(%rip)
33 jne .L16
34 .L9:
35 cmpq $0, 32(%rsp)
36 jne .L10
37 movq 32+__default_pthread_attr(%rip), %rax
38 movq %rax, 32(%rsp)
39 .L10:
40 leaq __default_pthread_attr(%rip), %rdi
41 call __pthread_attr_destroy@PLT
42 movdqa (%rsp), %xmm0
43 movq 48(%rsp), %rax
44 movups %xmm0, __default_pthread_attr(%rip)
45 movdqa 16(%rsp), %xmm0
46 movq %rax, 48+__default_pthread_attr(%rip)
47 xorl %eax, %eax
48 movups %xmm0, 16+__default_pthread_attr(%rip)
49 movdqa 32(%rsp), %xmm0
50 movups %xmm0, 32+__default_pthread_attr(%rip)
51 #APP
52 # 81 "pthread_setattr_default_np.c" 1
53 xchgl %eax, __default_pthread_attr_lock(%rip)
54 # 0 "" 2
55 #NO_APP
56 cmpl $1, %eax
57 jle .L1
58 xorl %r10d, %r10d
59 movl $1, %edx
60 movl $129, %esi
61 leaq __default_pthread_attr_lock(%rip), %rdi
62 movl $202, %eax
63 #APP
64 # 81 "pthread_setattr_default_np.c" 1
65 syscall
67 # 0 "" 2
68 #NO_APP
69 jmp .L1
70 .p2align 4,,10
71 .p2align 3
72 .L4:
73 movl %ebp, %edi
74 call __sched_get_priority_min@PLT
75 movl %ebp, %edi
76 movl %eax, %r13d
77 call __sched_get_priority_max@PLT
78 testl %r13d, %r13d
79 js .L6
80 testl %eax, %eax
81 js .L6
82 cmpl %r13d, %r12d
83 jl .L6
84 cmpl %eax, %r12d
85 jle .L7
86 .p2align 4,,10
87 .p2align 3
88 .L6:
89 movl $22, %ebx
90 .L1:
91 addq $72, %rsp
92 movl %ebx, %eax
93 popq %rbx
94 popq %rbp
95 popq %r12
96 popq %r13
97 ret
98 .L16:
99 leaq __default_pthread_attr_lock(%rip), %rdi
100 call __lll_lock_wait_private@PLT
101 jmp .L9
102 .size pthread_setattr_default_np, .-pthread_setattr_default_np
103 .p2align 4,,15
104 .globl __default_pthread_attr_freeres
105 .type __default_pthread_attr_freeres, @function
106 __default_pthread_attr_freeres:
107 leaq __default_pthread_attr(%rip), %rdi
108 jmp __pthread_attr_destroy@PLT
109 .size __default_pthread_attr_freeres, .-__default_pthread_attr_freeres