1 /* Copyright (C) 2002, 2003, 2005, 2007 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
21 #include <shlib-compat.h>
22 #include <pthread-errnos.h>
23 #include <structsem.h>
38 .type sem_wait,@function
51 movl VALUE(%r13), %eax
61 cmpxchgl %edx, VALUE(%r13)
76 addq $1, NWAITERS(%r13)
79 6: call __pthread_enable_asynccancel
86 movl PRIVATE(%rdi), %esi
88 movl $FUTEX_WAIT, %esi
89 orl PRIVATE(%rdi), %esi
96 call __pthread_disable_asynccancel
101 cmpq $-EWOULDBLOCK, %r12
108 movl VALUE(%r13), %eax
116 cmpxchgl %edx, (%r13)
118 cmpxchgl %edx, VALUE(%r13)
123 subq $1, NWAITERS(%r13)
128 movq errno@gottpoff(%rip), %rdx
129 movl %r12d, %fs:(%rdx)
131 callq __errno_location@plt
137 subq $1, NWAITERS(%r13)
140 .size sem_wait,.-sem_wait
143 .type sem_wait_cleanup,@function
146 subq $1, NWAITERS(%r13)
149 call _Unwind_Resume@PLT
152 .size sem_wait_cleanup,.-sem_wait_cleanup
155 .section .gcc_except_table,"a",@progbits
157 .byte 0xff # @LPStart format (omit)
158 .byte 0xff # @TType format (omit)
159 .byte 0x01 # call-site format
161 .uleb128 .Lcstend-.Lcstbegin
163 .uleb128 .LcleanupSTART-.LSTARTCODE
164 .uleb128 .LcleanupEND-.LcleanupSTART
165 .uleb128 sem_wait_cleanup-.LSTARTCODE
167 .uleb128 .LcallUR-.LSTARTCODE
168 .uleb128 .LENDCODE-.LcallUR
174 .section .eh_frame,"a",@progbits
176 .long .LENDCIE-.LSTARTCIE # Length of the CIE.
179 .byte 1 # Version number.
181 .string "zPLR" # NUL-terminated augmentation
184 .string "zPL" # NUL-terminated augmentation
187 .uleb128 1 # Code alignment factor.
188 .sleb128 -8 # Data alignment factor.
189 .byte 16 # Return address register
192 .uleb128 7 # Augmentation value length.
193 .byte 0x9b # Personality: DW_EH_PE_pcrel
195 # + DW_EH_PE_indirect
196 .long DW.ref.__gcc_personality_v0-.
197 .byte 0x1b # LSDA Encoding: DW_EH_PE_pcrel
199 .byte 0x1b # FDE Encoding: DW_EH_PE_pcrel
202 .uleb128 10 # Augmentation value length.
203 .byte 0x0 # Personality: absolute
204 .quad __gcc_personality_v0
205 .byte 0x0 # LSDA Encoding: absolute
207 .byte 0x0c # DW_CFA_def_cfa
210 .byte 0x90 # DW_CFA_offset, column 0x10
215 .long .LENDFDE-.LSTARTFDE # Length of the FDE.
217 .long .LSTARTFDE-.LSTARTFRAME # CIE pointer.
219 .long .LSTARTCODE-. # PC-relative start address
221 .long .LENDCODE-.LSTARTCODE # Length of the code.
222 .uleb128 4 # Augmentation size
223 .long .LexceptSTART-.
225 .quad .LSTARTCODE # Start address of the code.
226 .quad .LENDCODE-.LSTARTCODE # Length of the code.
227 .uleb128 8 # Augmentation size
231 .byte 4 # DW_CFA_advance_loc4
232 .long .Lpush_r12-.LSTARTCODE
233 .byte 14 # DW_CFA_def_cfa_offset
235 .byte 0x8c # DW_CFA_offset %r12
237 .byte 4 # DW_CFA_advance_loc4
238 .long .Lpush_r13-.Lpush_r12
239 .byte 14 # DW_CFA_def_cfa_offset
241 .byte 0x8d # DW_CFA_offset %r13
243 .byte 4 # DW_CFA_advance_loc4
244 .long .Lpop_r13-.Lpush_r13
245 .byte 14 # DW_CFA_def_cfa_offset
247 .byte 0xcd # DW_CFA_restore %r13
248 .byte 4 # DW_CFA_advance_loc4
249 .long .Lpop_r12-.Lpop_r13
250 .byte 14 # DW_CFA_def_cfa_offset
252 .byte 0xcc # DW_CFA_restore %r12
253 .byte 4 # DW_CFA_advance_loc4
254 .long .Lafter_retq-.Lpop_r12
255 .byte 14 # DW_CFA_def_cfa_offset
257 .byte 0x8c # DW_CFA_offset %r12
259 .byte 0x8d # DW_CFA_offset %r13
266 .hidden DW.ref.__gcc_personality_v0
267 .weak DW.ref.__gcc_personality_v0
268 .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
270 .type DW.ref.__gcc_personality_v0, @object
271 .size DW.ref.__gcc_personality_v0, 8
272 DW.ref.__gcc_personality_v0:
273 .quad __gcc_personality_v0