From patchwork Wed Nov 2 19:26:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 80537 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp291655qge; Wed, 2 Nov 2016 12:28:53 -0700 (PDT) X-Received: by 10.98.205.207 with SMTP id o198mr9694801pfg.114.1478114932920; Wed, 02 Nov 2016 12:28:52 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 75si4760397pfa.10.2016.11.02.12.28.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 12:28:52 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-74323-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; spf=pass (google.com: domain of libc-alpha-return-74323-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74323-patch=linaro.org@sourceware.org; dmarc=fail (p=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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=AA6CUVD4WY1oE/YaaK/UA4oYlR/j7hq 8BbnfkiV96KnHXhTU5qlbonx6908jSA96fMjD6qICDBcTk94/u4sGNTX6KK1I03E 0pD1nxm2OEoJT6f/fcbWOPdJzyokd37s62whiZREE5D+ICIccekfVhgFLODcnkmL 9grvtpgBHx+M= 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:subject:date:message-id:in-reply-to :references; s=default; bh=mxUFNL1EEzC7dF1XT6z6mJo2w7s=; b=MtWQM 09ol3xAbUwt4KjhuTH/W2kmNBvuP8kREnI9ZYZPhhO9XPcwhyDUDnzmXh6YFzWRJ g0Z6GX/ceeNE3J9/5CQxxIcApR29RzJW2c4MGF/O04AunnJeRmL5XuuxI3WSGOIS 6HqkP7LN4ciP4VoJctWBcDrJ++5RlCoUGUn6qI= Received: (qmail 65229 invoked by alias); 2 Nov 2016 19:27:24 -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 65150 invoked by uid 89); 2 Nov 2016 19:27:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-ua0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=6yzKFIr6Zayo29xT+H4DIYPeSVAZxUCBS33pBkpJdiE=; b=KnzOQCpCC9EBxQ+Y6jI0nUzo80+ZwNKccyR5D6l8UdvLqKK14PMdKhpDPd1MwjWh3A PPhOIGavcOQmf2XYCcX8nA/Hy8u/2c7pw3A+C8LWXcMhH8KU1tCssQ7ntXkOWtzJP2sx HVWHBZmWpxEHpxrNazwJZGtqby4co3vl+k+42yt+V6POQSLAl420S5trvkRyru5xlnxO NZVWvO8LAM+lq0qvy8zg+vV4hFw02k5M+Y0i7WvOYL/Cn7nt3kce9vmnTjomEAno5yzL m3+hsewPBgvaMBFaQkwOjMsttNTifsrbHrOr/vphcJdlgbCDbBI0I8mAUSNW62VpxYXp MbVQ== X-Gm-Message-State: ABUngveTPo0LoMNXxz6HpkE+yF5kHc6hq2hFxJK9FQ310EQbbWpBg2LdkM7yghFoiITeyNH/ X-Received: by 10.176.83.57 with SMTP id x54mr3700878uax.141.1478114832074; Wed, 02 Nov 2016 12:27:12 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 09/16] Use semop syscall for Linux implementation Date: Wed, 2 Nov 2016 17:26:46 -0200 Message-Id: <1478114813-3526-10-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1478114813-3526-1-git-send-email-adhemerval.zanella@linaro.org> References: <1478114813-3526-1-git-send-email-adhemerval.zanella@linaro.org> Changes from previous version: - Use __ASSUME_SYSVIPC_SYSCALL instead of __NR_syscall to issue the wired syscall or the ipc one. -- This patch add a direct call to semop syscall if it is supported by kernel headers. Checked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/semop.c (semop): Use semop syscall if it is defined. --- ChangeLog | 3 +++ sysdeps/unix/sysv/linux/semop.c | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/semop.c b/sysdeps/unix/sysv/linux/semop.c index 593eb4c..bd57009 100644 --- a/sysdeps/unix/sysv/linux/semop.c +++ b/sysdeps/unix/sysv/linux/semop.c @@ -16,17 +16,19 @@ License along with the GNU C Library; if not, see . */ -#include #include #include - #include -#include +#include /* Perform user-defined atomical operation of array of semaphores. */ int semop (int semid, struct sembuf *sops, size_t nsops) { - return INLINE_SYSCALL (ipc, 5, IPCOP_semop, semid, (int) nsops, 0, sops); +#ifdef __ASSUME_SYSVIPC_SYSCALL + return INLINE_SYSCALL_CALL (semop, semid, sops, nsops); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_semop, semid, nsops, 0, sops); +#endif }