From patchwork Mon Dec 12 12:33:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 87667 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1612772qgi; Mon, 12 Dec 2016 04:34:15 -0800 (PST) X-Received: by 10.84.174.129 with SMTP id r1mr186021296plb.19.1481546055264; Mon, 12 Dec 2016 04:34:15 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z7si43153376pgz.226.2016.12.12.04.34.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2016 04:34:15 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-75740-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-75740-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-75740-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=cGmlOb5H/seHX4X2Js1Y+Sq/nvLi1h4 f8ev3HfG1bHBqhhjp81GGWS46mDFK+fkxRvtu+eWB0ryqYTxeGl4ujngxYHoBzdU I/voVWeIXfqGzTXm+sGlviNK/JeLHGvCbSf/hjqtFltdyJwK17MPiIyoTNPJwx8y nzDRkb2o+Qgg= 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=VhA9PE9R5jL/A41K7EsGgmG/nQ8=; b=hmhhh 81Ux+Ga5TomSsF94LiykxB22BuWU/L2oZPWF80j09H1/SP0WVOJoYzKJCab68ym9 16dw4AaB4qC3ukmwCIoNMgl4rIWdYXXdMQS3PtcgbujCQ5ZMfB+IfYpLOqP8CSd3 i8QCPHrhcjX0gvfYli/AKVHDjXOnwhRwXy/AAU= Received: (qmail 8154 invoked by alias); 12 Dec 2016 12:33:40 -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 8007 invoked by uid 89); 12 Dec 2016 12:33:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=1619 X-HELO: mail-ua0-f175.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=sS4vDCE9jo/PmYPNJWVCo52tPTsk3E4VZiwU3i6nVbk=; b=keR//MCffUtGO1e2pnkMCxUrF0gDK6fiXoHMrqDJh70Ev3mn+6r/QZPd2zEF5BOqJj Sf6xQi1WKAfyc6+tnAMsJppNGBzRSbzj3eAuID2p0MDwUHUPPS9qlXIfJtdw7MhjR2Ud FMzMivmR9zw+UPp7rSw5yqLxTZiL6aMSWO9+Xkdeeeveu2XOOC0gyN07+hrVogUAJdrC VtHJuE0iFHb3z2UpYZYsw4h74diq76uXMSkxQs+u0ztWsBVyDbKvnI2u4jDj2l7L5W1p QnWK4I6lZ5Dsp5+gL/Qcl6jet9Q3spQUYC0Tiz2MA8kS+pmOP5Mv+hZJhbNph2InPKj3 4xtg== X-Gm-Message-State: AKaTC002wCZ0VUT+wdDYr/hVnhygbPAoc3NoxniaP8pJzvkvQ+3WwwqE5PKm4vQAyeWPaaf+ X-Received: by 10.176.7.73 with SMTP id h67mr71626367uah.116.1481546008093; Mon, 12 Dec 2016 04:33:28 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 10/17] Use semop syscall for Linux implementation Date: Mon, 12 Dec 2016 10:33:03 -0200 Message-Id: <1481545990-7247-11-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1481545990-7247-1-git-send-email-adhemerval.zanella@linaro.org> References: <1481545990-7247-1-git-send-email-adhemerval.zanella@linaro.org> 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/alpha/syscalls.list (semop): Remove. * sysdeps/unix/sysv/linux/arm/syscalls.list (semop): Likewise. * sysdeps/unix/sysv/linux/generic/syscalls.list (semop): Likewise. * sysdeps/unix/sysv/linux/hppa/syscalls.list (semop): Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list (semop): Likewise. * sysdeps/unix/sysv/linux/microblaze/syscalls.list (semop): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (semop): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (semop): Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list (semop): Likewise. * sysdeps/unix/sysv/linux/semop.c (semop): Use semop syscall if it is defined. --- ChangeLog | 14 ++++++++++++++ sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - sysdeps/unix/sysv/linux/microblaze/syscalls.list | 1 - sysdeps/unix/sysv/linux/mips/mips64/syscalls.list | 1 - sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list | 1 - sysdeps/unix/sysv/linux/semop.c | 10 ++++++---- sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 11 files changed, 20 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 2533263..c20543a 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -4,7 +4,6 @@ shmat - osf_shmat i:ipi __shmat shmat oldshmctl EXTRA shmctl i:iip __old_shmctl shmctl@GLIBC_2.0 shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop semtimedop - semtimedop i:ipip semtimedop sigstack - sigstack 2 sigstack diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index ef5bd01..3014db8 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -26,7 +26,6 @@ personality EXTRA personality Ei:i __personality personality shmat - shmat i:ipi __shmat shmat shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop semtimedop - semtimedop i:ipip semtimedop # proper socket implementations: diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 485f6fe..54e1778 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -2,7 +2,6 @@ # SysV APIs semtimedop - semtimedop i:ipip semtimedop -semop - semop i:ipi __semop semop shmget - shmget i:iii __shmget shmget shmctl - shmctl i:iip __shmctl shmctl shmat - shmat i:ipi __shmat shmat diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 685ab93..8fbcaba 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -5,7 +5,6 @@ shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop semtimedop - semtimedop i:ipip semtimedop # proper socket implementations: diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 56200ba..b9271cc 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -9,7 +9,6 @@ shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop semtimedop - semtimedop i:ipip semtimedop # proper socket implementations: diff --git a/sysdeps/unix/sysv/linux/microblaze/syscalls.list b/sysdeps/unix/sysv/linux/microblaze/syscalls.list index a0b8ebf..3da653d 100644 --- a/sysdeps/unix/sysv/linux/microblaze/syscalls.list +++ b/sysdeps/unix/sysv/linux/microblaze/syscalls.list @@ -11,5 +11,4 @@ personality EXTRA personality Ei:i __personality personality shmat - shmat i:ipi __shmat shmat shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop semtimedop - semtimedop i:ipip semtimedop diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list index 374fcc2..720db96 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list @@ -5,5 +5,4 @@ shmat - shmat i:ipi __shmat shmat shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop semtimedop - semtimedop i:ipip semtimedop diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list index 288e080..924d182 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list @@ -5,4 +5,3 @@ shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop diff --git a/sysdeps/unix/sysv/linux/semop.c b/sysdeps/unix/sysv/linux/semop.c index 593eb4c..c179fcc 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_DIRECT_SYSVIPC_SYSCALLS + return INLINE_SYSCALL_CALL (semop, semid, sops, nsops); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_semop, semid, nsops, 0, sops); +#endif } diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index d77a7ca..d17a186 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -10,7 +10,6 @@ shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget -semop - semop i:ipi __semop semop semtimedop - semtimedop i:ipip semtimedop syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime