summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/i386/i486
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/i386/i486')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S2
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S63
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S227
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S7
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S47
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S18
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S18
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S11
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S28
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S13
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S17
12 files changed, 54 insertions, 403 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
index 88885b735d..223b111083 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
@@ -22,7 +22,7 @@
#ifndef UP
# define LOCK \
cmpl $0, %gs:MULTIPLE_THREADS_OFFSET; \
- je 0f; \
+ je,pt 0f; \
lock; \
0:
#endif
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
index e2da5b04cf..dc65b709a1 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -41,16 +41,9 @@
.hidden __lll_mutex_lock_wait
.align 16
__lll_mutex_lock_wait:
- cfi_startproc
pushl %edx
- cfi_adjust_cfa_offset(4)
pushl %ebx
- cfi_adjust_cfa_offset(4)
pushl %esi
- cfi_adjust_cfa_offset(4)
- cfi_offset(%edx, -8)
- cfi_offset(%ebx, -12)
- cfi_offset(%esi, -16)
movl $2, %edx
movl %ecx, %ebx
@@ -67,19 +60,12 @@ __lll_mutex_lock_wait:
xchgl %eax, (%ebx) /* NB: lock is implied */
testl %eax, %eax
- jnz 1b
+ jnz,pn 1b
popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
popl %edx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edx)
ret
- cfi_endproc
.size __lll_mutex_lock_wait,.-__lll_mutex_lock_wait
@@ -89,27 +75,17 @@ __lll_mutex_lock_wait:
.hidden __lll_mutex_timedlock_wait
.align 16
__lll_mutex_timedlock_wait:
- cfi_startproc
/* Check for a valid timeout value. */
cmpl $1000000000, 4(%edx)
jae 3f
pushl %edi
- cfi_adjust_cfa_offset(4)
pushl %esi
- cfi_adjust_cfa_offset(4)
pushl %ebx
- cfi_adjust_cfa_offset(4)
pushl %ebp
- cfi_adjust_cfa_offset(4)
- cfi_offset(%edi, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%ebx, -16)
- cfi_offset(%ebp, -20)
/* Stack frame for the timespec and timeval structs. */
subl $8, %esp
- cfi_adjust_cfa_offset(8)
movl %ecx, %ebp
movl %edx, %edi
@@ -164,29 +140,12 @@ __lll_mutex_timedlock_wait:
jnz 7f
6: addl $8, %esp
- cfi_adjust_cfa_offset(-8)
popl %ebp
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebp)
popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
popl %edi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edi)
ret
-3: movl $EINVAL, %eax
- ret
-
- cfi_adjust_cfa_offset(24)
- cfi_offset(%edi, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%ebx, -16)
- cfi_offset(%ebp, -20)
/* Check whether the time expired. */
7: cmpl $-ETIMEDOUT, %ecx
je 5f
@@ -198,9 +157,11 @@ __lll_mutex_timedlock_wait:
jz 6b
jmp 1b
+3: movl $EINVAL, %eax
+ ret
+
5: movl $ETIMEDOUT, %eax
jmp 6b
- cfi_endproc
.size __lll_mutex_timedlock_wait,.-__lll_mutex_timedlock_wait
#endif
@@ -239,16 +200,9 @@ lll_unlock_wake_cb:
.hidden __lll_mutex_unlock_wake
.align 16
__lll_mutex_unlock_wake:
- cfi_startproc
pushl %ebx
- cfi_adjust_cfa_offset(4)
pushl %ecx
- cfi_adjust_cfa_offset(4)
pushl %edx
- cfi_adjust_cfa_offset(4)
- cfi_offset(%ebx, -8)
- cfi_offset(%ecx, -12)
- cfi_offset(%edx, -16)
movl %eax, %ebx
movl $0, (%eax)
@@ -258,16 +212,9 @@ __lll_mutex_unlock_wake:
ENTER_KERNEL
popl %edx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edx)
popl %ecx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ecx)
popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
ret
- cfi_endproc
.size __lll_mutex_unlock_wake,.-__lll_mutex_unlock_wake
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
deleted file mode 100644
index 73d8bc4ccc..0000000000
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
+++ /dev/null
@@ -1,227 +0,0 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- 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. */
-
-#include <sysdep.h>
-#include <pthread-errnos.h>
-#include <lowlevelrobustlock.h>
-
- .text
-
-#ifndef LOCK
-# ifdef UP
-# define LOCK
-# else
-# define LOCK lock
-# endif
-#endif
-
-#define SYS_gettimeofday __NR_gettimeofday
-#define SYS_futex 240
-#define FUTEX_WAIT 0
-#define FUTEX_WAKE 1
-#define FUTEX_WAITERS 0x80000000
-#define FUTEX_OWNER_DIED 0x40000000
-
-
- .globl __lll_robust_mutex_lock_wait
- .type __lll_robust_mutex_lock_wait,@function
- .hidden __lll_robust_mutex_lock_wait
- .align 16
-__lll_robust_mutex_lock_wait:
- cfi_startproc
- pushl %edx
- cfi_adjust_cfa_offset(4)
- pushl %ebx
- cfi_adjust_cfa_offset(4)
- pushl %esi
- cfi_adjust_cfa_offset(4)
- cfi_offset(%edx, -8)
- cfi_offset(%ebx, -12)
- cfi_offset(%esi, -16)
-
- movl %ecx, %ebx
- xorl %esi, %esi /* No timeout. */
- xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
-
-4: movl %eax, %edx
- orl $FUTEX_WAITERS, %edx
-
- testl $FUTEX_OWNER_DIED, %eax
- jnz 3f
-
- cmpl %edx, %eax /* NB: %edx == 2 */
- je 1f
-
- LOCK
- cmpxchgl %edx, (%ebx)
- jnz 2f
-
-1: movl $SYS_futex, %eax
- ENTER_KERNEL
-
- movl (%ebx), %eax
-
-2: test %eax, %eax
- jne 4b
-
- movl %gs:TID, %edx
- orl $FUTEX_WAITERS, %edx
- LOCK
- cmpxchgl %edx, (%ebx)
- jnz 4b
- /* NB: %eax == 0 */
-
-3: popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
- popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
- popl %edx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edx)
- ret
- cfi_endproc
- .size __lll_robust_mutex_lock_wait,.-__lll_robust_mutex_lock_wait
-
-
- .globl __lll_robust_mutex_timedlock_wait
- .type __lll_robust_mutex_timedlock_wait,@function
- .hidden __lll_robust_mutex_timedlock_wait
- .align 16
-__lll_robust_mutex_timedlock_wait:
- cfi_startproc
- /* Check for a valid timeout value. */
- cmpl $1000000000, 4(%edx)
- jae 3f
-
- pushl %edi
- cfi_adjust_cfa_offset(4)
- pushl %esi
- cfi_adjust_cfa_offset(4)
- pushl %ebx
- cfi_adjust_cfa_offset(4)
- pushl %ebp
- cfi_adjust_cfa_offset(4)
- cfi_offset(%edi, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%ebx, -16)
- cfi_offset(%ebp, -20)
-
- /* Stack frame for the timespec and timeval structs. */
- subl $12, %esp
- cfi_adjust_cfa_offset(12)
-
- movl %ecx, %ebp
- movl %edx, %edi
-
-1: movl %eax, 8(%esp)
-
- /* Get current time. */
- movl %esp, %ebx
- xorl %ecx, %ecx
- movl $SYS_gettimeofday, %eax
- ENTER_KERNEL
-
- /* Compute relative timeout. */
- movl 4(%esp), %eax
- movl $1000, %edx
- mul %edx /* Milli seconds to nano seconds. */
- movl (%edi), %ecx
- movl 4(%edi), %edx
- subl (%esp), %ecx
- subl %eax, %edx
- jns 4f
- addl $1000000000, %edx
- subl $1, %ecx
-4: testl %ecx, %ecx
- js 8f /* Time is already up. */
-
- /* Store relative timeout. */
- movl %ecx, (%esp)
- movl %edx, 4(%esp)
-
- movl %ebp, %ebx
-
- movl 8(%esp), %edx
- movl %edx, %eax
- orl $FUTEX_WAITERS, %edx
-
- testl $FUTEX_OWNER_DIED, %eax
- jnz 6f
-
- cmpl %eax, %edx
- je 2f
-
- LOCK
- cmpxchgl %edx, (%ebx)
- movl $0, %ecx /* Must use mov to avoid changing cc. */
- jnz 5f
-
-2:
- /* Futex call. */
- movl %esp, %esi
- xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
- movl $SYS_futex, %eax
- ENTER_KERNEL
- movl %eax, %ecx
-
- movl (%ebx), %eax
-
-5: testl %eax, %eax
- jne 7f
-
- movl %gs:TID, %edx
- orl $FUTEX_WAITERS, %edx
- LOCK
- cmpxchgl %edx, (%ebx)
- jnz 7f
-
-6: addl $12, %esp
- cfi_adjust_cfa_offset(-12)
- popl %ebp
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebp)
- popl %ebx
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%ebx)
- popl %esi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%esi)
- popl %edi
- cfi_adjust_cfa_offset(-4)
- cfi_restore(%edi)
- ret
-
-3: movl $EINVAL, %eax
- ret
-
- cfi_adjust_cfa_offset(28)
- cfi_offset(%edi, -8)
- cfi_offset(%esi, -12)
- cfi_offset(%ebx, -16)
- cfi_offset(%ebp, -20)
- /* Check whether the time expired. */
-7: cmpl $-ETIMEDOUT, %ecx
- jne 1b
-
-8: movl $ETIMEDOUT, %eax
- jmp 6b
- cfi_endproc
- .size __lll_robust_mutex_timedlock_wait,.-__lll_robust_mutex_timedlock_wait
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
index fe7a8b9c66..114284c44c 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
@@ -82,7 +82,7 @@ pthread_barrier_wait:
#else
cmpl %edx, CURR_EVENT(%ebx)
#endif
- je 8b
+ je,pn 8b
/* Increment LEFT. If this brings the count back to the
initial count unlock the object. */
@@ -92,7 +92,7 @@ pthread_barrier_wait:
xaddl %edx, LEFT(%ebx)
subl $1, %ecx
cmpl %ecx, %edx
- jne 10f
+ jne,pt 10f
/* Release the mutex. We cannot release the lock before
waking the waiting threads since otherwise a new thread might
@@ -131,7 +131,7 @@ pthread_barrier_wait:
xaddl %edx, LEFT(%ebx)
subl $1, %ecx
cmpl %ecx, %edx
- jne 5f
+ jne,pt 5f
/* Release the mutex. We cannot release the lock before
waking the waiting threads since otherwise a new thread might
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
index 56f7be8246..5471c1c927 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -21,7 +21,6 @@
#include <shlib-compat.h>
#include <lowlevelcond.h>
#include <kernel-features.h>
-#include <pthread-pi-defines.h>
#ifdef UP
# define LOCK
@@ -95,10 +94,6 @@ __pthread_cond_broadcast:
8: cmpl $-1, %edi
je 9f
- /* XXX: The kernel so far doesn't support requeue to PI futex. */
- testl $PI_BIT, MUTEX_KIND(%edi)
- jne 9f
-
/* Wake up all threads. */
movl $FUTEX_CMP_REQUEUE, %ecx
movl $SYS_futex, %eax
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
index d0f931ff15..3c5a1db59c 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -31,9 +31,7 @@
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define FUTEX_WAKE_OP 5
-
-#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1)
+#define FUTEX_REQUEUE 3
#define EINVAL 22
@@ -81,46 +79,21 @@ __pthread_cond_signal:
addl $1, (%ebx)
/* Wake up one thread. */
- pushl %esi
- pushl %ebp
- movl $FUTEX_WAKE_OP, %ecx
+ movl $FUTEX_WAKE, %ecx
movl $SYS_futex, %eax
movl $1, %edx
- movl $1, %esi
- movl $FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, %ebp
- /* FIXME: Until Ingo fixes 4G/4G vDSO, 6 arg syscalls are broken for
- sysenter.
- ENTER_KERNEL */
- int $0x80
- popl %ebp
- popl %esi
-
- /* For any kind of error, we try again with WAKE.
- The general test also covers running on old kernels. */
- cmpl $-4095, %eax
- jae 7f
-
-6: xorl %eax, %eax
- popl %edi
- popl %ebx
- ret
-
-7: movl $FUTEX_WAKE, %ecx
- movl $SYS_futex, %eax
- /* %edx should be 1 already from $FUTEX_WAKE_OP syscall.
- movl $1, %edx */
ENTER_KERNEL
/* Unlock. Note that at this point %edi always points to
cond_lock. */
4: LOCK
subl $1, (%edi)
- je 6b
+ jne 5f
- /* Unlock in loop requires wakeup. */
-5: movl %edi, %eax
- call __lll_mutex_unlock_wake
- jmp 6b
+6: xorl %eax, %eax
+ popl %edi
+ popl %ebx
+ ret
/* Initial locking failed. */
1:
@@ -132,6 +105,10 @@ __pthread_cond_signal:
call __lll_mutex_lock_wait
jmp 2b
+ /* Unlock in loop requires wakeup. */
+5: movl %edi, %eax
+ call __lll_mutex_unlock_wake
+ jmp 6b
.size __pthread_cond_signal, .-__pthread_cond_signal
versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal,
GLIBC_2_3_2)
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
index f481a8e43c..699c2cb227 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -406,22 +406,12 @@ __condvar_tw_cleanup:
cmpl 20(%esp), %eax
jne 3f
- /* We increment the wakeup_seq counter only if it is lower than
- total_seq. If this is not the case the thread was woken and
- then canceled. In this case we ignore the signal. */
- movl total_seq(%ebx), %eax
- movl total_seq+4(%ebx), %edi
- cmpl wakeup_seq+4(%ebx), %edi
- jb 6f
- ja 7f
- cmpl wakeup_seq(%ebx), %eax
- jbe 7f
-
-6: addl $1, wakeup_seq(%ebx)
+ addl $1, wakeup_seq(%ebx)
adcl $0, wakeup_seq+4(%ebx)
+
addl $1, cond_futex(%ebx)
-7: addl $1, woken_seq(%ebx)
+ addl $1, woken_seq(%ebx)
adcl $0, woken_seq+4(%ebx)
3: subl $(1 << clock_bits), cond_nwaiters(%ebx)
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
index f16c7d9198..d282785151 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -297,22 +297,12 @@ __condvar_w_cleanup:
cmpl 12(%esp), %eax
jne 3f
- /* We increment the wakeup_seq counter only if it is lower than
- total_seq. If this is not the case the thread was woken and
- then canceled. In this case we ignore the signal. */
- movl total_seq(%ebx), %eax
- movl total_seq+4(%ebx), %edi
- cmpl wakeup_seq+4(%ebx), %edi
- jb 6f
- ja 7f
- cmpl wakeup_seq(%ebx), %eax
- jbe 7f
-
-6: addl $1, wakeup_seq(%ebx)
+ addl $1, wakeup_seq(%ebx)
adcl $0, wakeup_seq+4(%ebx)
+
addl $1, cond_futex(%ebx)
-7: addl $1, woken_seq(%ebx)
+ addl $1, woken_seq(%ebx)
adcl $0, woken_seq+4(%ebx)
3: subl $(1 << clock_bits), cond_nwaiters(%ebx)
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
index 71e96d2228..3d67329bd1 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -65,14 +65,9 @@ __new_sem_post:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ebx
#if USE___THREAD
-# ifdef NO_TLS_DIRECT_SEG_REFS
- movl errno@gotntpoff(%ebx), %edx
- addl %gs:0, %edx
+ movl %gs:0, %edx
+ subl errno@gottpoff(%ebx), %edx
movl $EINVAL, (%edx)
-# else
- movl errno@gotntpoff(%ebx), %edx
- movl $EINVAL, %gs:(%edx)
-# endif
#else
call __errno_location@plt
movl $EINVAL, (%eax)
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
index bf70e17fca..5b24476936 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -49,12 +49,12 @@ sem_timedwait:
movl (%ecx), %eax
2: testl %eax, %eax
- je 1f
+ je,pn 1f
leal -1(%eax), %edx
LOCK
cmpxchgl %edx, (%ecx)
- jne 2b
+ jne,pn 2b
xorl %eax, %eax
ret
@@ -79,7 +79,10 @@ sem_timedwait:
jae 6f
cfi_offset(3, -16) /* %ebx */
-7: xorl %ecx, %ecx
+7: call __pthread_enable_asynccancel
+ movl %eax, 8(%esp)
+
+ xorl %ecx, %ecx
movl %esp, %ebx
movl %ecx, %edx
movl $SYS_gettimeofday, %eax
@@ -102,10 +105,6 @@ sem_timedwait:
movl %ecx, (%esp) /* Store relative timeout. */
movl %edx, 4(%esp)
-
- call __pthread_enable_asynccancel
- movl %eax, 8(%esp)
-
movl 28(%esp), %ebx
xorl %ecx, %ecx
movl %esp, %esi
@@ -118,7 +117,7 @@ sem_timedwait:
call __pthread_disable_asynccancel
testl %esi, %esi
- je 9f
+ je,pt 9f
cmpl $-EWOULDBLOCK, %esi
jne 3f
@@ -129,7 +128,7 @@ sem_timedwait:
leal -1(%eax), %ecx
LOCK
cmpxchgl %ecx, (%ebx)
- jne 8b
+ jne,pn 8b
addl $12, %esp
cfi_adjust_cfa_offset(-12)
@@ -159,14 +158,9 @@ sem_timedwait:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ebx
#if USE___THREAD
-# ifdef NO_TLS_DIRECT_SEG_REFS
- movl errno@gotntpoff(%ebx), %edx
- addl %gs:0, %edx
+ movl %gs:0, %edx
+ subl errno@gottpoff(%ebx), %edx
movl %esi, (%edx)
-# else
- movl errno@gotntpoff(%ebx), %edx
- movl %esi, %gs:(%edx)
-# endif
#else
call __errno_location@plt
movl %esi, (%eax)
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S
index fbc3b3c932..a7c405d95f 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -42,7 +42,7 @@ __new_sem_trywait:
leal -1(%eax), %edx
LOCK
cmpxchgl %edx, (%ecx)
- jne 2b
+ jne,pn 2b
xorl %eax, %eax
ret
@@ -55,14 +55,9 @@ __new_sem_trywait:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ecx
#if USE___THREAD
-# ifdef NO_TLS_DIRECT_SEG_REFS
- movl errno@gotntpoff(%ecx), %edx
- addl %gs:0, %edx
+ movl %gs:0, %edx
+ subl errno@gottpoff(%ecx), %edx
movl $EAGAIN, (%edx)
-# else
- movl errno@gotntpoff(%ecx), %edx
- movl $EAGAIN, %gs:(%edx)
-# endif
#else
call __errno_location@plt
movl $EAGAIN, (%eax)
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
index b1296275d0..b7674dc3ba 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -57,12 +57,12 @@ __new_sem_wait:
cfi_offset(6, -12) /* %esi */
3: movl (%ebx), %eax
2: testl %eax, %eax
- je 1f
+ je,pn 1f
leal -1(%eax), %edx
LOCK
cmpxchgl %edx, (%ebx)
- jne 2b
+ jne,pn 2b
xorl %eax, %eax
movl 4(%esp), %esi
@@ -73,7 +73,7 @@ __new_sem_wait:
cfi_adjust_cfa_offset(-12)
ret
- cfi_adjust_cfa_offset(12)
+ cfi_adjust_cfa_offset(8)
cfi_offset(3, -8) /* %ebx */
cfi_offset(6, -12) /* %esi */
1: call __pthread_enable_asynccancel
@@ -102,14 +102,9 @@ __new_sem_wait:
#endif
addl $_GLOBAL_OFFSET_TABLE_, %ebx
#if USE___THREAD
-# ifdef NO_TLS_DIRECT_SEG_REFS
- movl errno@gotntpoff(%ebx), %edx
- addl %gs:0, %edx
+ movl %gs:0, %edx
+ subl errno@gottpoff(%ebx), %edx
movl %esi, (%edx)
-# else
- movl errno@gotntpoff(%ebx), %edx
- movl %esi, %gs:(%edx)
-# endif
#else
call __errno_location@plt
movl %esi, (%eax)