2016-06-03 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+ * nptl/nptl-init.c [__ASSUME_SET_ROBUST_LIST]
+ (__set_robust_list_avail): Remove define.
+ [__NR_set_robust_list] (__pthread_initialize_minimal_internal):
+ Likewise.
+ * nptl/pthreadP.h [__ASSUME_SET_ROBUST_LIST]
+ (__set_robust_list_avail): Likewise.
+ * nptl/pthread_create.c
+ [__NR_set_robust_list && !__ASSUME_SET_ROBUST_LIST]
+ (START_THREAD_DEFN): Likewise.
+ * nptl/pthread_mutex_init.c [!__ASSUME_SET_ROBUST_LIST]
+ (__pthread_mutex_init): Likewise.
+ * sysdeps/unix/sysv/linux/arm/kernel-features.h
+ (__ASSUME_SET_ROBUST_LIST): Likewise.
+ * sysdeps/unix/sysv/linux/kernel-features.h:
+ (__ASSUME_SET_ROBUST_LIST): Likewise.
+ * sysdeps/unix/sysv/linux/m68k/kernel-features.h:
+ (__ASSUME_SET_ROBUST_LIST): Likewise.
+ * sysdeps/unix/sysv/linux/mips/kernel-features.h:
+ (__ASSUME_SET_ROBUST_LIST): Likewise.
+ * sysdeps/unix/sysv/linux/sparc/kernel-features.h:
+ (__ASSUME_SET_ROBUST_LIST): Likewise.
+
* nptl/pthread_mutex_init.c [__ASSUME_FUTEX_LOCK_PI]
(prio_inherit_missing): Remove define.
* sysdeps/unix/sysv/linux/arm/kernel-features.h
size_t __static_tls_size;
size_t __static_tls_align_m1;
-#ifndef __ASSUME_SET_ROBUST_LIST
/* Negative if we do not have the system call and we can use it. */
int __set_robust_list_avail;
-# define set_robust_list_not_avail() \
- __set_robust_list_avail = -1
-#else
-# define set_robust_list_not_avail() do { } while (0)
-#endif
#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
/* Nonzero if we do not have FUTEX_CLOCK_REALTIME. */
pd->robust_prev = &pd->robust_head;
#endif
pd->robust_head.list = &pd->robust_head;
-#ifdef __NR_set_robust_list
+
pd->robust_head.futex_offset = (offsetof (pthread_mutex_t, __data.__lock)
- offsetof (pthread_mutex_t,
__data.__list.__next));
int res = INTERNAL_SYSCALL (set_robust_list, err, 2, &pd->robust_head,
sizeof (struct robust_list_head));
if (INTERNAL_SYSCALL_ERROR_P (res, err))
-#endif
- set_robust_list_not_avail ();
+ __set_robust_list_avail = -1;
}
#ifdef __NR_futex
/* Number of threads running. */
extern unsigned int __nptl_nthreads attribute_hidden;
-#ifndef __ASSUME_SET_ROBUST_LIST
/* Negative if we do not have the system call and we can use it. */
extern int __set_robust_list_avail attribute_hidden;
-#endif
/* Thread Priority Protection. */
extern int __sched_fifo_min_prio attribute_hidden;
if (__glibc_unlikely (atomic_exchange_acq (&pd->setxid_futex, 0) == -2))
lll_futex_wake (&pd->setxid_futex, 1, LLL_PRIVATE);
-#ifdef __NR_set_robust_list
-# ifndef __ASSUME_SET_ROBUST_LIST
- if (__set_robust_list_avail >= 0)
-# endif
+ if (__glibc_likely (__set_robust_list_avail >= 0))
{
INTERNAL_SYSCALL_DECL (err);
/* This call should never fail because the initial call in init.c
INTERNAL_SYSCALL (set_robust_list, err, 2, &pd->robust_head,
sizeof (struct robust_list_head));
}
-#endif
#ifdef SIGCANCEL
/* If the parent was running cancellation handlers while creating
the breakpoint reports TD_THR_RUN state rather than TD_THR_ZOMBIE. */
atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
-#ifndef __ASSUME_SET_ROBUST_LIST
/* If this thread has any robust mutexes locked, handle them now. */
# ifdef __PTHREAD_MUTEX_HAVE_PREV
void *robust = pd->robust_head.list;
}
while (robust != (void *) &pd->robust_head);
}
-#endif
/* Mark the memory of the stack as usable to the kernel. We free
everything except for the space used for the TCB itself. */
if ((imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_ROBUST) != 0)
{
-#ifndef __ASSUME_SET_ROBUST_LIST
if ((imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_PSHARED) != 0
&& __set_robust_list_avail < 0)
return ENOTSUP;
-#endif
mutex->__data.__kind |= PTHREAD_MUTEX_ROBUST_NORMAL_NP;
}
configuration. */
#if __LINUX_KERNEL_VERSION < 0x030E03
# undef __ASSUME_REQUEUE_PI
-# undef __ASSUME_SET_ROBUST_LIST
#endif
they were introduced in 2.6.17-rc1, on SH in 2.6.19-rc1. */
#define __ASSUME_ATFCTS 1
-/* Support for inter-process robust mutexes was added in 2.6.17 (but
- some architectures lack futex_atomic_cmpxchg_inatomic in some
- configurations). */
-#define __ASSUME_SET_ROBUST_LIST 1
-
/* Support for private futexes was added in 2.6.22. */
#define __ASSUME_PRIVATE_FUTEX 1
/* No support for PI futexes or robust mutexes before 3.10 for m68k. */
#if __LINUX_KERNEL_VERSION < 0x030a00
# undef __ASSUME_REQUEUE_PI
-# undef __ASSUME_SET_ROBUST_LIST
#endif
emulating LL/SC. */
#if __mips == 1 || defined _MIPS_ARCH_R5900
# undef __ASSUME_REQUEUE_PI
-# undef __ASSUME_SET_ROBUST_LIST
#endif
futex_atomic_cmpxchg_inatomic. */
#if !defined __arch64__ && !defined __sparc_v9__
# undef __ASSUME_REQUEUE_PI
-# undef __ASSUME_SET_ROBUST_LIST
#endif