1 /* Copyright (C) 2002 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>
31 #define SYS_gettimeofday __NR_gettimeofday
37 #define EWOULDBLOCK EAGAIN
43 .type __new_sem_wait,@function
73 cmpl $-EWOULDBLOCK, %eax
77 call __i686.get_pc_thunk.bx
82 addl $_GLOBAL_OFFSET_TABLE_, %ebx
84 subl errno@gottpoff(%ebx), %edx
90 .size __new_sem_wait,.-__new_sem_wait
91 .symver __new_sem_wait, sem_wait@@GLIBC_2.1
92 #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
93 .global __old_sem_wait
94 __old_sem_wait = __new_sem_wait
95 .symver __old_sem_wait, sem_wait@GLIBC_2.0
99 .globl __new_sem_trywait
100 .type __new_sem_trywait,@function
111 cmpxchgl %edx, (%ecx)
118 call __i686.get_pc_thunk.cx
123 addl $_GLOBAL_OFFSET_TABLE_, %ecx
125 subl errno@gottpoff(%ecx), %edx
129 .size __new_sem_trywait,.-__new_sem_trywait
130 .symver __new_sem_trywait, sem_trywait@@GLIBC_2.1
131 #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
132 .global __old_sem_trywait
133 __old_sem_trywait = __new_sem_trywait
134 .symver __old_sem_trywait, sem_trywait@GLIBC_2.0
139 .type sem_timedwait,@function
150 cmpxchgl %edx, (%ecx)
156 /* Check whether the timeout value is valid. */
165 /* Check for invalid nanosecond field. */
166 cmpl $1000000000, 4(%edi)
173 movl $SYS_gettimeofday, %eax
176 /* Compute relative timeout. */
179 mul %edx /* Milli seconds to nano seconds. */
185 addl $1000000000, %edx
188 movl $ETIMEDOUT, %eax
189 js 6f /* Time is already up. */
191 movl %ecx, (%esp) /* Store relative timeout. */
195 movl $SYS_futex, %eax
201 cmpl $-EWOULDBLOCK, %eax
210 cmpxchgl %ecx, (%ebx)
223 call __i686.get_pc_thunk.bx
228 addl $_GLOBAL_OFFSET_TABLE_, %ebx
230 subl errno@gottpoff(%ebx), %edx
239 .size sem_timedwait,.-sem_timedwait
242 .globl __new_sem_post
243 .type __new_sem_post,@function
255 movl $SYS_futex, %eax
256 movl $FUTEX_WAKE, %ecx
269 call __i686.get_pc_thunk.bx
274 addl $_GLOBAL_OFFSET_TABLE_, %ebx
276 subl errno@gottpoff(%ebx), %edx
283 .size __new_sem_post,.-__new_sem_post
284 .symver __new_sem_post, sem_post@@GLIBC_2.1
285 #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
286 .global __old_sem_post
287 __old_sem_post = __new_sem_post
288 .symver __old_sem_post, sem_post@GLIBC_2.0
293 .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
294 .globl __i686.get_pc_thunk.bx
295 .hidden __i686.get_pc_thunk.bx
296 .type __i686.get_pc_thunk.bx,@function
297 __i686.get_pc_thunk.bx:
300 .size __i686.get_pc_thunk.bx,.-__i686.get_pc_thunk.bx
303 .section .gnu.linkonce.t.__i686.get_pc_thunk.cx,"ax",@progbits
304 .globl __i686.get_pc_thunk.cx
305 .hidden __i686.get_pc_thunk.cx
306 .type __i686.get_pc_thunk.cx,@function
307 __i686.get_pc_thunk.cx:
310 .size __i686.get_pc_thunk.cx,.-__i686.get_pc_thunk.cx