]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 22 Sep 2003 22:13:36 +0000 (22:13 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 22 Sep 2003 22:13:36 +0000 (22:13 +0000)
2003-09-22  Jakub Jelinek  <jakub@redhat.com>

* include/atomic.h (atomic_compare_and_exchange_val_rel,
atomic_compare_and_exchange_bool_rel): Swap oldval/newval arguments
to avoid confusion.

* sysdeps/unix/opendir.c: Include string.h.

ChangeLog
linuxthreads/ChangeLog
linuxthreads/attr.c
nptl/Banner
nptl/ChangeLog
nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h

index 31bc91cdd501b79ad7df6f20cdd0638c64415edc..32c26375cd183cc519045875d6fe4bc8e4583008 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-09-22  Jakub Jelinek  <jakub@redhat.com>
+
+       * include/atomic.h (atomic_compare_and_exchange_val_rel,
+       atomic_compare_and_exchange_bool_rel): Swap oldval/newval arguments
+       to avoid confusion.
+
+       * sysdeps/unix/opendir.c: Include string.h.
+
 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
 
        * timezone/zdump.c: Update from tzcode2003c.
index b975c89ec0097c2c14b152c83001811489bf1c68..62c05e256ddf81386e7de12fc8f6b9b2f5478d74 100644 (file)
@@ -1,3 +1,7 @@
+2003-09-22  Jakub Jelinek  <jakub@redhat.com>
+
+       * attr.c: Include stdlib.h.
+
 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
index 687334ffdb917f849f9b3f5b30d258e561060287..5bef26504ebd975f3752c2489f5a3d19fc708e04 100644 (file)
@@ -18,6 +18,7 @@
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdio_ext.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <sys/param.h>
index 5d6a6d044586eb2333fed225e42006e45eddd4de..5f10f817314309a4324d2ca0fb0d59f97bc7b961 100644 (file)
@@ -1 +1 @@
-NPTL 0.59 by Ulrich Drepper
+NPTL 0.60 by Ulrich Drepper
index eb32fe193e183938743c84d912dea874a2cafdfd..00bfbf9ad8d30fd3231b0980f853e21fa6be66db 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-22  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
+       recommendation from AMD re avoidance of lock prefix.
+
 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
index 900c9cd5b13761a54cad9a834926e19d0e048a60..8b084d069e9606bcbd066badd49bff28b350354f 100644 (file)
@@ -184,10 +184,7 @@ extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
     2  -  taken by more users */
 
 
-//#if defined NOT_IN_libc || defined UP
-/* According to AMD it is not necessary to play tricks with avoiding the
-   lock instruction.  */
-#if 1
+#if defined NOT_IN_libc || defined UP
 # define lll_trylock(futex) lll_mutex_trylock (futex)
 # define lll_lock(futex) lll_mutex_lock (futex)
 # define lll_unlock(futex) lll_mutex_unlock (futex)
@@ -195,14 +192,19 @@ extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
 /* Special versions of the macros for use in libc itself.  They avoid
    the lock prefix when the thread library is not used.
 
+   The code sequence to avoid unnecessary lock prefixes is what the AMD
+   guys suggested.  If you do not like it, bring it up with AMD.
+
    XXX In future we might even want to avoid it on UP machines.  */
 
 # define lll_trylock(futex) \
   ({ unsigned char ret;                                                              \
      __asm __volatile ("cmpl $0, __libc_multiple_threads(%%rip)\n\t"         \
                       "je 0f\n\t"                                            \
-                      "lock\n"                                               \
-                      "0:\tcmpxchgl %2, %1; setne %0"                        \
+                      "lock; cmpxchgl %2, %1\n\t"                            \
+                      "jmp 1f\n"                                             \
+                      "0:\tcmpxchgl %2, %1\n\t"                              \
+                      "1:setne %0"                                           \
                       : "=a" (ret), "=m" (futex)                             \
                       : "r" (LLL_MUTEX_LOCK_INITIALIZER_LOCKED), "m" (futex),\
                         "0" (LLL_MUTEX_LOCK_INITIALIZER)                     \
@@ -214,7 +216,9 @@ extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
   (void) ({ int ignore1, ignore2, ignore3;                                   \
            __asm __volatile ("cmpl $0, __libc_multiple_threads(%%rip)\n\t"   \
                              "je 0f\n\t"                                     \
-                             "lock\n"                                        \
+                             "lock; cmpxchgl %0, %2\n\t"                     \
+                             "jnz 1f\n\t"                                    \
+                             "jmp 2f\n"                                      \
                              "0:\tcmpxchgl %0, %2\n\t"                       \
                              "jnz 1f\n\t"                                    \
                              ".subsection 1\n"                               \
@@ -235,7 +239,9 @@ extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
   (void) ({ int ignore;                                                              \
             __asm __volatile ("cmpl $0, __libc_multiple_threads(%%rip)\n\t"   \
                              "je 0f\n\t"                                     \
-                             "lock\n"                                        \
+                             "lock; decl %0\n\t"                             \
+                             "jne 1f\n\t"                                    \
+                             "jmp 2f\n"                                      \
                              "0:\tdecl %0\n\t"                               \
                              "jne 1f\n\t"                                    \
                              ".subsection 1\n"                               \