about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog29
-rw-r--r--sysdeps/unix/sysv/linux/arm/kernel-features.h7
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h20
-rw-r--r--sysdeps/unix/sysv/linux/m68k/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/kernel-features.h7
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel-features.h8
6 files changed, 66 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f33dd23ea0..ee4ede675a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,34 @@
 2014-03-31  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #9894]
+	* sysdeps/unix/sysv/linux/kernel-features.h
+	[__sparc__ && !__arch64__ && !__sparc_v9__]
+	(__ASSUME_SET_ROBUST_LIST): Do not define.
+	[__sparc__ && !__arch64__ && !__sparc_v9__]
+	(__ASSUME_FUTEX_LOCK_PI): Likewise.
+	[__sparc__ && !__arch64__ && !__sparc_v9__] (__ASSUME_REQUEUE_PI):
+	Likewise.
+	* sysdeps/unix/sysv/linux/arm/kernel-features.h
+	(__ASSUME_FUTEX_LOCK_PI): Undefine.
+	(__ASSUME_REQUEUE_PI): Likewise.
+	(__ASSUME_SET_ROBUST_LIST): Likewise.
+	* sysdeps/unix/sysv/linux/m68k/kernel-features.h
+	[__LINUX_KERNEL_VERSION < 0x030a00] (__ASSUME_FUTEX_LOCK_PI):
+	Undefine.
+	* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+	[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_FUTEX_LOCK_PI):
+	Likewise.
+	[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_REQUEUE_PI):
+	Likewise.
+	[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_SET_ROBUST_LIST):
+	Likewise.
+	* sysdeps/unix/sysv/linux/mips/kernel-features.h
+	[__mips == 1 || _MIPS_ARCH_R5900] (__ASSUME_FUTEX_LOCK_PI):
+	Undefine.
+	[__mips == 1 || _MIPS_ARCH_R5900] (__ASSUME_REQUEUE_PI): Likewise.
+	[__mips == 1 || _MIPS_ARCH_R5900] (__ASSUME_SET_ROBUST_LIST):
+	Likewise.
+
 	[BZ #16648]
 	* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
 	[__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_FUTIMESAT): Define.
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index 401343be8d..96b7350ede 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -53,3 +53,10 @@
 # undef __ASSUME_PSELECT
 # undef __ASSUME_PPOLL
 #endif
+
+/* The ARM kernel may or may not support
+   futex_atomic_cmpxchg_inatomic, depending on kernel
+   configuration.  */
+#undef __ASSUME_FUTEX_LOCK_PI
+#undef __ASSUME_REQUEUE_PI
+#undef __ASSUME_SET_ROBUST_LIST
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 555b82cf05..db6af35c31 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -106,9 +106,12 @@
 # define __ASSUME_ATFCTS	1
 #endif
 
-/* Support for inter-process robust mutexes was added in 2.6.17.  */
+/* Support for inter-process robust mutexes was added in 2.6.17 (but
+   some architectures lack futex_atomic_cmpxchg_inatomic in some
+   configurations).  */
 #if __LINUX_KERNEL_VERSION >= 0x020611 \
-    && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020613)
+    && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020613) \
+    && !(defined __sparc__ && !defined __arch64__ && !defined __sparc_v9__)
 # define __ASSUME_SET_ROBUST_LIST	1
 #endif
 
@@ -119,8 +122,10 @@
 # define __ASSUME_COMPLETE_READV_WRITEV	1
 #endif
 
-/* Support for PI futexes was added in 2.6.18.  */
-#if __LINUX_KERNEL_VERSION >= 0x020612
+/* Support for PI futexes was added in 2.6.18 (but some architectures
+   lack futex_atomic_cmpxchg_inatomic in some configurations).  */
+#if __LINUX_KERNEL_VERSION >= 0x020612 \
+    && !(defined __sparc__ && !defined __arch64__ && !defined __sparc_v9__)
 # define __ASSUME_FUTEX_LOCK_PI	1
 #endif
 
@@ -223,8 +228,11 @@
 # define __ASSUME_PWRITEV	1
 #endif
 
-/* Support for FUTEX_*_REQUEUE_PI was added in 2.6.31.  */
-#if __LINUX_KERNEL_VERSION >= 0x02061f
+/* Support for FUTEX_*_REQUEUE_PI was added in 2.6.31 (but some
+   architectures lack futex_atomic_cmpxchg_inatomic in some
+   configurations).  */
+#if __LINUX_KERNEL_VERSION >= 0x02061f \
+    && !(defined __sparc__ && !defined __arch64__ && !defined __sparc_v9__)
 # define __ASSUME_REQUEUE_PI	1
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index cb8915f127..bc340bdea5 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -48,6 +48,7 @@
 
 /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */
 #if __LINUX_KERNEL_VERSION < 0x030a00
+# undef __ASSUME_FUTEX_LOCK_PI
 # undef __ASSUME_REQUEUE_PI
 # undef __ASSUME_SET_ROBUST_LIST
 #endif
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
index e7f6db2285..c7c8c030bd 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
@@ -48,6 +48,13 @@
 
 #include_next <kernel-features.h>
 
+/* Support for futex_atomic_cmpxchg_inatomic was added in 2.6.33.  */
+#if __LINUX_KERNEL_VERSION < 0x020621
+# undef __ASSUME_FUTEX_LOCK_PI
+# undef __ASSUME_REQUEUE_PI
+# undef __ASSUME_SET_ROBUST_LIST
+#endif
+
 /* The MicroBlaze kernel does not support the pselect6, preadv and
    pwritev syscalls.  */
 #undef __ASSUME_PSELECT
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index 52cbf3a5ba..19d3cba1b0 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -53,3 +53,11 @@
 #if _MIPS_SIM == _ABIN32 && __LINUX_KERNEL_VERSION < 0x020623
 # undef __ASSUME_GETDENTS64_SYSCALL
 #endif
+
+/* The MIPS kernel does not support futex_atomic_cmpxchg_inatomic if
+   emulating LL/SC.  */
+#if __mips == 1 || defined _MIPS_ARCH_R5900
+# undef __ASSUME_FUTEX_LOCK_PI
+# undef __ASSUME_REQUEUE_PI
+# undef __ASSUME_SET_ROBUST_LIST
+#endif