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