diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-02-28 11:33:22 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-03-05 16:28:20 -0300 |
commit | 0ddb7ea842abf63516b74d4b057c052afc6ba863 (patch) | |
tree | 92b826163313ba3d4b735db59f1971a9b44f3086 /nptl/nptl-init.c | |
parent | 590675c079d743ecf6fee9f561e46c94633a91ef (diff) | |
download | glibc-0ddb7ea842abf63516b74d4b057c052afc6ba863.zip glibc-0ddb7ea842abf63516b74d4b057c052afc6ba863.tar.gz glibc-0ddb7ea842abf63516b74d4b057c052afc6ba863.tar.bz2 |
nptl: Assume __ASSUME_FUTEX_CLOCK_REALTIME support
This patch assumes realtime clock support for nptl and thus removes
all the associated code.
For __pthread_mutex_timedlock the fallback usage for the case where
lll_futex_timed_wait_bitset it not set define is also removed. The
generic lowlevellock-futex.h always define it, so for NPTL code the
check always yield true.
Checked on x86_64-linux-gnu and i686-linux-gnu.
* nptl/nptl-init.c (__have_futex_clock_realtime,
__have_futex_clock_realtime): Remove definition.
(__pthread_initialize_minimal_internal): Remove FUTEX_CLOCK_REALTIME
check test for !__ASSUME_FUTEX_CLOCK_REALTIME.
* nptl/pthread_mutex_timedlock.c (__pthread_mutex_timedlock): Assume
__ASSUME_FUTEX_CLOCK_REALTIME support.
* sysdeps/unix/sysv/linux/i386/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_FUTEX_CLOCK_REALTIME): Remove.
* sysdeps/nptl/lowlevellock-futex.h (lll_futex_timed_wait_bitset):
Adjust comment.
Diffstat (limited to 'nptl/nptl-init.c')
-rw-r--r-- | nptl/nptl-init.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c index b5895fa..61ec8ed 100644 --- a/nptl/nptl-init.c +++ b/nptl/nptl-init.c @@ -58,15 +58,6 @@ int __set_robust_list_avail; # define set_robust_list_not_avail() do { } while (0) #endif -#ifndef __ASSUME_FUTEX_CLOCK_REALTIME -/* Nonzero if we do not have FUTEX_CLOCK_REALTIME. */ -int __have_futex_clock_realtime; -# define __set_futex_clock_realtime() \ - __have_futex_clock_realtime = 1 -#else -#define __set_futex_clock_realtime() do { } while (0) -#endif - /* Version of the library, used in libthread_db to detect mismatches. */ static const char nptl_version[] __attribute_used__ = VERSION; @@ -298,26 +289,6 @@ __pthread_initialize_minimal_internal (void) set_robust_list_not_avail (); } -#ifdef __NR_futex -# ifndef __ASSUME_FUTEX_CLOCK_REALTIME - { - int word = 0; - /* NB: the syscall actually takes six parameters. The last is the - bit mask. But since we will not actually wait at all the value - is irrelevant. Given that passing six parameters is difficult - on some architectures we just pass whatever random value the - calling convention calls for to the kernel. It causes no harm. */ - INTERNAL_SYSCALL_DECL (err); - word = INTERNAL_SYSCALL (futex, err, 5, &word, - FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME - | FUTEX_PRIVATE_FLAG, 1, NULL, 0); - assert (INTERNAL_SYSCALL_ERROR_P (word, err)); - if (INTERNAL_SYSCALL_ERRNO (word, err) != ENOSYS) - __set_futex_clock_realtime (); - } -# endif -#endif - /* Set initial thread's stack block from 0 up to __libc_stack_end. It will be bigger than it actually is, but for unwind.c/pt-longjmp.c purposes this is good enough. */ |