summaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2009-07-27 10:51:39 +0200
committerAndreas Schwab <schwab@redhat.com>2009-07-27 10:51:39 +0200
commite1a51361e3ac137c56adc6083d095c68e9471795 (patch)
treebfec41199e84a74265d8e77b0e8444b06bc9ff00 /nptl
parent9285e82ab3a0d1bdaa63fc740165d6a300ad0cc5 (diff)
parent16d2ea4c821502948d193a152c8b151f5497a0d3 (diff)
Merge commit 'origin/master' into fedora/master
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog14
-rw-r--r--nptl/pthread_mutex_lock.c12
-rw-r--r--nptl/pthread_mutex_timedlock.c12
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S4
-rw-r--r--nptl/sysdeps/x86_64/configure36
-rw-r--r--nptl/sysdeps/x86_64/configure.in23
6 files changed, 87 insertions, 14 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 1f24aa5849..c485435e82 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,17 @@
+2009-07-26 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #10418]
+ * pthread_mutex_lock.c (pthread_mutex_lock): Use _rel instead of of
+ _acq variants of cmpxchg.
+ * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
+
+2009-07-23 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/x86_64/configure.in: New file.
+
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
+ path when not using absolute timeout futex.
+
2009-07-20 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor
diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c
index 406e588fdb..a0ff881faf 100644
--- a/nptl/pthread_mutex_lock.c
+++ b/nptl/pthread_mutex_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -160,7 +160,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
#endif
newval
- = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+ = atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
newval, oldval);
if (newval != oldval)
@@ -285,7 +285,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
#ifdef NO_INCR
newval |= FUTEX_WAITERS;
#endif
- oldval = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+ oldval = atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
newval, 0);
if (oldval != 0)
@@ -420,7 +420,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
oldprio = ceiling;
oldval
- = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+ = atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
#ifdef NO_INCR
ceilval | 2,
#else
@@ -434,7 +434,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
do
{
oldval
- = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+ = atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
ceilval | 2,
ceilval | 1);
@@ -445,7 +445,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
lll_futex_wait (&mutex->__data.__lock, ceilval | 2,
PTHREAD_MUTEX_PSHARED (mutex));
}
- while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+ while (atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
ceilval | 2, ceilval)
!= ceilval);
}
diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c
index 8d0db79d58..2c6ff114da 100644
--- a/nptl/pthread_mutex_timedlock.c
+++ b/nptl/pthread_mutex_timedlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -126,7 +126,7 @@ pthread_mutex_timedlock (mutex, abstime)
int newval = id | (oldval & FUTEX_WAITERS);
newval
- = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+ = atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
newval, oldval);
if (newval != oldval)
{
@@ -246,7 +246,7 @@ pthread_mutex_timedlock (mutex, abstime)
}
}
- oldval = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+ oldval = atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
id, 0);
if (oldval != 0)
@@ -404,7 +404,7 @@ pthread_mutex_timedlock (mutex, abstime)
oldprio = ceiling;
oldval
- = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+ = atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
ceilval | 1, ceilval);
if (oldval == ceilval)
@@ -413,7 +413,7 @@ pthread_mutex_timedlock (mutex, abstime)
do
{
oldval
- = atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+ = atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
ceilval | 2,
ceilval | 1);
@@ -456,7 +456,7 @@ pthread_mutex_timedlock (mutex, abstime)
PTHREAD_MUTEX_PSHARED (mutex));
}
}
- while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
+ while (atomic_compare_and_exchange_val_rel (&mutex->__data.__lock,
ceilval | 2, ceilval)
!= ceilval);
}
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index e12790cb96..7486825d5f 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -551,12 +551,12 @@ __pthread_cond_timedwait:
jne 53b
cmpq 24(%rsp), %r9
- jbe 45b
+ jbe 15f
cmpq %rax, %r9
ja 39b
- cmpq $-ETIMEDOUT, %r14
+15: cmpq $-ETIMEDOUT, %r14
jne 8b
jmp 99b
diff --git a/nptl/sysdeps/x86_64/configure b/nptl/sysdeps/x86_64/configure
new file mode 100644
index 0000000000..b959168843
--- /dev/null
+++ b/nptl/sysdeps/x86_64/configure
@@ -0,0 +1,36 @@
+# This file is generated from configure.in by Autoconf. DO NOT EDIT!
+ # Local configure fragment for sysdeps/i386.
+
+{ echo "$as_me:$LINENO: checking for .cfi_personality and .cfi_lsda pseudo-ops" >&5
+echo $ECHO_N "checking for .cfi_personality and .cfi_lsda pseudo-ops... $ECHO_C" >&6; }
+if test "${libc_cv_asm_cfi_personality+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat > conftest.s <<EOF
+${libc_cv_dot_text}
+foo:
+ .cfi_startproc
+ .cfi_personality 0, foo
+ .cfi_lsda 0, foo
+ .cfi_endproc
+EOF
+ if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ libc_cv_asm_cfi_personality=yes
+ else
+ libc_cv_asm_cfi_personality=no
+ fi
+ rm -f conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $libc_cv_asm_cfi_personality" >&5
+echo "${ECHO_T}$libc_cv_asm_cfi_personality" >&6; }
+if test x"$libc_cv_asm_cfi_personality" != xyes; then
+ { { echo "$as_me:$LINENO: error: assembler too old, .cfi_personality support missing" >&5
+echo "$as_me: error: assembler too old, .cfi_personality support missing" >&2;}
+ { (exit 1); exit 1; }; }
+fi
diff --git a/nptl/sysdeps/x86_64/configure.in b/nptl/sysdeps/x86_64/configure.in
new file mode 100644
index 0000000000..0ba0cc3726
--- /dev/null
+++ b/nptl/sysdeps/x86_64/configure.in
@@ -0,0 +1,23 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/i386.
+
+AC_CACHE_CHECK([for .cfi_personality and .cfi_lsda pseudo-ops],
+ libc_cv_asm_cfi_personality, [dnl
+ cat > conftest.s <<EOF
+${libc_cv_dot_text}
+foo:
+ .cfi_startproc
+ .cfi_personality 0, foo
+ .cfi_lsda 0, foo
+ .cfi_endproc
+EOF
+ if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
+ libc_cv_asm_cfi_personality=yes
+ else
+ libc_cv_asm_cfi_personality=no
+ fi
+ rm -f conftest*
+])
+if test x"$libc_cv_asm_cfi_personality" != xyes; then
+ AC_MSG_ERROR([assembler too old, .cfi_personality support missing])
+fi