Get rid of lll_robust_dead.

This commit is contained in:
Roland McGrath 2014-07-10 11:21:54 -07:00
parent 887865fcfa
commit c0c6bac945
17 changed files with 21 additions and 158 deletions

View File

@ -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.

View 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);
}

View File

@ -111,15 +111,6 @@
__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) \
({ \

View File

@ -113,15 +113,6 @@
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) \
({ \

View File

@ -110,15 +110,6 @@
__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) \
({ \

View 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) \
({ \

View 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)

View File

@ -110,16 +110,6 @@
_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) \
({ \

View File

@ -112,15 +112,6 @@
__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) \
({ \

View File

@ -112,15 +112,6 @@
__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) \
({ \

View File

@ -110,15 +110,6 @@
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) \
({ \

View File

@ -114,18 +114,6 @@
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) \
({ \

View File

@ -107,16 +107,6 @@
(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) \

View 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"

View 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. */

View File

@ -109,15 +109,6 @@
(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) \
({ \

View 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; \