Get rid of lll_robust_dead.
authorRoland McGrath <roland@hack.frob.com>
Thu, 10 Jul 2014 18:21:54 +0000 (11:21 -0700)
committerRoland McGrath <roland@hack.frob.com>
Thu, 10 Jul 2014 18:21:54 +0000 (11:21 -0700)
17 files changed:
ChangeLog
nptl/pthread_create.c
sysdeps/unix/sysv/linux/aarch64/lowlevellock.h
sysdeps/unix/sysv/linux/alpha/lowlevellock.h
sysdeps/unix/sysv/linux/arm/lowlevellock.h
sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
sysdeps/unix/sysv/linux/i386/lowlevellock.h
sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h
sysdeps/unix/sysv/linux/m68k/lowlevellock.h
sysdeps/unix/sysv/linux/microblaze/lowlevellock.h
sysdeps/unix/sysv/linux/mips/lowlevellock.h
sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
sysdeps/unix/sysv/linux/s390/lowlevellock.h
sysdeps/unix/sysv/linux/sh/lowlevellock.h
sysdeps/unix/sysv/linux/sparc/lowlevellock.h
sysdeps/unix/sysv/linux/tile/lowlevellock.h
sysdeps/unix/sysv/linux/x86_64/lowlevellock.h

index 0bd02c4..a5bc602 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2014-07-10  Roland McGrath  <roland@hack.frob.com>
 
+       * nptl/pthread_create.c (start_thread): Use atomic_or and
+       lll_futex_wake directly rather than lll_robust_dead.
+       * sysdeps/unix/sysv/linux/aarch64/lowlevellock.h
+       (lll_robust_dead): Macro removed.
+       * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/arm/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/m68k/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/microblaze/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/mips/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/tile/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
+
        * nptl/pthread_mutex_trylock.c (__pthread_mutex_trylock):
        Use atomic_compare_and_exchange_val_acq directly rather than
        lll_robust_trylock.
index 2997163..b9af010 100644 (file)
@@ -390,7 +390,8 @@ start_thread (void *arg)
 # endif
          this->__list.__next = NULL;
 
-         lll_robust_dead (this->__lock, /* XYZ */ LLL_SHARED);
+         atomic_or (&this->__lock, FUTEX_OWNER_DIED);
+         lll_futex_wake (this->__lock, 1, /* XYZ */ LLL_SHARED);
        }
       while (robust != (void *) &pd->robust_head);
     }
index 0e61f18..2acebd4 100644 (file)
     __ret;                                                                   \
   })
 
-#define lll_robust_dead(futexv, private) \
-  do                                                                         \
-    {                                                                        \
-      int *__futexp = &(futexv);                                             \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                \
-      lll_futex_wake (__futexp, 1, private);                                 \
-    }                                                                        \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({                                                                         \
index 584094f..bd72762 100644 (file)
     INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret;                 \
   })
 
-#define lll_robust_dead(futexv, private) \
-  do                                                                         \
-    {                                                                        \
-      int *__futexp = &(futexv);                                             \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                \
-      lll_futex_wake (__futexp, 1, private);                                 \
-    }                                                                        \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({                                                                         \
index 5869971..3199d0a 100644 (file)
     __ret;                                                                   \
   })
 
-#define lll_robust_dead(futexv, private) \
-  do                                                                         \
-    {                                                                        \
-      int *__futexp = &(futexv);                                             \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                \
-      lll_futex_wake (__futexp, 1, private);                                 \
-    }                                                                        \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({                                                                         \
index 426984f..fb61d0c 100644 (file)
@@ -144,15 +144,6 @@ typedef int lll_lock_t;
     __ret;                                                                   \
   })
 
-#define lll_robust_dead(futexv, private) \
-  do                                                                         \
-    {                                                                        \
-      int *__futexp = &(futexv);                                             \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                \
-      lll_futex_wake (__futexp, 1, private);                                 \
-    }                                                                        \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
   ({                                                                      \
index 02ec8f7..9d9ae58 100644 (file)
@@ -377,21 +377,6 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
     })
 
 
-#define lll_robust_dead(futex, private) \
-  (void)                                                                     \
-    ({ int __ignore;                                                         \
-       register int _nr asm ("edx") = 1;                                     \
-       __asm __volatile (LOCK_INSTR "orl %5, (%2)\n\t"                       \
-                        LLL_EBX_LOAD                                         \
-                        LLL_ENTER_KERNEL                                     \
-                        LLL_EBX_LOAD                                         \
-                        : "=a" (__ignore)                                    \
-                        : "0" (SYS_futex), LLL_EBX_REG (&(futex)),           \
-                          "c" (__lll_private_flag (FUTEX_WAKE, private)),    \
-                          "d" (_nr), "i" (FUTEX_OWNER_DIED),                 \
-                          "i" (offsetof (tcbhead_t, sysinfo)));              \
-    })
-
 #define lll_islocked(futex) \
   (futex != LLL_LOCK_INITIALIZER)
 
index 845a153..e84f530 100644 (file)
    _r10 == -1 ? -_retval : _retval;                                    \
 })
 
-#define lll_robust_dead(futexv, private)                               \
-do                                                                     \
-  {                                                                    \
-    int *__futexp = &(futexv);                                         \
-    atomic_or (__futexp, FUTEX_OWNER_DIED);                            \
-    DO_INLINE_SYSCALL(futex, 3, (long) __futexp,                       \
-                     __lll_private_flag (FUTEX_WAKE, private), 1);     \
-  }                                                                    \
-while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(ftx, nr_wake, nr_move, mutex, val, private)       \
 ({                                                                          \
index 5ab5218..3b40449 100644 (file)
     __ret;                                                                   \
   })
 
-#define lll_robust_dead(futexv, private) \
-  do                                                                         \
-    {                                                                        \
-      int *__futexp = &(futexv);                                             \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                \
-      lll_futex_wake (__futexp, 1, private);                                 \
-    }                                                                        \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({                                                                         \
index 0de3e89..0ba63a1 100644 (file)
     __ret;                                                                     \
   })
 
-#define lll_robust_dead(futexv, private)                                       \
-  do                                                                           \
-    {                                                                          \
-      int *__futexp = &(futexv);                                               \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                  \
-      lll_futex_wake (__futexp, 1, private);                                   \
-    }                                                                          \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private)       \
   ({                                                                           \
index f984c08..9ed6338 100644 (file)
     INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;                \
   })
 
-#define lll_robust_dead(futexv, private) \
-  do                                                                         \
-    {                                                                        \
-      int *__futexp = &(futexv);                                             \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                \
-      lll_futex_wake (__futexp, 1, private);                                 \
-    }                                                                        \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({                                                                         \
index 4af4a82..d7e1e38 100644 (file)
     INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;                \
   })
 
-#define lll_robust_dead(futexv, private) \
-  do                                                                         \
-    {                                                                        \
-      INTERNAL_SYSCALL_DECL (__err);                                         \
-      int *__futexp = &(futexv);                                             \
-                                                                             \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                \
-      INTERNAL_SYSCALL (futex, __err, 4, __futexp,                           \
-                       __lll_private_flag (FUTEX_WAKE, private), 1, 0);      \
-    }                                                                        \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({                                                                         \
index 0bc6411..eaf2d58 100644 (file)
                              (nr), 0);                                       \
   })
 
-#define lll_robust_dead(futexv, private) \
-  do                                                                         \
-    {                                                                        \
-      int *__futexp = &(futexv);                                             \
-                                                                             \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                \
-      lll_futex_wake (__futexp, 1, private);                                 \
-    }                                                                        \
-  while (0)
-
 
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
index fe8374e..10a2c25 100644 (file)
@@ -301,21 +301,6 @@ extern int __lll_unlock_wake (int *__futex, int private) attribute_hidden;
            if (__result) \
              __lll_unlock_wake (__futex, private); })
 
-#define lll_robust_dead(futex, private)                       \
-  (void) ({ int __ignore, *__futex = &(futex); \
-           __asm __volatile ("\
-               .align 2\n\
-               mova 1f,r0\n\
-               mov r15,r1\n\
-               mov #-6,r15\n\
-            0: mov.l @%1,%0\n\
-               or %2,%0\n\
-               mov.l %0,@%1\n\
-            1: mov r1,r15"\
-               : "=&r" (__ignore) : "r" (__futex), "r" (FUTEX_OWNER_DIED) \
-               : "r0", "r1", "memory");        \
-           lll_futex_wake (__futex, 1, private); })
-
 # ifdef NEED_SYSCALL_INST_PAD
 #  define SYSCALL_WITH_INST_PAD "\
        trapa #0x14; or r0,r0; or r0,r0; or r0,r0; or r0,r0; or r0,r0"
index 015af35..d764075 100644 (file)
@@ -132,15 +132,6 @@ extern void __cpu_relax (void);
     INTERNAL_SYSCALL_ERROR_P (__ret, __err);                                 \
   })
 
-#define lll_robust_dead(futexv, private) \
-  do                                                                         \
-    {                                                                        \
-      int *__futexp = &(futexv);                                             \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                \
-      lll_futex_wake (__futexp, 1, private);                                 \
-    }                                                                        \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #ifdef __sparc32_atomic_do_lock
 /* Avoid FUTEX_WAKE_OP if supporting pre-v9 CPUs.  */
index 09c1b3d..e3e52a4 100644 (file)
                              (nr), 0);                                       \
   })
 
-#define lll_robust_dead(futexv, private) \
-  do                                                                         \
-    {                                                                        \
-      int *__futexp = &(futexv);                                             \
-      atomic_or (__futexp, FUTEX_OWNER_DIED);                                \
-      lll_futex_wake (__futexp, 1, private);                                 \
-    }                                                                        \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
   ({                                                                         \
index c93c68e..55b4e16 100644 (file)
@@ -378,20 +378,6 @@ extern int __lll_timedlock_elision (int *futex, short *adapt_count,
     }                                                                        \
   while (0)
 
-#define lll_robust_dead(futex, private) \
-  do                                                                         \
-    {                                                                        \
-      int ignore;                                                            \
-      __asm __volatile (LOCK_INSTR "orl %3, (%2)\n\t"                        \
-                       "syscall"                                             \
-                       : "=m" (futex), "=a" (ignore)                         \
-                       : "D" (&(futex)), "i" (FUTEX_OWNER_DIED),             \
-                         "S" (__lll_private_flag (FUTEX_WAKE, private)),     \
-                         "1" (__NR_futex), "d" (1)                           \
-                       : "cx", "r11", "cc", "memory");                       \
-    }                                                                        \
-  while (0)
-
 /* Returns non-zero if error happened, zero if success.  */
 #define lll_futex_requeue(ftx, nr_wake, nr_move, mutex, val, private) \
   ({ int __res;                                                                      \