1 /* Copyright (C) 2002, 2003, 2004, 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>
31 #define SYS_gettimeofday __NR_gettimeofday
37 # error "code needs to be rewritten for VALUE != 0"
44 .type sem_timedwait,@function
62 /* Check whether the timeout value is valid. */
74 /* Check for invalid nanosecond field. */
75 cmpl $1000000000, 4(%edi)
85 movl $SYS_gettimeofday, %eax
88 /* Compute relative timeout. */
91 mul %edx /* Milli seconds to nano seconds. */
97 addl $1000000000, %edx
100 movl $ETIMEDOUT, %esi
101 js 6f /* Time is already up. */
103 movl %ecx, (%esp) /* Store relative timeout. */
107 call __pthread_enable_asynccancel
110 movl 28(%esp), %ebx /* Load semaphore address. */
112 movl PRIVATE(%ebx), %ecx
114 movl $FUTEX_WAIT, %ecx
115 orl PRIVATE(%ebx), %ecx
119 movl $SYS_futex, %eax
124 call __pthread_disable_asynccancel
129 cmpl $-EWOULDBLOCK, %esi
138 cmpxchgl %ecx, (%ebx)
160 call __i686.get_pc_thunk.bx
165 addl $_GLOBAL_OFFSET_TABLE_, %ebx
167 # ifdef NO_TLS_DIRECT_SEG_REFS
168 movl errno@gotntpoff(%ebx), %edx
172 movl errno@gotntpoff(%ebx), %edx
173 movl %esi, %gs:(%edx)
176 call __errno_location@plt
180 movl 28(%esp), %ebx /* Load semaphore address. */
183 .size sem_timedwait,.-sem_timedwait
186 .type sem_wait_cleanup,@function
192 call _Unwind_Resume@PLT
195 .size sem_wait_cleanup,.-sem_wait_cleanup
198 .section .gcc_except_table,"a",@progbits
200 .byte 0xff # @LPStart format (omit)
201 .byte 0xff # @TType format (omit)
202 .byte 0x01 # call-site format
204 .uleb128 .Lcstend-.Lcstbegin
206 .uleb128 .LcleanupSTART-.LSTARTCODE
207 .uleb128 .LcleanupEND-.LcleanupSTART
208 .uleb128 sem_wait_cleanup-.LSTARTCODE
210 .uleb128 .LcallUR-.LSTARTCODE
211 .uleb128 .LENDCODE-.LcallUR
217 .section .eh_frame,"a",@progbits
219 .long .LENDCIE-.LSTARTCIE # Length of the CIE.
222 .byte 1 # Version number.
224 .string "zPLR" # NUL-terminated augmentation
227 .string "zPL" # NUL-terminated augmentation
230 .uleb128 1 # Code alignment factor.
231 .sleb128 -4 # Data alignment factor.
232 .byte 8 # Return address register
235 .uleb128 7 # Augmentation value length.
236 .byte 0x9b # Personality: DW_EH_PE_pcrel
238 # + DW_EH_PE_indirect
239 .long DW.ref.__gcc_personality_v0-.
240 .byte 0x1b # LSDA Encoding: DW_EH_PE_pcrel
242 .byte 0x1b # FDE Encoding: DW_EH_PE_pcrel
245 .uleb128 6 # Augmentation value length.
246 .byte 0x0 # Personality: absolute
247 .long __gcc_personality_v0
248 .byte 0x0 # LSDA Encoding: absolute
250 .byte 0x0c # DW_CFA_def_cfa
253 .byte 0x88 # DW_CFA_offset, column 0x10
258 .long .LENDFDE-.LSTARTFDE # Length of the FDE.
260 .long .LSTARTFDE-.LSTARTFRAME # CIE pointer.
262 .long .LSTARTCODE-. # PC-relative start address
265 .long .LSTARTCODE # Start address of the code.
267 .long .LENDCODE-.LSTARTCODE # Length of the code.
268 .uleb128 4 # Augmentation size
270 .long .LexceptSTART-.
275 .byte 4 # DW_CFA_advance_loc4
276 .long .Lpush_esi-.LSTARTCODE
277 .byte 14 # DW_CFA_def_cfa_offset
279 .byte 0x86 # DW_CFA_offset %esi
281 .byte 4 # DW_CFA_advance_loc4
282 .long .Lpush_edi-.Lpush_esi
283 .byte 14 # DW_CFA_def_cfa_offset
285 .byte 0x87 # DW_CFA_offset %edi
287 .byte 4 # DW_CFA_advance_loc4
288 .long .Lpush_ebx-.Lpush_edi
289 .byte 14 # DW_CFA_def_cfa_offset
291 .byte 0x83 # DW_CFA_offset %ebx
293 .byte 4 # DW_CFA_advance_loc4
294 .long .Lsub_esp-.Lpush_ebx
295 .byte 14 # DW_CFA_def_cfa_offset
297 .byte 4 # DW_CFA_advance_loc4
298 .long .Ladd_esp-.Lsub_esp
299 .byte 14 # DW_CFA_def_cfa_offset
301 .byte 4 # DW_CFA_advance_loc4
302 .long .Lpop_ebx-.Ladd_esp
303 .byte 14 # DW_CFA_def_cfa_offset
305 .byte 0xc3 # DW_CFA_restore %ebx
306 .byte 4 # DW_CFA_advance_loc4
307 .long .Lpop_edi-.Lpop_ebx
308 .byte 14 # DW_CFA_def_cfa_offset
310 .byte 0xc7 # DW_CFA_restore %edi
311 .byte 4 # DW_CFA_advance_loc4
312 .long .Lpop_esi-.Lpop_edi
313 .byte 14 # DW_CFA_def_cfa_offset
315 .byte 0xc6 # DW_CFA_restore %esi
316 .byte 4 # DW_CFA_advance_loc4
317 .long .Lafter_ret-.Lpop_esi
318 .byte 14 # DW_CFA_def_cfa_offset
320 .byte 0x86 # DW_CFA_offset %esi
322 .byte 0x87 # DW_CFA_offset %edi
324 .byte 0x83 # DW_CFA_offset %ebx
331 .hidden DW.ref.__gcc_personality_v0
332 .weak DW.ref.__gcc_personality_v0
333 .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
335 .type DW.ref.__gcc_personality_v0, @object
336 .size DW.ref.__gcc_personality_v0, 4
337 DW.ref.__gcc_personality_v0:
338 .long __gcc_personality_v0