clarify the purpose of this project
[nyanglibc.git] / nptl / sem_clockwait.shared.s
blobea86fd585b07946e81b2e04caca9585003272bb5
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, @function
11 do_futex_wait:
12 movl 8(%rdi), %r8d
13 movq %rdx, %rcx
14 movl %esi, %edx
15 xorl %esi, %esi
16 jmp __GI___futex_abstimed_wait_cancelable64
17 .size do_futex_wait, .-do_futex_wait
18 .p2align 4,,15
19 .type __new_sem_wait_slow64, @function
20 __new_sem_wait_slow64:
21 pushq %r15
22 pushq %r14
23 movl %esi, %r14d
24 pushq %r13
25 pushq %r12
26 movq %rdx, %r13
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, %r15
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,%r15), %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 popq %r14
59 popq %r15
60 ret
61 .p2align 4,,10
62 .p2align 3
63 .L13:
64 movq %r13, %rdx
65 movl %r14d, %esi
66 movq %rbx, %rdi
67 call do_futex_wait
68 cmpl $110, %eax
69 je .L7
70 cmpl $4, %eax
71 je .L7
72 cmpl $75, %eax
73 je .L7
74 movq (%rbx), %rbp
75 jmp .L5
76 .p2align 4,,10
77 .p2align 3
78 .L7:
79 movq errno@gottpoff(%rip), %rdx
80 movl %eax, %fs:(%rdx)
81 movabsq $-4294967296, %rax
82 lock addq %rax, (%rbx)
83 movl $-1, %ebx
84 jmp .L9
85 .size __new_sem_wait_slow64, .-__new_sem_wait_slow64
86 .p2align 4,,15
87 .globl __sem_clockwait
88 .type __sem_clockwait, @function
89 __sem_clockwait:
90 cmpl $1, %esi
91 ja .L17
92 cmpq $999999999, 8(%rdx)
93 ja .L17
94 movq (%rdi), %rax
95 testl %eax, %eax
96 je .L19
97 leaq -1(%rax), %rcx
98 lock cmpxchgq %rcx, (%rdi)
99 jne .L19
100 xorl %eax, %eax
102 .p2align 4,,10
103 .p2align 3
104 .L19:
105 jmp __new_sem_wait_slow64
106 .p2align 4,,10
107 .p2align 3
108 .L17:
109 movq errno@gottpoff(%rip), %rax
110 movl $22, %fs:(%rax)
111 movl $-1, %eax
113 .size __sem_clockwait, .-__sem_clockwait
114 .weak sem_clockwait
115 .set sem_clockwait,__sem_clockwait
116 .hidden __pthread_cleanup_pop
117 .hidden __pthread_cleanup_push