clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_mutex_setprioceiling.shared.s
blob64a60c7c4fd93973c8ffc292b906a648c5279617
1 .text
2 .section .rodata.str1.8,"aMS",@progbits,1
3 .align 8
4 .LC0:
5 .string "The futex facility returned an unexpected error code.\n"
6 .text
7 .p2align 4,,15
8 .globl pthread_mutex_setprioceiling
9 .type pthread_mutex_setprioceiling, @function
10 pthread_mutex_setprioceiling:
11 movl 16(%rdi), %eax
12 testb $64, %al
13 je .L31
14 pushq %r15
15 pushq %r14
16 leaq 16(%rdi), %r14
17 pushq %r13
18 pushq %r12
19 movq %rdx, %r13
20 pushq %rbp
21 pushq %rbx
22 movl %esi, %ebp
23 movq %rdi, %rbx
24 subq $8, %rsp
25 movl __sched_fifo_min_prio(%rip), %eax
26 cmpl $-1, %eax
27 je .L5
28 movl __sched_fifo_max_prio(%rip), %eax
29 cmpl $-1, %eax
30 je .L5
31 .L4:
32 movl __sched_fifo_min_prio(%rip), %eax
33 cmpl %ebp, %eax
34 jg .L2
35 movl __sched_fifo_max_prio(%rip), %eax
36 cmpl %eax, %ebp
37 jg .L2
38 testl $-4096, %ebp
39 jne .L2
40 movl 16(%rbx), %eax
41 #APP
42 # 55 "pthread_mutex_setprioceiling.c" 1
43 movl %fs:720,%edx
44 # 0 "" 2
45 #NO_APP
46 cmpl %edx, 8(%rbx)
47 je .L6
48 movl (%rbx), %r9d
49 .L7:
50 andl $-524288, %r9d
51 movl %r9d, %r15d
52 movl %r9d, %eax
53 orl $1, %r15d
54 lock cmpxchgl %r15d, (%rbx)
55 cmpl %eax, %r9d
56 movl %eax, %r8d
57 je .L10
58 movl %r9d, %r12d
59 orl $2, %r12d
60 jmp .L13
61 .p2align 4,,10
62 .p2align 3
63 .L11:
64 movl %r9d, %eax
65 lock cmpxchgl %r12d, (%rbx)
66 cmpl %r9d, %eax
67 je .L10
68 .L13:
69 movl %r15d, %eax
70 lock cmpxchgl %r12d, (%rbx)
71 movl %eax, %r8d
72 andl $-524288, %eax
73 cmpl %eax, %r9d
74 jne .L10
75 cmpl %r8d, %r9d
76 je .L11
77 movl (%r14), %esi
78 xorl %r10d, %r10d
79 movl %r12d, %edx
80 movq %rbx, %rdi
81 movl $202, %eax
82 notl %esi
83 andl $128, %esi
84 #APP
85 # 146 "../sysdeps/nptl/futex-internal.h" 1
86 syscall
88 # 0 "" 2
89 #NO_APP
90 cmpq $-4096, %rax
91 jbe .L11
92 leal 11(%rax), %ecx
93 cmpl $11, %ecx
94 ja .L12
95 movl $1, %eax
96 salq %cl, %rax
97 testl $2177, %eax
98 jne .L11
99 .L12:
100 leaq .LC0(%rip), %rdi
101 call __libc_fatal@PLT
102 .p2align 4,,10
103 .p2align 3
104 .L5:
105 call __init_sched_fifo_prio
106 jmp .L4
107 .p2align 4,,10
108 .p2align 3
109 .L10:
110 xorl %esi, %esi
111 testq %r13, %r13
112 je .L14
113 shrl $19, %r8d
114 xorl %esi, %esi
115 movl %r8d, 0(%r13)
116 .L14:
117 sall $19, %ebp
118 orl %esi, %ebp
119 movl %ebp, (%rbx)
120 #APP
121 # 117 "pthread_mutex_setprioceiling.c" 1
122 lock;orl $0, (%rsp)
123 # 0 "" 2
124 #NO_APP
125 movl 16(%rbx), %esi
126 movl $202, %ecx
127 xorl %r10d, %r10d
128 movl $2147483647, %edx
129 movq %rbx, %rdi
130 movl %ecx, %eax
131 andl $128, %esi
132 xorb $-127, %sil
133 #APP
134 # 209 "../sysdeps/nptl/futex-internal.h" 1
135 syscall
137 # 0 "" 2
138 #NO_APP
139 movq %rax, %rdx
140 xorl %eax, %eax
141 cmpq $-4096, %rdx
142 ja .L35
143 .L1:
144 addq $8, %rsp
145 popq %rbx
146 popq %rbp
147 popq %r12
148 popq %r13
149 popq %r14
150 popq %r15
152 .p2align 4,,10
153 .p2align 3
154 .L2:
155 addq $8, %rsp
156 movl $22, %eax
157 popq %rbx
158 popq %rbp
159 popq %r12
160 popq %r13
161 popq %r14
162 popq %r15
164 .p2align 4,,10
165 .p2align 3
166 .L31:
167 movl $22, %eax
169 .p2align 4,,10
170 .p2align 3
171 .L6:
172 andl $127, %eax
173 cmpl $66, %eax
174 je .L18
175 cmpl $65, %eax
176 movl (%rbx), %r9d
177 jne .L7
178 shrl $19, %r9d
179 movl %ebp, %esi
180 movl %r9d, %edi
181 movl %r9d, %r12d
182 call __pthread_tpp_change_priority
183 testl %eax, %eax
184 jne .L1
185 testq %r13, %r13
186 je .L17
187 movl %r12d, 0(%r13)
188 .L17:
189 movl (%rbx), %esi
190 andl $524287, %esi
191 jmp .L14
192 .p2align 4,,10
193 .p2align 3
194 .L35:
195 cmpl $-22, %edx
196 je .L20
197 cmpl $-14, %edx
198 jne .L12
199 .L20:
200 addq $8, %rsp
201 xorl %eax, %eax
202 popq %rbx
203 popq %rbp
204 popq %r12
205 popq %r13
206 popq %r14
207 popq %r15
209 .p2align 4,,10
210 .p2align 3
211 .L18:
212 movl $35, %eax
213 jmp .L1
214 .size pthread_mutex_setprioceiling, .-pthread_mutex_setprioceiling
215 .hidden __pthread_tpp_change_priority
216 .hidden __init_sched_fifo_prio
217 .hidden __sched_fifo_max_prio
218 .hidden __sched_fifo_min_prio