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 <lowlevellock.h>
22 #include <shlib-compat.h>
23 #include <pthread-errnos.h>
24 #include <structsem.h>
30 .type sem_wait,@function
43 movl VALUE(%r13), %eax
53 cmpxchgl %edx, VALUE(%r13)
68 addq $1, NWAITERS(%r13)
71 6: call __pthread_enable_asynccancel
78 movl PRIVATE(%rdi), %esi
80 movl $FUTEX_WAIT, %esi
81 orl PRIVATE(%rdi), %esi
88 call __pthread_disable_asynccancel
93 cmpq $-EWOULDBLOCK, %r12
100 movl VALUE(%r13), %eax
108 cmpxchgl %edx, (%r13)
110 cmpxchgl %edx, VALUE(%r13)
115 subq $1, NWAITERS(%r13)
120 movq errno@gottpoff(%rip), %rdx
121 movl %r12d, %fs:(%rdx)
123 callq __errno_location@plt
129 subq $1, NWAITERS(%r13)
132 .size sem_wait,.-sem_wait
135 .type sem_wait_cleanup,@function
138 subq $1, NWAITERS(%r13)
141 call _Unwind_Resume@PLT
144 .size sem_wait_cleanup,.-sem_wait_cleanup
147 .section .gcc_except_table,"a",@progbits
149 .byte 0xff # @LPStart format (omit)
150 .byte 0xff # @TType format (omit)
151 .byte 0x01 # call-site format
153 .uleb128 .Lcstend-.Lcstbegin
155 .uleb128 .LcleanupSTART-.LSTARTCODE
156 .uleb128 .LcleanupEND-.LcleanupSTART
157 .uleb128 sem_wait_cleanup-.LSTARTCODE
159 .uleb128 .LcallUR-.LSTARTCODE
160 .uleb128 .LENDCODE-.LcallUR
166 .section .eh_frame,"a",@progbits
168 .long .LENDCIE-.LSTARTCIE # Length of the CIE.
171 .byte 1 # Version number.
173 .string "zPLR" # NUL-terminated augmentation
176 .string "zPL" # NUL-terminated augmentation
179 .uleb128 1 # Code alignment factor.
180 .sleb128 -8 # Data alignment factor.
181 .byte 16 # Return address register
184 .uleb128 7 # Augmentation value length.
185 .byte 0x9b # Personality: DW_EH_PE_pcrel
187 # + DW_EH_PE_indirect
188 .long DW.ref.__gcc_personality_v0-.
189 .byte 0x1b # LSDA Encoding: DW_EH_PE_pcrel
191 .byte 0x1b # FDE Encoding: DW_EH_PE_pcrel
194 .uleb128 10 # Augmentation value length.
195 .byte 0x0 # Personality: absolute
196 .quad __gcc_personality_v0
197 .byte 0x0 # LSDA Encoding: absolute
199 .byte 0x0c # DW_CFA_def_cfa
202 .byte 0x90 # DW_CFA_offset, column 0x10
207 .long .LENDFDE-.LSTARTFDE # Length of the FDE.
209 .long .LSTARTFDE-.LSTARTFRAME # CIE pointer.
211 .long .LSTARTCODE-. # PC-relative start address
213 .long .LENDCODE-.LSTARTCODE # Length of the code.
214 .uleb128 4 # Augmentation size
215 .long .LexceptSTART-.
217 .quad .LSTARTCODE # Start address of the code.
218 .quad .LENDCODE-.LSTARTCODE # Length of the code.
219 .uleb128 8 # Augmentation size
223 .byte 4 # DW_CFA_advance_loc4
224 .long .Lpush_r12-.LSTARTCODE
225 .byte 14 # DW_CFA_def_cfa_offset
227 .byte 0x8c # DW_CFA_offset %r12
229 .byte 4 # DW_CFA_advance_loc4
230 .long .Lpush_r13-.Lpush_r12
231 .byte 14 # DW_CFA_def_cfa_offset
233 .byte 0x8d # DW_CFA_offset %r13
235 .byte 4 # DW_CFA_advance_loc4
236 .long .Lpop_r13-.Lpush_r13
237 .byte 14 # DW_CFA_def_cfa_offset
239 .byte 0xcd # DW_CFA_restore %r13
240 .byte 4 # DW_CFA_advance_loc4
241 .long .Lpop_r12-.Lpop_r13
242 .byte 14 # DW_CFA_def_cfa_offset
244 .byte 0xcc # DW_CFA_restore %r12
245 .byte 4 # DW_CFA_advance_loc4
246 .long .Lafter_retq-.Lpop_r12
247 .byte 14 # DW_CFA_def_cfa_offset
249 .byte 0x8c # DW_CFA_offset %r12
251 .byte 0x8d # DW_CFA_offset %r13
258 .hidden DW.ref.__gcc_personality_v0
259 .weak DW.ref.__gcc_personality_v0
260 .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
262 .type DW.ref.__gcc_personality_v0, @object
263 .size DW.ref.__gcc_personality_v0, 8
264 DW.ref.__gcc_personality_v0:
265 .quad __gcc_personality_v0