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 "lowlevel-atomic.h"
27 #define SYS_gettimeofday __NR_gettimeofday
32 # error "code needs to be rewritten for VALUE != 0"
38 .type sem_timedwait,@function
49 CMPXCHG (r6, @r4, r3, r2)
56 /* Check whether the timeout value is valid. */
72 /* Check for invalid nanosecond field. */
78 INC (@(NWAITERS,r8),r2)
81 /* Compute relative timeout. */
84 mov #SYS_gettimeofday, r3
90 dmulu.l r0, r1 /* Milli seconds to nano seconds. */
104 bf/s 6f /* Time is already up. */
107 /* Store relative timeout. */
120 mov.l @(PRIVATE,r8), r5
122 mov.l @(PRIVATE,r8), r5
143 cmp/eq #-EWOULDBLOCK, r0
154 CMPXCHG (r4, @r8, r3, r2)
158 DEC (@(NWAITERS,r8), r2)
192 DEC (@(NWAITERS,r8), r2)
202 .long _GLOBAL_OFFSET_TABLE_
208 .long __errno_location@PLT-(.Lerrloc2b-.)
211 .long __pthread_enable_asynccancel-.Lenable0b
213 .long __pthread_disable_asynccancel-.Ldisable0b
214 .size sem_timedwait,.-sem_timedwait
216 .type sem_wait_cleanup,@function
218 DEC (@(NWAITERS,r8), r2)
231 .long _Unwind_Resume@GOTOFF
236 .size sem_wait_cleanup,.-sem_wait_cleanup
239 .section .gcc_except_table,"a",@progbits
241 .byte 0xff ! @LPStart format (omit)
242 .byte 0xff ! @TType format (omit)
243 .byte 0x01 ! call-site format
245 .uleb128 .Lcstend-.Lcstbegin
247 .uleb128 .LcleanupSTART-.LSTARTCODE
248 .uleb128 .LcleanupEND-.LcleanupSTART
249 .uleb128 sem_wait_cleanup-.LSTARTCODE
251 .uleb128 .LcallUR-.LSTARTCODE
252 .uleb128 .LENDCODE-.LcallUR
258 .section .eh_frame,"a",@progbits
260 .ualong .LENDCIE-.LSTARTCIE ! Length of the CIE.
263 .byte 1 ! Version number.
265 .string "zPLR" ! NUL-terminated augmentation
268 .string "zPL" ! NUL-terminated augmentation
271 .uleb128 1 ! Code alignment factor.
272 .sleb128 -4 ! Data alignment factor.
273 .byte 0x11 ! Return address register
276 .uleb128 7 ! Augmentation value length.
277 .byte 0x9b ! Personality: DW_EH_PE_pcrel
279 ! + DW_EH_PE_indirect
280 .ualong DW.ref.__gcc_personality_v0-.
281 .byte 0x1b ! LSDA Encoding: DW_EH_PE_pcrel
283 .byte 0x1b ! FDE Encoding: DW_EH_PE_pcrel
286 .uleb128 6 ! Augmentation value length.
287 .byte 0x0 ! Personality: absolute
288 .ualong __gcc_personality_v0
289 .byte 0x0 ! LSDA Encoding: absolute
291 .byte 0x0c ! DW_CFA_def_cfa
297 .ualong .LENDFDE-.LSTARTFDE ! Length of the FDE.
299 .ualong .LSTARTFDE-.LSTARTFRAME ! CIE pointer.
301 .ualong .LSTARTCODE-. ! PC-relative start address
304 .ualong .LSTARTCODE ! Start address of the code.
306 .ualong .LENDCODE-.LSTARTCODE ! Length of the code.
307 .uleb128 4 ! Augmentation size
309 .ualong .LexceptSTART-.
311 .ualong .LexceptSTART
314 .byte 4 ! DW_CFA_advance_loc4
315 .ualong .Lpush_r8-.LSTARTCODE
316 .byte 14 ! DW_CFA_def_cfa_offset
318 .byte 0x88 ! DW_CFA_offset r8
320 .byte 4 ! DW_CFA_advance_loc4
321 .ualong .Lpush_r9-.Lpush_r8
322 .byte 14 ! DW_CFA_def_cfa_offset
324 .byte 0x89 ! DW_CFA_offset r9
326 .byte 4 ! DW_CFA_advance_loc4
327 .ualong .Lpush_r10-.Lpush_r9
328 .byte 14 ! DW_CFA_def_cfa_offset
330 .byte 0x8a ! DW_CFA_offset r10
332 .byte 4 ! DW_CFA_advance_loc4
333 .ualong .Lpush_r12-.Lpush_r10
334 .byte 14 ! DW_CFA_def_cfa_offset
336 .byte 0x8c ! DW_CFA_offset r12
338 .byte 4 ! DW_CFA_advance_loc4
339 .ualong .Lpush_pr-.Lpush_r12
340 .byte 14 ! DW_CFA_def_cfa_offset
342 .byte 0x91 ! DW_CFA_offset pr
344 .byte 4 ! DW_CFA_advance_loc4
345 .ualong .Lalloc-.Lpush_pr
346 .byte 14 ! DW_CFA_def_cfa_offset
353 .hidden DW.ref.__gcc_personality_v0
354 .weak DW.ref.__gcc_personality_v0
355 .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
357 .type DW.ref.__gcc_personality_v0, @object
358 .size DW.ref.__gcc_personality_v0, 4
359 DW.ref.__gcc_personality_v0:
360 .long __gcc_personality_v0