1 /* Copyright (C) 2002,2003,2005,2007,2008,2011-2012
2 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
21 #include <shlib-compat.h>
22 #include <pthread-errnos.h>
23 #include <structsem.h>
24 #include <lowlevellock.h>
30 .type __new_sem_post,@function
35 cfi_adjust_cfa_offset(4)
43 movl VALUE(%ebx), %eax
45 0: cmpl $SEM_VALUE_MAX, %eax
52 cmpxchgl %edx, VALUE(%ebx)
56 cmpl $0, NWAITERS(%ebx)
59 movl $FUTEX_WAKE, %ecx
60 orl PRIVATE(%ebx), %ecx
70 cfi_adjust_cfa_offset(-4)
74 cfi_adjust_cfa_offset(4)
83 addl $_GLOBAL_OFFSET_TABLE_, %ebx
84 #ifdef NO_TLS_DIRECT_SEG_REFS
85 movl errno@gotntpoff(%ebx), %edx
89 movl errno@gotntpoff(%ebx), %edx
90 movl $EINVAL, %gs:(%edx)
104 addl $_GLOBAL_OFFSET_TABLE_, %ebx
105 #ifdef NO_TLS_DIRECT_SEG_REFS
106 movl errno@gotntpoff(%ebx), %edx
108 movl $EOVERFLOW, (%edx)
110 movl errno@gotntpoff(%ebx), %edx
111 movl $EOVERFLOW, %gs:(%edx)
116 cfi_adjust_cfa_offset(-4)
120 .size __new_sem_post,.-__new_sem_post
121 versioned_symbol(libpthread, __new_sem_post, sem_post, GLIBC_2_1)
122 #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
123 .global __old_sem_post
124 .type __old_sem_post,@function
128 cfi_adjust_cfa_offset(4)
135 movl $SYS_futex, %eax
136 movl $FUTEX_WAKE, %ecx
145 cfi_adjust_cfa_offset(-4)
149 .size __old_sem_post,.-__old_sem_post
150 compat_symbol(libpthread, __old_sem_post, sem_post, GLIBC_2_0)