1 /* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
29 .comm __fork_generation, 4, 4
35 .type __pthread_once,@function
44 /* Preserve the function pointer. */
49 /* Not yet initialized or initialization in progress.
50 Get the fork generation counter now. */
59 orl __fork_generation(%rip), %edx
66 /* Check whether another thread already runs the initializer. */
68 jz 3f /* No -> do it. */
70 /* Check whether the initializer execution was interrupted
73 testl $0xfffffffc, %eax
74 jnz 3f /* Different for generation -> run initializer. */
76 /* Somebody else got here first. Wait. */
77 movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
82 /* Preserve the pointer to the control variable. */
90 /* Get the control variable address back. */
94 /* Sucessful run of the initializer. Signal that we are done. */
98 /* Wake up all other threads. */
99 movl $0x7fffffff, %edx
100 movl $FUTEX_WAKE, %esi
101 movq $SYS_futex, %rax
109 .size __pthread_once,.-__pthread_once
112 .globl __pthread_once_internal
113 __pthread_once_internal = __pthread_once
116 pthread_once = __pthread_once
119 .type clear_once_control,@function
126 movl $0x7fffffff, %edx
127 movq $FUTEX_WAKE, %rsi
128 movq $SYS_futex, %rax
133 call _Unwind_Resume@PLT
136 .size clear_once_control,.-clear_once_control
139 .section .gcc_except_table,"a",@progbits
141 .byte 0xff # @LPStart format (omit)
142 .byte 0xff # @TType format (omit)
143 .byte 0x01 # call-site format
145 .uleb128 .Lcstend-.Lcstbegin
147 .uleb128 .LcleanupSTART-.LSTARTCODE
148 .uleb128 .LcleanupEND-.LcleanupSTART
149 .uleb128 clear_once_control-.LSTARTCODE
151 .uleb128 .LcallUR-.LSTARTCODE
152 .uleb128 .LENDCODE-.LcallUR
158 .section .eh_frame,"a",@progbits
160 .long .LENDCIE-.LSTARTCIE # Length of the CIE.
163 .byte 1 # Version number.
165 .string "zPLR" # NUL-terminated augmentation
168 .string "zPL" # NUL-terminated augmentation
171 .uleb128 1 # Code alignment factor.
172 .sleb128 -8 # Data alignment factor.
173 .byte 16 # Return address register
176 .uleb128 7 # Augmentation value length.
177 .byte 0x9b # Personality: DW_EH_PE_pcrel
179 # + DW_EH_PE_indirect
180 .long DW.ref.__gcc_personality_v0-.
181 .byte 0x1b # LSDA Encoding: DW_EH_PE_pcrel
183 .byte 0x1b # FDE Encoding: DW_EH_PE_pcrel
186 .uleb128 10 # Augmentation value length.
187 .byte 0x0 # Personality: absolute
188 .quad __gcc_personality_v0
189 .byte 0x0 # LSDA Encoding: absolute
191 .byte 0x0c # DW_CFA_def_cfa
194 .byte 0x90 # DW_CFA_offset, column 0x10
199 .long .LENDFDE-.LSTARTFDE # Length of the FDE.
201 .long .LSTARTFDE-.LSTARTFRAME # CIE pointer.
203 .long .LSTARTCODE-. # PC-relative start address
205 .long .LENDCODE-.LSTARTCODE # Length of the code.
206 .uleb128 4 # Augmentation size
207 .long .LexceptSTART-.
209 .quad .LSTARTCODE # Start address of the code.
210 .quad .LENDCODE-.LSTARTCODE # Length of the code.
211 .uleb128 8 # Augmentation size
214 .byte 4 # DW_CFA_advance_loc4
215 .long .Lpush_rsi-.LSTARTCODE
216 .byte 14 # DW_CFA_def_cfa_offset
218 .byte 4 # DW_CFA_advance_loc4
219 .long .Lpush_rdi-.Lpush_rsi
220 .byte 14 # DW_CFA_def_cfa_offset
222 .byte 4 # DW_CFA_advance_loc4
223 .long .Lpop_rdi-.Lpush_rdi
224 .byte 14 # DW_CFA_def_cfa_offset
226 .byte 4 # DW_CFA_advance_loc4
227 .long .Ladd-.Lpop_rdi
228 .byte 14 # DW_CFA_def_cfa_offset
230 .byte 4 # DW_CFA_advance_loc4
231 .long clear_once_control-.Ladd
232 .byte 14 # DW_CFA_def_cfa_offset
235 .byte 4 # DW_CFA_advance_loc4
236 .long .Lpop_rdi2-clear_once_control
237 .byte 14 # DW_CFA_def_cfa_offset
245 .hidden DW.ref.__gcc_personality_v0
246 .weak DW.ref.__gcc_personality_v0
247 .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
249 .type DW.ref.__gcc_personality_v0, @object
250 .size DW.ref.__gcc_personality_v0, 8
251 DW.ref.__gcc_personality_v0:
252 .quad __gcc_personality_v0