m68k: add support for PI futexes
authorAndreas Schwab <schwab@linux-m68k.org>
Wed, 4 Dec 2013 00:41:08 +0000 (01:41 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Mon, 9 Dec 2013 23:16:01 +0000 (00:16 +0100)
ports/ChangeLog.m68k
ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h

index bbb2aab..910df22 100644 (file)
@@ -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.
index 0df6604..3a25477 100644 (file)
@@ -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
 
     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)