public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: <libc-ports@sourceware.org>
Subject: Re: PI mutex support for pthread_cond_* now in nptl
Date: Mon, 18 Feb 2013 23:50:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1302182349470.13086@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20130218105637.GJ32163@spoyarek.pnq.redhat.com>

I've applied this patch to implement this for ARM.

diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index 3a5880b..5b5220f 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,13 @@
+2013-02-18  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #14920]
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+	(FUTEX_WAIT_REQUEUE_PI): Define.
+	(FUTEX_CMP_REQUEUE_PI): Likewise.
+	(lll_futex_wait_requeue_pi): Likewise.
+	(lll_futex_timed_wait_requeue_pi): Likewise.
+	(lll_futex_cmp_requeue_pi): Likewise.
+
 2013-02-18  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* sysdeps/unix/sysv/linux/arm/nptl/libc.abilist: Add
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
index 0278812..fe21cda 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
@@ -36,6 +36,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
 
@@ -141,6 +143,32 @@
     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);					      \
+    int __op = FUTEX_WAIT_REQUEUE_PI | clockbit;			      \
+									      \
+    INTERNAL_SYSCALL (futex, __err, 5, (futexp),			      \
+		      __lll_private_flag (__op, private),		      \
+		      (val), (timespec), mutex); 			      \
+  })
+
+#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)

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2013-02-18 23:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 10:56 Siddhesh Poyarekar
2013-02-18 23:50 ` Joseph S. Myers [this message]
2013-02-19  0:50   ` Joseph S. Myers
2013-02-19 16:42 ` Richard Henderson
2013-02-19 16:49   ` Siddhesh Poyarekar
2013-02-19 17:18   ` Joseph S. Myers
2013-02-19 17:21     ` Siddhesh Poyarekar
2013-02-19 20:06     ` Torvald Riegel
2013-02-20 18:13       ` Steven Munroe
2013-02-20 20:25         ` Torvald Riegel
2013-02-20 22:04           ` Roland McGrath
2013-02-20 22:41           ` Steven Munroe
2013-02-21  4:32           ` Siddhesh Poyarekar
     [not found]     ` <1361304381.581.80.camel__6928.53579898856$1361304432$gmane$org@triegel.csb>
2013-02-22  4:11       ` Andi Kleen
     [not found] ` <5123AB55.2070100__45742.2411222526$1361292204$gmane$org@twiddle.net>
2013-02-19 17:01   ` Andreas Schwab
2013-02-19 17:18     ` Siddhesh Poyarekar
2013-02-19 17:39       ` Andreas Schwab
2013-02-19 17:52         ` Siddhesh Poyarekar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1302182349470.13086@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=libc-ports@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).