]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
Update copyright notices with scripts/update-copyrights
[thirdparty/glibc.git] / nptl / sysdeps / unix / sysv / linux / i386 / i486 / pthread_barrier_wait.S
index 29857195f0b48aced2d8768bd0432448a5af520d..aa755a1737edf0c133da358ce0dd006f03f25f78 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <lowlevellock.h>
 #include <lowlevelbarrier.h>
 
-#define SYS_futex      240
-#define FUTEX_WAIT     0
-#define FUTEX_WAKE     1
-
-#ifndef UP
-# define LOCK lock
-#else
-# define LOCK
-#endif
-
-
        .text
 
        .globl  pthread_barrier_wait
        .type   pthread_barrier_wait,@function
        .align  16
 pthread_barrier_wait:
+       cfi_startproc
        pushl   %ebx
+       cfi_adjust_cfa_offset(4)
+       cfi_offset(%ebx, -8)
 
        movl    8(%esp), %ebx
 
@@ -55,6 +47,8 @@ pthread_barrier_wait:
 
        /* There are more threads to come.  */
        pushl   %esi
+       cfi_adjust_cfa_offset(4)
+       cfi_offset(%esi, -12)
 
 #if CURR_EVENT == 0
        movl    (%ebx), %edx
@@ -111,9 +105,16 @@ pthread_barrier_wait:
 10:    movl    %esi, %eax              /* != PTHREAD_BARRIER_SERIAL_THREAD */
 
        popl    %esi
+       cfi_adjust_cfa_offset(-4)
+       cfi_restore(%esi)
        popl    %ebx
+       cfi_adjust_cfa_offset(-4)
+       cfi_restore(%ebx)
        ret
 
+       cfi_adjust_cfa_offset(4)
+       cfi_offset(%ebx, -8)
+
        /* The necessary number of threads arrived.  */
 3:
 #if CURR_EVENT == 0
@@ -150,21 +151,36 @@ pthread_barrier_wait:
 5:     orl     $-1, %eax               /* == PTHREAD_BARRIER_SERIAL_THREAD */
 
        popl    %ebx
+       cfi_adjust_cfa_offset(-4)
+       cfi_restore(%ebx)
        ret
 
-1:     leal    MUTEX(%ebx), %ecx
-       call    __lll_mutex_lock_wait
+       cfi_adjust_cfa_offset(4)
+       cfi_offset(%ebx, -8)
+1:     movl    PRIVATE(%ebx), %ecx
+       leal    MUTEX(%ebx), %edx
+       xorl    $LLL_SHARED, %ecx
+       call    __lll_lock_wait
        jmp     2b
 
-4:     leal    MUTEX(%ebx), %eax
-       call    __lll_mutex_unlock_wake
+4:     movl    PRIVATE(%ebx), %ecx
+       leal    MUTEX(%ebx), %eax
+       xorl    $LLL_SHARED, %ecx
+       call    __lll_unlock_wake
        jmp     5b
 
-6:     leal    MUTEX(%ebx), %eax
-       call    __lll_mutex_unlock_wake
+       cfi_adjust_cfa_offset(4)
+       cfi_offset(%esi, -12)
+6:     movl    PRIVATE(%ebx), %ecx
+       leal    MUTEX(%ebx), %eax
+       xorl    $LLL_SHARED, %ecx
+       call    __lll_unlock_wake
        jmp     7b
 
-9:     leal    MUTEX(%ebx), %eax
-       call    __lll_mutex_unlock_wake
+9:     movl    PRIVATE(%ebx), %ecx
+       leal    MUTEX(%ebx), %eax
+       xorl    $LLL_SHARED, %ecx
+       call    __lll_unlock_wake
        jmp     10b
+       cfi_endproc
        .size   pthread_barrier_wait,.-pthread_barrier_wait