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, see
16 <http://www.gnu.org/licenses/>. */
19 #include <pthread-errnos.h>
20 #include <tcb-offsets.h>
21 #include <structsem.h>
22 #include <lowlevellock.h>
23 #include "lowlevel-atomic.h"
27 # error "code needs to be rewritten for VALUE != 0"
33 .type sem_timedwait,@function
44 CMPXCHG (r6, @r4, r3, r2)
51 /* Check whether the timeout value is valid. */
67 /* Check for invalid nanosecond field. */
73 INC (@(NWAITERS,r8),r2)
76 /* Compute relative timeout. */
79 mov #__NR_gettimeofday, r3
85 dmulu.l r0, r1 /* Milli seconds to nano seconds. */
99 bf/s 6f /* Time is already up. */
102 /* Store relative timeout. */
115 mov.l @(PRIVATE,r8), r5
117 mov.l @(PRIVATE,r8), r5
138 cmp/eq #-EWOULDBLOCK, r0
149 CMPXCHG (r4, @r8, r3, r2)
153 DEC (@(NWAITERS,r8), r2)
191 DEC (@(NWAITERS,r8), r2)
201 .long _GLOBAL_OFFSET_TABLE_
204 .long __errno_location@PLT-(.Lerrloc2b-.)
207 .long __pthread_enable_asynccancel-.Lenable0b
209 .long __pthread_disable_asynccancel-.Ldisable0b
210 .size sem_timedwait,.-sem_timedwait
212 .type sem_wait_cleanup,@function
214 DEC (@(NWAITERS,r8), r2)
227 .long _Unwind_Resume@GOTOFF
232 .size sem_wait_cleanup,.-sem_wait_cleanup
235 .section .gcc_except_table,"a",@progbits
237 .byte 0xff ! @LPStart format (omit)
238 .byte 0xff ! @TType format (omit)
239 .byte 0x01 ! call-site format
241 .uleb128 .Lcstend-.Lcstbegin
243 .uleb128 .LcleanupSTART-.LSTARTCODE
244 .uleb128 .LcleanupEND-.LcleanupSTART
245 .uleb128 sem_wait_cleanup-.LSTARTCODE
247 .uleb128 .LcallUR-.LSTARTCODE
248 .uleb128 .LENDCODE-.LcallUR
254 .section .eh_frame,"a",@progbits
256 .ualong .LENDCIE-.LSTARTCIE ! Length of the CIE.
259 .byte 1 ! Version number.
261 .string "zPLR" ! NUL-terminated augmentation
264 .string "zPL" ! NUL-terminated augmentation
267 .uleb128 1 ! Code alignment factor.
268 .sleb128 -4 ! Data alignment factor.
269 .byte 0x11 ! Return address register
272 .uleb128 7 ! Augmentation value length.
273 .byte 0x9b ! Personality: DW_EH_PE_pcrel
275 ! + DW_EH_PE_indirect
276 .ualong DW.ref.__gcc_personality_v0-.
277 .byte 0x1b ! LSDA Encoding: DW_EH_PE_pcrel
279 .byte 0x1b ! FDE Encoding: DW_EH_PE_pcrel
282 .uleb128 6 ! Augmentation value length.
283 .byte 0x0 ! Personality: absolute
284 .ualong __gcc_personality_v0
285 .byte 0x0 ! LSDA Encoding: absolute
287 .byte 0x0c ! DW_CFA_def_cfa
293 .ualong .LENDFDE-.LSTARTFDE ! Length of the FDE.
295 .ualong .LSTARTFDE-.LSTARTFRAME ! CIE pointer.
297 .ualong .LSTARTCODE-. ! PC-relative start address
300 .ualong .LSTARTCODE ! Start address of the code.
302 .ualong .LENDCODE-.LSTARTCODE ! Length of the code.
303 .uleb128 4 ! Augmentation size
305 .ualong .LexceptSTART-.
307 .ualong .LexceptSTART
310 .byte 4 ! DW_CFA_advance_loc4
311 .ualong .Lpush_r8-.LSTARTCODE
312 .byte 14 ! DW_CFA_def_cfa_offset
314 .byte 0x88 ! DW_CFA_offset r8
316 .byte 4 ! DW_CFA_advance_loc4
317 .ualong .Lpush_r9-.Lpush_r8
318 .byte 14 ! DW_CFA_def_cfa_offset
320 .byte 0x89 ! DW_CFA_offset r9
322 .byte 4 ! DW_CFA_advance_loc4
323 .ualong .Lpush_r10-.Lpush_r9
324 .byte 14 ! DW_CFA_def_cfa_offset
326 .byte 0x8a ! DW_CFA_offset r10
328 .byte 4 ! DW_CFA_advance_loc4
329 .ualong .Lpush_r12-.Lpush_r10
330 .byte 14 ! DW_CFA_def_cfa_offset
332 .byte 0x8c ! DW_CFA_offset r12
334 .byte 4 ! DW_CFA_advance_loc4
335 .ualong .Lpush_pr-.Lpush_r12
336 .byte 14 ! DW_CFA_def_cfa_offset
338 .byte 0x91 ! DW_CFA_offset pr
340 .byte 4 ! DW_CFA_advance_loc4
341 .ualong .Lalloc-.Lpush_pr
342 .byte 14 ! DW_CFA_def_cfa_offset
349 .hidden DW.ref.__gcc_personality_v0
350 .weak DW.ref.__gcc_personality_v0
351 .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
353 .type DW.ref.__gcc_personality_v0, @object
354 .size DW.ref.__gcc_personality_v0, 4
355 DW.ref.__gcc_personality_v0:
356 .long __gcc_personality_v0