From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17662 invoked by alias); 28 Feb 2013 23:08:12 -0000 Received: (qmail 17621 invoked by uid 22791); 28 Feb 2013 23:08:11 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,KHOP_SPAMHAUS_DROP,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from usmamail.tilera.com (HELO USMAMAIL.TILERA.COM) (12.216.194.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Feb 2013 23:07:58 +0000 Received: from farm-0002.internal.tilera.com (10.2.0.32) by USMAEXCH2.tad.internal.tilera.com (10.3.0.33) with Microsoft SMTP Server (TLS) id 14.0.722.0; Thu, 28 Feb 2013 18:07:58 -0500 Received: (from cmetcalf@localhost) by farm-0002.internal.tilera.com (8.14.4/8.12.11/Submit) id r1SN7vcJ017909; Thu, 28 Feb 2013 18:07:57 -0500 Message-ID: <201302282307.r1SN7vcJ017909@farm-0002.internal.tilera.com> From: Chris Metcalf Date: Thu, 28 Feb 2013 23:08:00 -0000 Subject: [COMMITTED PATCH] tile: Add priority inheritance futex support To: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00144.txt.bz2 --- ports/ChangeLog.tile | 9 ++++++ .../unix/sysv/linux/tile/nptl/lowlevellock.h | 28 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-) diff --git a/ports/ChangeLog.tile b/ports/ChangeLog.tile index a473b30..6184bf6 100644 --- a/ports/ChangeLog.tile +++ b/ports/ChangeLog.tile @@ -1,3 +1,12 @@ +2013-02-28 Chris Metcalf + + * sysdeps/unix/sysv/linux/tile/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 * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist: diff --git a/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h b/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h index e6f5d19..a9822ec 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)) -- 1.7.1