aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-06-08 02:50:59 +0000
committerUlrich Drepper <drepper@redhat.com>2007-06-08 02:50:59 +0000
commit835abc5c0dfd1ba8aabeb52d46793b13702c708b (patch)
tree8863a99b99c334da2e2fe77459acca76dbac5ef0
parent43b768284325b7e7d2ec3fc3dcac13a35c378c95 (diff)
downloadglibc-835abc5c0dfd1ba8aabeb52d46793b13702c708b.tar.xz
glibc-835abc5c0dfd1ba8aabeb52d46793b13702c708b.zip
[BZ #4586]
2007-06-06 Jakub Jelinek <jakub@redhat.com> BZ #4586 * sysdeps/i386/ldbl2mpn.c (__mpn_extract_long_double): Treat pseudo-zeros as zero. * sysdeps/x86_64/ldbl2mpn.c: New file. * sysdeps/ia64/ldbl2mpn.c: New file.
-rw-r--r--ChangeLog8
-rw-r--r--nptl/allocatestack.c6
-rw-r--r--nptl/init.c4
-rw-r--r--nptl/lowlevellock.h20
-rw-r--r--nptl/pthread_barrier_wait.c10
-rw-r--r--nptl/pthread_cond_broadcast.c6
-rw-r--r--nptl/pthread_cond_destroy.c8
-rw-r--r--nptl/pthread_cond_signal.c10
-rw-r--r--nptl/pthread_cond_timedwait.c8
-rw-r--r--nptl/pthread_cond_wait.c16
-rw-r--r--nptl/pthread_create.c4
-rw-r--r--nptl/pthread_mutex_lock.c4
-rw-r--r--nptl/pthread_mutex_setprioceiling.c10
-rw-r--r--nptl/pthread_mutex_timedlock.c4
-rw-r--r--nptl/pthread_mutex_unlock.c6
-rw-r--r--nptl/pthread_rwlock_timedrdlock.c4
-rw-r--r--nptl/pthread_rwlock_timedwrlock.c6
-rw-r--r--nptl/pthread_rwlock_unlock.c10
-rw-r--r--nptl/sysdeps/alpha/tls.h2
-rw-r--r--nptl/sysdeps/i386/tls.h2
-rw-r--r--nptl/sysdeps/ia64/tls.h2
-rw-r--r--nptl/sysdeps/powerpc/tls.h2
-rw-r--r--nptl/sysdeps/pthread/aio_misc.h7
-rw-r--r--nptl/sysdeps/pthread/gai_misc.h7
-rw-r--r--nptl/sysdeps/s390/tls.h2
-rw-r--r--nptl/sysdeps/sh/tls.h2
-rw-r--r--nptl/sysdeps/sparc/tls.h2
-rw-r--r--nptl/sysdeps/unix/sysv/linux/fork.c2
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h95
-rw-r--r--nptl/sysdeps/unix/sysv/linux/lowlevellock.c13
-rw-r--r--nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h14
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sem_post.c7
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sem_timedwait.c4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sem_wait.c7
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sparc/pthread_once.c6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c10
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/unregister-atfork.c4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h80
-rw-r--r--nptl/sysdeps/x86_64/tls.h2
-rw-r--r--sysdeps/i386/ldbl2mpn.c13
-rw-r--r--sysdeps/ia64/ldbl2mpn.c1
-rw-r--r--sysdeps/x86_64/ldbl2mpn.c1
44 files changed, 320 insertions, 125 deletions
diff --git a/ChangeLog b/ChangeLog
index 5845b8a951..f54c445196 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-06-06 Jakub Jelinek <jakub@redhat.com>
+
+ BZ #4586
+ * sysdeps/i386/ldbl2mpn.c (__mpn_extract_long_double): Treat
+ pseudo-zeros as zero.
+ * sysdeps/x86_64/ldbl2mpn.c: New file.
+ * sysdeps/ia64/ldbl2mpn.c: New file.
+
2007-06-04 Jakub Jelinek <jakub@redhat.com>
* sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index c31ca808bf..76d75fef2c 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -949,7 +949,7 @@ __nptl_setxid (struct xid_command *cmdp)
int cur = cmdp->cntr;
while (cur != 0)
{
- lll_futex_wait (&cmdp->cntr, cur);
+ lll_private_futex_wait (&cmdp->cntr, cur);
cur = cmdp->cntr;
}
@@ -1035,7 +1035,7 @@ __wait_lookup_done (void)
continue;
do
- lll_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT);
+ lll_private_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT);
while (*gscope_flagp == THREAD_GSCOPE_FLAG_WAIT);
}
@@ -1057,7 +1057,7 @@ __wait_lookup_done (void)
continue;
do
- lll_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT);
+ lll_private_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT);
while (*gscope_flagp == THREAD_GSCOPE_FLAG_WAIT);
}
diff --git a/nptl/init.c b/nptl/init.c
index 82adeae6a6..be8359ea21 100644
--- a/nptl/init.c
+++ b/nptl/init.c
@@ -216,7 +216,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
__xidcmd->id[1], __xidcmd->id[2]);
if (atomic_decrement_val (&__xidcmd->cntr) == 0)
- lll_futex_wake (&__xidcmd->cntr, 1);
+ lll_private_futex_wake (&__xidcmd->cntr, 1);
/* Reset the SETXID flag. */
struct pthread *self = THREAD_SELF;
@@ -225,7 +225,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
/* And release the futex. */
self->setxid_futex = 1;
- lll_futex_wake (&self->setxid_futex, 1);
+ lll_private_futex_wake (&self->setxid_futex, 1);
}
diff --git a/nptl/lowlevellock.h b/nptl/lowlevellock.h
index 338da39990..0600e1794d 100644
--- a/nptl/lowlevellock.h
+++ b/nptl/lowlevellock.h
@@ -1,5 +1,5 @@
/* Low level locking macros used in NPTL implementation. Stub version.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -21,16 +21,6 @@
#include <atomic.h>
-/* Implement generic mutex. Basic futex syscall support is required:
-
- lll_futex_wait(futex, value) - call sys_futex with FUTEX_WAIT
- and third parameter VALUE
-
- lll_futex_wake(futex, value) - call sys_futex with FUTEX_WAKE
- and third parameter VALUE
-*/
-
-
/* Mutex lock counter:
bit 31 clear means unlocked;
bit 31 set means locked.
@@ -66,7 +56,9 @@ __generic_mutex_lock (int *mutex)
if (v >= 0)
continue;
- lll_futex_wait (mutex, v);
+ lll_futex_wait (mutex, v,
+ // XYZ check mutex flag
+ LLL_SHARED);
}
}
@@ -82,7 +74,9 @@ __generic_mutex_unlock (int *mutex)
/* There are other threads waiting for this mutex, wake one of them
up. */
- lll_futex_wake (mutex, 1);
+ lll_futex_wake (mutex, 1,
+ // XYZ check mutex flag
+ LLL_SHARED);
}
diff --git a/nptl/pthread_barrier_wait.c b/nptl/pthread_barrier_wait.c
index c6b563f242..e96a3e5473 100644
--- a/nptl/pthread_barrier_wait.c
+++ b/nptl/pthread_barrier_wait.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -45,7 +45,9 @@ pthread_barrier_wait (barrier)
++ibarrier->curr_event;
/* Wake up everybody. */
- lll_futex_wake (&ibarrier->curr_event, INT_MAX);
+ lll_futex_wake (&ibarrier->curr_event, INT_MAX,
+ // XYZ check mutex flag
+ LLL_SHARED);
/* This is the thread which finished the serialization. */
result = PTHREAD_BARRIER_SERIAL_THREAD;
@@ -61,7 +63,9 @@ pthread_barrier_wait (barrier)
/* Wait for the event counter of the barrier to change. */
do
- lll_futex_wait (&ibarrier->curr_event, event);
+ lll_futex_wait (&ibarrier->curr_event, event,
+ // XYZ check mutex flag
+ LLL_SHARED);
while (event == ibarrier->curr_event);
}
diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c
index 2b8b5460f4..aec33f3bd8 100644
--- a/nptl/pthread_cond_broadcast.c
+++ b/nptl/pthread_cond_broadcast.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -69,7 +69,9 @@ __pthread_cond_broadcast (cond)
{
/* The requeue functionality is not available. */
wake_all:
- lll_futex_wake (&cond->__data.__futex, INT_MAX);
+ lll_futex_wake (&cond->__data.__futex, INT_MAX,
+ // XYZ check mutex flag
+ LLL_SHARED);
}
/* That's all. */
diff --git a/nptl/pthread_cond_destroy.c b/nptl/pthread_cond_destroy.c
index 0b8d4119d1..8574b6118f 100644
--- a/nptl/pthread_cond_destroy.c
+++ b/nptl/pthread_cond_destroy.c
@@ -59,14 +59,18 @@ __pthread_cond_destroy (cond)
&& cond->__data.__mutex != (void *) ~0l)
{
pthread_mutex_t *mut = (pthread_mutex_t *) cond->__data.__mutex;
- lll_futex_wake (&mut->__data.__lock, INT_MAX);
+ lll_futex_wake (&mut->__data.__lock, INT_MAX,
+ // XYZ check mutex flag
+ LLL_SHARED);
}
do
{
lll_mutex_unlock (cond->__data.__lock);
- lll_futex_wait (&cond->__data.__nwaiters, nwaiters);
+ lll_futex_wait (&cond->__data.__nwaiters, nwaiters,
+ // XYZ check mutex flag
+ LLL_SHARED);
lll_mutex_lock (cond->__data.__lock);
diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c
index 5a9bbcad91..a4faf41854 100644
--- a/nptl/pthread_cond_signal.c
+++ b/nptl/pthread_cond_signal.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -44,11 +44,15 @@ __pthread_cond_signal (cond)
/* Wake one. */
if (! __builtin_expect (lll_futex_wake_unlock (&cond->__data.__futex, 1,
- 1, &cond->__data.__lock),
+ 1, &cond->__data.__lock,
+ // XYZ check mutex flag
+ LLL_SHARED),
0))
return 0;
- lll_futex_wake (&cond->__data.__futex, 1);
+ lll_futex_wake (&cond->__data.__futex, 1,
+ // XYZ check mutex flag
+ LLL_SHARED);
}
/* We are done. */
diff --git a/nptl/pthread_cond_timedwait.c b/nptl/pthread_cond_timedwait.c
index 261b4484ba..d1c29d2377 100644
--- a/nptl/pthread_cond_timedwait.c
+++ b/nptl/pthread_cond_timedwait.c
@@ -153,7 +153,9 @@ __pthread_cond_timedwait (cond, mutex, abstime)
/* Wait until woken by signal or broadcast. */
err = lll_futex_timed_wait (&cond->__data.__futex,
- futex_val, &rt);
+ futex_val, &rt,
+ // XYZ check mutex flag
+ LLL_SHARED);
/* Disable asynchronous cancellation. */
__pthread_disable_asynccancel (cbuffer.oldtype);
@@ -196,7 +198,9 @@ __pthread_cond_timedwait (cond, mutex, abstime)
and it can be successfully destroyed. */
if (cond->__data.__total_seq == -1ULL
&& cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT))
- lll_futex_wake (&cond->__data.__nwaiters, 1);
+ lll_futex_wake (&cond->__data.__nwaiters, 1,
+ // XYZ check mutex flag
+ LLL_SHARED);
/* We are done with the condvar. */
lll_mutex_unlock (cond->__data.__lock);
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
index 6e00a28f6a..e524aa6c94 100644
--- a/nptl/pthread_cond_wait.c
+++ b/nptl/pthread_cond_wait.c
@@ -71,7 +71,9 @@ __condvar_cleanup (void *arg)
if (cbuffer->cond->__data.__total_seq == -1ULL
&& cbuffer->cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT))
{
- lll_futex_wake (&cbuffer->cond->__data.__nwaiters, 1);
+ lll_futex_wake (&cbuffer->cond->__data.__nwaiters, 1,
+ // XYZ check mutex flag
+ LLL_SHARED);
destroying = 1;
}
@@ -80,7 +82,9 @@ __condvar_cleanup (void *arg)
/* Wake everybody to make sure no condvar signal gets lost. */
if (! destroying)
- lll_futex_wake (&cbuffer->cond->__data.__futex, INT_MAX);
+ lll_futex_wake (&cbuffer->cond->__data.__futex, INT_MAX,
+ // XYZ check mutex flag
+ LLL_SHARED);
/* Get the mutex before returning unless asynchronous cancellation
is in effect. */
@@ -146,7 +150,9 @@ __pthread_cond_wait (cond, mutex)
cbuffer.oldtype = __pthread_enable_asynccancel ();
/* Wait until woken by signal or broadcast. */
- lll_futex_wait (&cond->__data.__futex, futex_val);
+ lll_futex_wait (&cond->__data.__futex, futex_val,
+ // XYZ check mutex flag
+ LLL_SHARED);
/* Disable asynchronous cancellation. */
__pthread_disable_asynccancel (cbuffer.oldtype);
@@ -175,7 +181,9 @@ __pthread_cond_wait (cond, mutex)
and it can be successfully destroyed. */
if (cond->__data.__total_seq == -1ULL
&& cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT))
- lll_futex_wake (&cond->__data.__nwaiters, 1);
+ lll_futex_wake (&cond->__data.__nwaiters, 1,
+ // XYZ check mutex flag
+ LLL_SHARED);
/* We are done with the condvar. */
lll_mutex_unlock (cond->__data.__lock);
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 79729ced03..b1f852dc95 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -385,7 +385,7 @@ start_thread (void *arg)
/* Some other thread might call any of the setXid functions and expect
us to reply. In this case wait until we did that. */
do
- lll_futex_wait (&pd->setxid_futex, 0);
+ lll_private_futex_wait (&pd->setxid_futex, 0);
while (pd->cancelhandling & SETXID_BITMASK);
/* Reset the value so that the stack can be reused. */
diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c
index 1c3ee4fe25..a17013bb76 100644
--- a/nptl/pthread_mutex_lock.c
+++ b/nptl/pthread_mutex_lock.c
@@ -408,7 +408,9 @@ __pthread_mutex_lock (mutex)
break;
if (oldval != ceilval)
- lll_futex_wait (&mutex->__data.__lock, ceilval | 2);
+ lll_futex_wait (&mutex->__data.__lock, ceilval | 2,
+ // XYZ check mutex flag
+ LLL_SHARED);
}
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
ceilval | 2, ceilval)
diff --git a/nptl/pthread_mutex_setprioceiling.c b/nptl/pthread_mutex_setprioceiling.c
index cd13d1c14c..301fb63d21 100644
--- a/nptl/pthread_mutex_setprioceiling.c
+++ b/