1 /* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 #include <shlib-compat.h>
21 #include <pthread-errnos.h>
22 #include <tcb-offsets.h>
23 #include <structsem.h>
24 #include <lowlevellock.h>
25 #include "lowlevel-atomic.h"
29 # error "code needs to be rewritten for VALUE != 0"
35 .type sem_timedwait,@function
46 CMPXCHG (r6, @r4, r3, r2)
53 /* Check whether the timeout value is valid. */
69 /* Check for invalid nanosecond field. */
75 INC (@(NWAITERS,r8),r2)
78 /* Compute relative timeout. */
81 mov #__NR_gettimeofday, r3
87 dmulu.l r0, r1 /* Milli seconds to nano seconds. */
101 bf/s 6f /* Time is already up. */
104 /* Store relative timeout. */
117 mov.l @(PRIVATE,r8), r5
119 mov.l @(PRIVATE,r8), r5
140 cmp/eq #-EWOULDBLOCK, r0
151 CMPXCHG (r4, @r8, r3, r2)
155 DEC (@(NWAITERS,r8), r2)
193 DEC (@(NWAITERS,r8), r2)
203 .long _GLOBAL_OFFSET_TABLE_
206 .long __errno_location@PLT-(.Lerrloc2b-.)
209 .long __pthread_enable_asynccancel-.Lenable0b
211 .long __pthread_disable_asynccancel-.Ldisable0b
212 .size sem_timedwait,.-sem_timedwait
214 .type sem_wait_cleanup,@function
216 DEC (@(NWAITERS,r8), r2)
229 .long _Unwind_Resume@GOTOFF
234 .size sem_wait_cleanup,.-sem_wait_cleanup
237 .section .gcc_except_table,"a",@progbits
239 .byte 0xff ! @LPStart format (omit)
240 .byte 0xff ! @TType format (omit)
241 .byte 0x01 ! call-site format
243 .uleb128 .Lcstend-.Lcstbegin
245 .uleb128 .LcleanupSTART-.LSTARTCODE
246 .uleb128 .LcleanupEND-.LcleanupSTART
247 .uleb128 sem_wait_cleanup-.LSTARTCODE
249 .uleb128 .LcallUR-.LSTARTCODE
250 .uleb128 .LENDCODE-.LcallUR
256 .section .eh_frame,"a",@progbits
258 .ualong .LENDCIE-.LSTARTCIE ! Length of the CIE.
261 .byte 1 ! Version number.
263 .string "zPLR" ! NUL-terminated augmentation
266 .string "zPL" ! NUL-terminated augmentation
269 .uleb128 1 ! Code alignment factor.
270 .sleb128 -4 ! Data alignment factor.
271 .byte 0x11 ! Return address register
274 .uleb128 7 ! Augmentation value length.
275 .byte 0x9b ! Personality: DW_EH_PE_pcrel
277 ! + DW_EH_PE_indirect
278 .ualong DW.ref.__gcc_personality_v0-.
279 .byte 0x1b ! LSDA Encoding: DW_EH_PE_pcrel
281 .byte 0x1b ! FDE Encoding: DW_EH_PE_pcrel
284 .uleb128 6 ! Augmentation value length.
285 .byte 0x0 ! Personality: absolute
286 .ualong __gcc_personality_v0
287 .byte 0x0 ! LSDA Encoding: absolute
289 .byte 0x0c ! DW_CFA_def_cfa
295 .ualong .LENDFDE-.LSTARTFDE ! Length of the FDE.
297 .ualong .LSTARTFDE-.LSTARTFRAME ! CIE pointer.
299 .ualong .LSTARTCODE-. ! PC-relative start address
302 .ualong .LSTARTCODE ! Start address of the code.
304 .ualong .LENDCODE-.LSTARTCODE ! Length of the code.
305 .uleb128 4 ! Augmentation size
307 .ualong .LexceptSTART-.
309 .ualong .LexceptSTART
312 .byte 4 ! DW_CFA_advance_loc4
313 .ualong .Lpush_r8-.LSTARTCODE
314 .byte 14 ! DW_CFA_def_cfa_offset
316 .byte 0x88 ! DW_CFA_offset r8
318 .byte 4 ! DW_CFA_advance_loc4
319 .ualong .Lpush_r9-.Lpush_r8
320 .byte 14 ! DW_CFA_def_cfa_offset
322 .byte 0x89 ! DW_CFA_offset r9
324 .byte 4 ! DW_CFA_advance_loc4
325 .ualong .Lpush_r10-.Lpush_r9
326 .byte 14 ! DW_CFA_def_cfa_offset
328 .byte 0x8a ! DW_CFA_offset r10
330 .byte 4 ! DW_CFA_advance_loc4
331 .ualong .Lpush_r12-.Lpush_r10
332 .byte 14 ! DW_CFA_def_cfa_offset
334 .byte 0x8c ! DW_CFA_offset r12
336 .byte 4 ! DW_CFA_advance_loc4
337 .ualong .Lpush_pr-.Lpush_r12
338 .byte 14 ! DW_CFA_def_cfa_offset
340 .byte 0x91 ! DW_CFA_offset pr
342 .byte 4 ! DW_CFA_advance_loc4
343 .ualong .Lalloc-.Lpush_pr
344 .byte 14 ! DW_CFA_def_cfa_offset
351 .hidden DW.ref.__gcc_personality_v0
352 .weak DW.ref.__gcc_personality_v0
353 .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
355 .type DW.ref.__gcc_personality_v0, @object
356 .size DW.ref.__gcc_personality_v0, 4
357 DW.ref.__gcc_personality_v0:
358 .long __gcc_personality_v0