aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2013-12-04 01:41:08 +0100
committerAndreas Schwab <schwab@linux-m68k.org>2013-12-10 00:16:01 +0100
commite1c5c75ea265234164332ded6c272528e38df291 (patch)
treed21ced3cd93de43aed7b6bb29adb87f550561d36 /ports
parent2ea296002440d0ae34cdd87b696c2668ff26b249 (diff)
downloadglibc-e1c5c75ea265234164332ded6c272528e38df291.tar
glibc-e1c5c75ea265234164332ded6c272528e38df291.tar.gz
glibc-e1c5c75ea265234164332ded6c272528e38df291.tar.bz2
glibc-e1c5c75ea265234164332ded6c272528e38df291.zip
m68k: add support for PI futexes
Diffstat (limited to 'ports')
-rw-r--r--ports/ChangeLog.m68k5
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h29
2 files changed, 34 insertions, 0 deletions
diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k
index bbb2aab0ad..910df22aff 100644
--- a/ports/ChangeLog.m68k
+++ b/ports/ChangeLog.m68k
@@ -1,5 +1,10 @@
2013-12-10 Andreas Schwab <schwab@linux-m68k.org>
+ * sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
+ (FUTEX_WAIT_REQEUE_PI, FUTEX_CMP_REQEUE_PI)
+ (lll_futex_wait_requeue_pi, lll_futex_timed_wait_requeue_pi)
+ (lll_futex_cmp_requeue_pi): Define.
+
* sysdeps/unix/sysv/linux/m68k/kernel-features.h
(__ASSUME_REQUEUE_PI, __ASSUME_SET_ROBUST_LIST): Undefine before
3.10.
diff --git a/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
index 0df660447f..3a2547765f 100644
--- a/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
+++ b/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h
@@ -38,6 +38,8 @@
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
+#define FUTEX_WAIT_REQEUE_PI 11
+#define FUTEX_CMP_REQEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -142,6 +144,33 @@
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
+/* Priority Inheritance support. */
+#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
+ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
+
+#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
+ mutex, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), mutex); \
+ __ret; \
+ })
+
+#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
+ (nr_wake), (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
#define lll_trylock(lock) \
atomic_compare_and_exchange_val_acq (&(lock), 1, 0)