From patchwork Wed Oct 30 20:00:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 178128 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1755418ill; Wed, 30 Oct 2019 13:02:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/6TVAb+EvF0LiqZEnm99WmOhuOD1BwtgZso1mbi7t/rbmwoO/PRI2MZaX7xU4sJdZjZuu X-Received: by 2002:a50:a9e3:: with SMTP id n90mr1737080edc.52.1572465748890; Wed, 30 Oct 2019 13:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572465748; cv=none; d=google.com; s=arc-20160816; b=mfW1POC2dsC78mm5CLbRt7+0L4BiVZAnH20UL0Rdw3pnoRFWm9PfJRCy7rVZV8qgLF OteBGC4v8zQxlGDj0BZGfLcoTclX2iQoVijbNQlZUvZOrtTZ1Kl7oBEWDPFj7LYvIBkB p1gqXgqtoWWVUIKSBSDB5U8DUMbQC0SptIZ3IoSTOau+FQVKNpJ9sY+M1YXuP/sc0Mh8 A4YYYBPQO7/rE8DYxaDkPNLg/wW00fuXHarLbEjpLqEWtrMNrthwInMO595ukkz25sdk 7uTX61lI37BwRkY+vTRcrQ2Vvf/2YbccAXbsqf/WUhDLdcuGicHhVJVxoKgM94ZCV4KF HAbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=v/W3gNn2tsSk4aA0PXEwDFn0QRziyq5xeEnfkDgEI1s=; b=m08klWOWUaFlDRS1JseOVvgAb+hG4RvTQ+ke8hHQlRaZGM6hBgmHBmqw5R8Rfl5Aie puzd1JFv7PPq95NqnaLMB2AuaNsXqK3BJo0ul/M/ma1p62Yc39ugwUW+G972ipMhrL13 /uXwqnFY9wa19saI2FjY+o6N3pHosaRhMpspL0jyUVs0M0c4PqrPxhiMJiiPI/CUkOqg d0npJYdfJr73ekLjl1/6HK2v7bp1jHRzxbZKJWZB30NV8JnsKoV3+m9yBQPl9XMyHqQK O1vt0gC9AsOmbtskOlkrDdkMoiHESKani9hj0iBCwJvE+9vGKl7G2LaEdfbPnO8H7dks rrMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=wajD3+bu; dkim=pass header.i=@linaro.org header.s=google header.b=QdSruEoK; spf=pass (google.com: domain of libc-alpha-return-106480-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-106480-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id m16si2099668ejd.306.2019.10.30.13.02.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Oct 2019 13:02:28 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-106480-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=wajD3+bu; dkim=pass header.i=@linaro.org header.s=google header.b=QdSruEoK; spf=pass (google.com: domain of libc-alpha-return-106480-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-106480-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=h/oLWV/6v2v6OOLxwoXCPKBYzSgnCf3 7Kf/doHZbj8iDcFJhJmaM0HMytLZq3/3JjAP/k1XKi4tR1bqiczKAAY76sul/TjU X5hG4saucjtk+He4Phf50k+E4AtUNpv15Qpd7mIvgh26XofdVk2pbm19NdxekD1x uqb98VQ5Oej0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=9MwHDOu/fmRk1/8Rz857MUc2A7U=; b=wajD3 +buXeIcS9d/1/4qMVFkE4T/HddhrEqraWrMSinr6eT9KlnbzD5VVLWqxF8tr9WRU 90qCMxUAERBVTxz2xPXm+AOthN8uRrggwdGXe7oZYIGOKkFjFVUKLlFt9YNcRiw0 0rPxhzd5rnD22sjrhNFcST8uZ4p7INYRL1g8iQ= Received: (qmail 83398 invoked by alias); 30 Oct 2019 20:01:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 78694 invoked by uid 89); 30 Oct 2019 20:01:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=lowlevel, low-level X-HELO: mail-qt1-f196.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=v/W3gNn2tsSk4aA0PXEwDFn0QRziyq5xeEnfkDgEI1s=; b=QdSruEoKs7o5EZHVDfM4gfF1mG1HKwAkwvbOCBkUPcMuUGZD+hnfBj4JPYL8M9SJtE WmTY2doTESFzZjbF8+hWtz8UDw/uDLGqy2iwGLViV24O51gK+S+PEmDiZ6kzd9mObeup 6cNciweqqWSQKUxLE4s8twQ9oeoqtx4Gy/XDrNxDnd1D+hD9M8nwiFVQojYFpmrjx9f2 FrmsGllMdGIW09wGqImW7Ut1ltvHyFJgceP3qLr/fENmboqcv0jMU2kjHg+ffgDqrYiE az3BHsfWbNQ3ZjRVtrPhHJBK7WEYrRMBJYpGf8yk97fiJOKcPhySiL/r7Lo3pog1ItK5 mUOg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Alistair Francis Subject: [PATCH 2/5] Consolidate lowlevellock-futex.h Date: Wed, 30 Oct 2019 17:00:49 -0300 Message-Id: <20191030200052.497-2-adhemerval.zanella@linaro.org> In-Reply-To: <20191030200052.497-1-adhemerval.zanella@linaro.org> References: <20191030200052.497-1-adhemerval.zanella@linaro.org> NPTL is already Linux specific, there is no need to parametrize low level lock futex operations and add a sysdep Linux specific implementation. This patch moves the relevant Linux code to nptl one. Checked on x86_64-linux-gnu and i686-linux-gnu. --- sysdeps/nptl/lowlevellock-futex.h | 165 ++++++++++++++---- sysdeps/unix/sysv/linux/lowlevellock-futex.h | 168 ------------------- 2 files changed, 128 insertions(+), 205 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/lowlevellock-futex.h -- 2.17.1 Reviewed-by: Carlos O'Donell diff --git a/sysdeps/nptl/lowlevellock-futex.h b/sysdeps/nptl/lowlevellock-futex.h index 4cceade0db..392277e8a5 100644 --- a/sysdeps/nptl/lowlevellock-futex.h +++ b/sysdeps/nptl/lowlevellock-futex.h @@ -19,14 +19,60 @@ #ifndef _LOWLEVELLOCK_FUTEX_H #define _LOWLEVELLOCK_FUTEX_H 1 -#include - - -/* Values for 'private' parameter of locking macros. Note pthreadP.h - optimizes for these exact values, though they are not required. */ -#define LLL_PRIVATE 0 -#define LLL_SHARED 128 - +#ifndef __ASSEMBLER__ +# include +# include +# include +#endif + +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 +#define FUTEX_REQUEUE 3 +#define FUTEX_CMP_REQUEUE 4 +#define FUTEX_WAKE_OP 5 +#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) +#define FUTEX_LOCK_PI 6 +#define FUTEX_UNLOCK_PI 7 +#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 + +#define FUTEX_BITSET_MATCH_ANY 0xffffffff + +/* Values for 'private' parameter of locking macros. Yes, the + definition seems to be backwards. But it is not. The bit will be + reversed before passing to the system call. */ +#define LLL_PRIVATE 0 +#define LLL_SHARED FUTEX_PRIVATE_FLAG + +#ifndef __ASSEMBLER__ + +# if IS_IN (libc) || IS_IN (rtld) +/* In libc.so or ld.so all futexes are private. */ +# define __lll_private_flag(fl, private) \ + ({ \ + /* Prevent warnings in callers of this macro. */ \ + int __lll_private_flag_priv __attribute__ ((unused)); \ + __lll_private_flag_priv = (private); \ + ((fl) | FUTEX_PRIVATE_FLAG); \ + }) +# else +# define __lll_private_flag(fl, private) \ + (((fl) | FUTEX_PRIVATE_FLAG) ^ (private)) +# endif + +# define lll_futex_syscall(nargs, futexp, op, ...) \ + ({ \ + INTERNAL_SYSCALL_DECL (__err); \ + long int __ret = INTERNAL_SYSCALL (futex, __err, nargs, futexp, op, \ + __VA_ARGS__); \ + (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (__ret, __err)) \ + ? -INTERNAL_SYSCALL_ERRNO (__ret, __err) : 0); \ + }) /* For most of these macros, the return value is never really used. Nevertheless, the protocol is that each one returns a negated errno @@ -36,62 +82,107 @@ /* Wait while *FUTEXP == VAL for an lll_futex_wake call on FUTEXP. */ -#define lll_futex_wait(futexp, val, private) \ +# define lll_futex_wait(futexp, val, private) \ lll_futex_timed_wait (futexp, val, NULL, private) -/* Wait until a lll_futex_wake call on FUTEXP, or TIMEOUT elapses. */ -#define lll_futex_timed_wait(futexp, val, timeout, private) \ - -ENOSYS +# define lll_futex_timed_wait(futexp, val, timeout, private) \ + lll_futex_syscall (4, futexp, \ + __lll_private_flag (FUTEX_WAIT, private), \ + val, timeout) /* Verify whether the supplied clockid is supported by lll_futex_clock_wait_bitset. */ -#define lll_futex_supported_clockid(clockid) \ - (0) - -/* Wait until a lll_futex_wake call on FUTEXP, or the absolute TIMEOUT - measured against CLOCKID elapses. CLOCKID may be CLOCK_REALTIME or - CLOCK_MONOTONIC. */ -#define lll_futex_clock_wait_bitset(futexp, val, clockid, timeout, private) \ - -ENOSYS +# define lll_futex_supported_clockid(clockid) \ + ((clockid) == CLOCK_REALTIME || (clockid) == CLOCK_MONOTONIC) + +/* The kernel currently only supports CLOCK_MONOTONIC or + CLOCK_REALTIME timeouts for FUTEX_WAIT_BITSET. We could attempt to + convert others here but currently do not. */ +# define lll_futex_clock_wait_bitset(futexp, val, clockid, timeout, private) \ + ({ \ + long int __ret; \ + if (lll_futex_supported_clockid (clockid)) \ + { \ + const unsigned int clockbit = \ + (clockid == CLOCK_REALTIME) ? FUTEX_CLOCK_REALTIME : 0; \ + const int op = \ + __lll_private_flag (FUTEX_WAIT_BITSET | clockbit, private); \ + \ + __ret = lll_futex_syscall (6, futexp, op, val, \ + timeout, NULL /* Unused. */, \ + FUTEX_BITSET_MATCH_ANY); \ + } \ + else \ + __ret = -EINVAL; \ + __ret; \ + }) /* Wake up up to NR waiters on FUTEXP. */ -#define lll_futex_wake(futexp, nr, private) \ - -ENOSYS +# define lll_futex_wake(futexp, nr, private) \ + lll_futex_syscall (4, futexp, \ + __lll_private_flag (FUTEX_WAKE, private), nr, 0) /* Wake up up to NR_WAKE waiters on FUTEXP. Move up to NR_MOVE of the - rest from waiting on FUTEXP to waiting on MUTEX (a different futex). */ -#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ - -ENOSYS + rest from waiting on FUTEXP to waiting on MUTEX (a different futex). + Returns non-zero if error happened, zero if success. */ +# define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ + lll_futex_syscall (6, futexp, \ + __lll_private_flag (FUTEX_CMP_REQUEUE, private), \ + nr_wake, nr_move, mutex, val) + +/* Wake up up to NR_WAKE waiters on FUTEXP and NR_WAKE2 on FUTEXP2. + Returns non-zero if error happened, zero if success. */ +# define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ + lll_futex_syscall (6, futexp, \ + __lll_private_flag (FUTEX_WAKE_OP, private), \ + nr_wake, nr_wake2, futexp2, \ + FUTEX_OP_CLEAR_WAKE_IF_GT_ONE) -/* Wake up up to NR_WAKE waiters on FUTEXP and NR_WAKE2 on FUTEXP2. */ -#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ - -ENOSYS +/* Priority Inheritance support. */ /* Like lll_futex_wait (FUTEXP, VAL, PRIVATE) but with the expectation that lll_futex_cmp_requeue_pi (FUTEXP, _, _, MUTEX, _, PRIVATE) will be used to do the wakeup. Confers priority-inheritance behavior on the waiter. */ -#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \ +# define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \ lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private) /* Like lll_futex_wait_requeue_pi, but with a timeout. */ -#define lll_futex_timed_wait_requeue_pi(futexp, val, timeout, clockbit, \ +# define lll_futex_timed_wait_requeue_pi(futexp, val, timeout, clockbit, \ mutex, private) \ - -ENOSYS + lll_futex_syscall (5, futexp, \ + __lll_private_flag (FUTEX_WAIT_REQUEUE_PI \ + | (clockbit), private), \ + val, timeout, mutex) /* Like lll_futex_requeue, but pairs with lll_futex_wait_requeue_pi and inherits priority from the waiter. */ -#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, \ +# define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, \ val, private) \ - -ENOSYS + lll_futex_syscall (6, futexp, \ + __lll_private_flag (FUTEX_CMP_REQUEUE_PI, \ + private), \ + nr_wake, nr_move, mutex, val) /* Like lll_futex_wait, but acting as a cancellable entrypoint. */ -#define lll_futex_wait_cancel(futexp, val, private) \ - -ENOSYS +# define lll_futex_wait_cancel(futexp, val, private) \ + ({ \ + int __oldtype = CANCEL_ASYNC (); \ + long int __err = lll_futex_wait (futexp, val, LLL_SHARED); \ + CANCEL_RESET (__oldtype); \ + __err; \ + }) /* Like lll_futex_timed_wait, but acting as a cancellable entrypoint. */ -#define lll_futex_timed_wait_cancel(futexp, val, timeout, private) \ - -ENOSYS +# define lll_futex_timed_wait_cancel(futexp, val, timeout, private) \ + ({ \ + int __oldtype = CANCEL_ASYNC (); \ + long int __err = lll_futex_timed_wait (futexp, val, timeout, private); \ + CANCEL_RESET (__oldtype); \ + __err; \ + }) + +#endif /* !__ASSEMBLER__ */ #endif /* lowlevellock-futex.h */ diff --git a/sysdeps/unix/sysv/linux/lowlevellock-futex.h b/sysdeps/unix/sysv/linux/lowlevellock-futex.h deleted file mode 100644 index b423673ed4..0000000000 --- a/sysdeps/unix/sysv/linux/lowlevellock-futex.h +++ /dev/null @@ -1,168 +0,0 @@ -/* Low-level locking access to futex facilities. Linux version. - Copyright (C) 2005-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _LOWLEVELLOCK_FUTEX_H -#define _LOWLEVELLOCK_FUTEX_H 1 - -#ifndef __ASSEMBLER__ -#include -#include -#include -#endif - -#define FUTEX_WAIT 0 -#define FUTEX_WAKE 1 -#define FUTEX_REQUEUE 3 -#define FUTEX_CMP_REQUEUE 4 -#define FUTEX_WAKE_OP 5 -#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1) -#define FUTEX_LOCK_PI 6 -#define FUTEX_UNLOCK_PI 7 -#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 - -#define FUTEX_BITSET_MATCH_ANY 0xffffffff - -/* Values for 'private' parameter of locking macros. Yes, the - definition seems to be backwards. But it is not. The bit will be - reversed before passing to the system call. */ -#define LLL_PRIVATE 0 -#define LLL_SHARED FUTEX_PRIVATE_FLAG - -#ifndef __ASSEMBLER__ - -#if IS_IN (libc) || IS_IN (rtld) -/* In libc.so or ld.so all futexes are private. */ -# define __lll_private_flag(fl, private) \ - ({ \ - /* Prevent warnings in callers of this macro. */ \ - int __lll_private_flag_priv __attribute__ ((unused)); \ - __lll_private_flag_priv = (private); \ - ((fl) | FUTEX_PRIVATE_FLAG); \ - }) -#else -# define __lll_private_flag(fl, private) \ - (((fl) | FUTEX_PRIVATE_FLAG) ^ (private)) -#endif - -#define lll_futex_syscall(nargs, futexp, op, ...) \ - ({ \ - INTERNAL_SYSCALL_DECL (__err); \ - long int __ret = INTERNAL_SYSCALL (futex, __err, nargs, futexp, op, \ - __VA_ARGS__); \ - (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (__ret, __err)) \ - ? -INTERNAL_SYSCALL_ERRNO (__ret, __err) : 0); \ - }) - -#define lll_futex_wait(futexp, val, private) \ - lll_futex_timed_wait (futexp, val, NULL, private) - -#define lll_futex_timed_wait(futexp, val, timeout, private) \ - lll_futex_syscall (4, futexp, \ - __lll_private_flag (FUTEX_WAIT, private), \ - val, timeout) - -/* Verify whether the supplied clockid is supported by - lll_futex_clock_wait_bitset. */ -#define lll_futex_supported_clockid(clockid) \ - ((clockid) == CLOCK_REALTIME || (clockid) == CLOCK_MONOTONIC) - -/* The kernel currently only supports CLOCK_MONOTONIC or - CLOCK_REALTIME timeouts for FUTEX_WAIT_BITSET. We could attempt to - convert others here but currently do not. */ -#define lll_futex_clock_wait_bitset(futexp, val, clockid, timeout, private) \ - ({ \ - long int __ret; \ - if (lll_futex_supported_clockid (clockid)) \ - { \ - const unsigned int clockbit = \ - (clockid == CLOCK_REALTIME) ? FUTEX_CLOCK_REALTIME : 0; \ - const int op = \ - __lll_private_flag (FUTEX_WAIT_BITSET | clockbit, private); \ - \ - __ret = lll_futex_syscall (6, futexp, op, val, \ - timeout, NULL /* Unused. */, \ - FUTEX_BITSET_MATCH_ANY); \ - } \ - else \ - __ret = -EINVAL; \ - __ret; \ - }) - -#define lll_futex_wake(futexp, nr, private) \ - lll_futex_syscall (4, futexp, \ - __lll_private_flag (FUTEX_WAKE, private), nr, 0) - -/* Returns non-zero if error happened, zero if success. */ -#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ - lll_futex_syscall (6, futexp, \ - __lll_private_flag (FUTEX_CMP_REQUEUE, private), \ - nr_wake, nr_move, mutex, val) - -/* Returns non-zero if error happened, zero if success. */ -#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ - lll_futex_syscall (6, futexp, \ - __lll_private_flag (FUTEX_WAKE_OP, private), \ - nr_wake, nr_wake2, futexp2, \ - FUTEX_OP_CLEAR_WAKE_IF_GT_ONE) - -/* 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, timeout, clockbit, \ - mutex, private) \ - lll_futex_syscall (5, futexp, \ - __lll_private_flag (FUTEX_WAIT_REQUEUE_PI \ - | (clockbit), private), \ - val, timeout, mutex) - - -#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, \ - val, private) \ - lll_futex_syscall (6, futexp, \ - __lll_private_flag (FUTEX_CMP_REQUEUE_PI, \ - private), \ - nr_wake, nr_move, mutex, val) - - -/* Cancellable futex macros. */ -#define lll_futex_wait_cancel(futexp, val, private) \ - ({ \ - int __oldtype = CANCEL_ASYNC (); \ - long int __err = lll_futex_wait (futexp, val, LLL_SHARED); \ - CANCEL_RESET (__oldtype); \ - __err; \ - }) - -#define lll_futex_timed_wait_cancel(futexp, val, timeout, private) \ - ({ \ - int __oldtype = CANCEL_ASYNC (); \ - long int __err = lll_futex_timed_wait (futexp, val, timeout, private); \ - CANCEL_RESET (__oldtype); \ - __err; \ - }) - -#endif /* !__ASSEMBLER__ */ - -#endif /* lowlevellock-futex.h */