clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_once.shared.s
blobd71d571df5ab8cfed6f6e51bf2650753cc480823
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 .type __pthread_once_slow, @function
9 __pthread_once_slow:
10 pushq %r12
11 pushq %rbp
12 movl $202, %r8d
13 pushq %rbx
14 movq %rsi, %rbp
15 movq %rdi, %rbx
16 movl $1, %r9d
17 subq $32, %rsp
18 .L13:
19 movl (%rbx), %eax
20 .L3:
21 testb $2, %al
22 je .L19
23 .L7:
24 addq $32, %rsp
25 xorl %eax, %eax
26 popq %rbx
27 popq %rbp
28 popq %r12
29 ret
30 .p2align 4,,10
31 .p2align 3
32 .L19:
33 movl __fork_generation(%rip), %edx
34 orl $1, %edx
35 lock cmpxchgl %edx, (%rbx)
36 jne .L3
37 cmpl %eax, %edx
38 jne .L4
39 testb $1, %al
40 je .L4
41 xorl %r10d, %r10d
42 movl $128, %esi
43 movq %rbx, %rdi
44 movl %r8d, %eax
45 #APP
46 # 146 "../sysdeps/nptl/futex-internal.h" 1
47 syscall
49 # 0 "" 2
50 #NO_APP
51 cmpq $-4096, %rax
52 jbe .L13
53 leal 11(%rax), %ecx
54 cmpl $11, %ecx
55 ja .L6
56 movq %r9, %rax
57 salq %cl, %rax
58 testl $2177, %eax
59 jne .L13
60 .L6:
61 leaq .LC0(%rip), %rdi
62 call __libc_fatal@PLT
63 .p2align 4,,10
64 .p2align 3
65 .L4:
66 movq %rsp, %r12
67 leaq clear_once_control(%rip), %rsi
68 movq %rbx, %rdx
69 movq %r12, %rdi
70 call __pthread_cleanup_push
71 call *%rbp
72 xorl %esi, %esi
73 movq %r12, %rdi
74 call __pthread_cleanup_pop
75 movl $2, (%rbx)
76 xorl %r10d, %r10d
77 movl $2147483647, %edx
78 movl $129, %esi
79 movq %rbx, %rdi
80 movl $202, %eax
81 #APP
82 # 209 "../sysdeps/nptl/futex-internal.h" 1
83 syscall
85 # 0 "" 2
86 #NO_APP
87 cmpq $-4096, %rax
88 jbe .L7
89 cmpl $-22, %eax
90 je .L7
91 cmpl $-14, %eax
92 je .L7
93 jmp .L6
94 .size __pthread_once_slow, .-__pthread_once_slow
95 .p2align 4,,15
96 .type clear_once_control, @function
97 clear_once_control:
98 movl $0, (%rdi)
99 xorl %r10d, %r10d
100 movl $2147483647, %edx
101 movl $129, %esi
102 movl $202, %eax
103 #APP
104 # 209 "../sysdeps/nptl/futex-internal.h" 1
105 syscall
107 # 0 "" 2
108 #NO_APP
109 cmpq $-4096, %rax
110 ja .L26
111 .L20:
112 rep ret
113 .p2align 4,,10
114 .p2align 3
115 .L26:
116 cmpl $-22, %eax
117 je .L20
118 cmpl $-14, %eax
119 je .L20
120 leaq .LC0(%rip), %rdi
121 subq $8, %rsp
122 call __libc_fatal@PLT
123 .size clear_once_control, .-clear_once_control
124 .p2align 4,,15
125 .globl __GI___pthread_once
126 .hidden __GI___pthread_once
127 .type __GI___pthread_once, @function
128 __GI___pthread_once:
129 movl (%rdi), %eax
130 testb $2, %al
131 je .L29
132 xorl %eax, %eax
134 .p2align 4,,10
135 .p2align 3
136 .L29:
137 jmp __pthread_once_slow
138 .size __GI___pthread_once, .-__GI___pthread_once
139 .weak pthread_once
140 .set pthread_once,__GI___pthread_once
141 .globl __pthread_once
142 .set __pthread_once,__GI___pthread_once
143 .hidden __fork_generation
144 .comm __fork_generation,8,8
145 .hidden __pthread_cleanup_pop
146 .hidden __pthread_cleanup_push