clarify the purpose of this project
[nyanglibc.git] / nptl / sem_wait.s
blobc64d3ef192b503f29b44c94e0852b6c06e0f049a
1 .text
2 .p2align 4,,15
3 .type __sem_wait_cleanup, @function
4 __sem_wait_cleanup:
5 movabsq $-4294967296, %rax
6 lock addq %rax, (%rdi)
7 ret
8 .size __sem_wait_cleanup, .-__sem_wait_cleanup
9 .p2align 4,,15
10 .type do_futex_wait.constprop.2, @function
11 do_futex_wait.constprop.2:
12 movl 8(%rdi), %r8d
13 xorl %ecx, %ecx
14 xorl %edx, %edx
15 xorl %esi, %esi
16 jmp __futex_abstimed_wait_cancelable64@PLT
17 .size do_futex_wait.constprop.2, .-do_futex_wait.constprop.2
18 .p2align 4,,15
19 .type __new_sem_wait_slow64.constprop.1, @function
20 __new_sem_wait_slow64.constprop.1:
21 pushq %r13
22 pushq %r12
23 pushq %rbp
24 pushq %rbx
25 movabsq $4294967296, %rbp
26 movq %rdi, %rbx
27 subq $40, %rsp
28 lock xaddq %rbp, (%rdi)
29 leaq __sem_wait_cleanup(%rip), %rsi
30 movabsq $-4294967297, %r13
31 movq %rsp, %r12
32 movq %rdi, %rdx
33 movq %r12, %rdi
34 call __pthread_cleanup_push@PLT
35 .L5:
36 testl %ebp, %ebp
37 je .L13
38 leaq 0(%rbp,%r13), %rdx
39 movq %rbp, %rax
40 lock cmpxchgq %rdx, (%rbx)
41 movq %rax, %rbp
42 jne .L5
43 xorl %ebx, %ebx
44 .L9:
45 movq %r12, %rdi
46 xorl %esi, %esi
47 call __pthread_cleanup_pop@PLT
48 addq $40, %rsp
49 movl %ebx, %eax
50 popq %rbx
51 popq %rbp
52 popq %r12
53 popq %r13
54 ret
55 .p2align 4,,10
56 .p2align 3
57 .L13:
58 movq %rbx, %rdi
59 call do_futex_wait.constprop.2
60 cmpl $110, %eax
61 je .L7
62 cmpl $4, %eax
63 je .L7
64 cmpl $75, %eax
65 je .L7
66 movq (%rbx), %rbp
67 jmp .L5
68 .p2align 4,,10
69 .p2align 3
70 .L7:
71 movq errno@gottpoff(%rip), %rdx
72 movl %eax, %fs:(%rdx)
73 movabsq $-4294967296, %rax
74 lock addq %rax, (%rbx)
75 movl $-1, %ebx
76 jmp .L9
77 .size __new_sem_wait_slow64.constprop.1, .-__new_sem_wait_slow64.constprop.1
78 .p2align 4,,15
79 .globl __new_sem_wait
80 .type __new_sem_wait, @function
81 __new_sem_wait:
82 pushq %rbx
83 movq %rdi, %rbx
84 call __pthread_testcancel@PLT
85 movq (%rbx), %rax
86 testl %eax, %eax
87 je .L16
88 leaq -1(%rax), %rdx
89 lock cmpxchgq %rdx, (%rbx)
90 jne .L16
91 xorl %eax, %eax
92 popq %rbx
93 ret
94 .p2align 4,,10
95 .p2align 3
96 .L16:
97 movq %rbx, %rdi
98 popq %rbx
99 jmp __new_sem_wait_slow64.constprop.1
100 .size __new_sem_wait, .-__new_sem_wait
101 .weak sem_wait
102 .set sem_wait,__new_sem_wait
103 .p2align 4,,15
104 .globl __new_sem_trywait
105 .type __new_sem_trywait, @function
106 __new_sem_trywait:
107 movq (%rdi), %rax
108 .L23:
109 testl %eax, %eax
110 je .L22
111 leaq -1(%rax), %rdx
112 lock cmpxchgq %rdx, (%rdi)
113 jne .L23
114 xorl %eax, %eax
116 .p2align 4,,10
117 .p2align 3
118 .L22:
119 movq errno@gottpoff(%rip), %rax
120 movl $11, %fs:(%rax)
121 movl $-1, %eax
123 .size __new_sem_trywait, .-__new_sem_trywait
124 .weak sem_trywait
125 .set sem_trywait,__new_sem_trywait