summaryrefslogtreecommitdiff
path: root/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2013-02-28 16:51:56 -0500
committerChris Metcalf <cmetcalf@tilera.com>2013-02-28 18:07:33 -0500
commitfd6cdc6da490616f4d381f4d44f03d61f64da2ba (patch)
tree9ae7c22104acc44fe49b0a6b9b6f434aae0a6398 /ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
parentc7a8ba94040820cd324e02babc2d340d395138fc (diff)
downloadglibc-fd6cdc6da490616f4d381f4d44f03d61f64da2ba.tar.gz
tile: Add priority inheritance futex support
Diffstat (limited to 'ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h')
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
index e6f5d1905e..a9822ec960 100644
--- a/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h
+++ b/ports/sysdeps/unix/sysv/linux/tile/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_REQUEUE_PI 11
+#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
@@ -139,7 +141,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); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
+#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); \
+ })
static inline int __attribute__ ((always_inline))