From patchwork Tue Dec 27 14:01:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 89089 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp5000328qgi; Tue, 27 Dec 2016 06:05:02 -0800 (PST) X-Received: by 10.98.137.21 with SMTP id v21mr30135817pfd.48.1482847502443; Tue, 27 Dec 2016 06:05:02 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 89si46621094plf.34.2016.12.27.06.05.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 06:05:02 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-76366-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-76366-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-76366-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=o8yCHkOZctOGduA8+j6h88mW35EcAAC ghYOBYnrtHfZg2h9gMaF2YeehmElSS4pX8oa8y/guoO/vcgI63oQM5n8xYQYEi7R rwJnwVZTsMb++b1veI2Ko3VOjFMFnunqepyrYwi4SvquGCzufyHnd5d+Aw7m1IVs Dgvtw3CxX36Y= 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=j73Ih LZjrYyQvdhiuSrlyu9RyR255qXf/vsGVeid/XcZq4eU3Vdd84fQ3YaeqTE13rDPU HjbOEZgx0mZ/wKuohUXQi+2ivZXXvRPG+f0cgdQEhfT+dHCNXA94aPUa/KMXUgHF SWfHZSMGVsifT6zicLw/svbvR3Q7GGKAIYwFd0= Received: (qmail 79860 invoked by alias); 27 Dec 2016 14:02:23 -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 78262 invoked by uid 89); 27 Dec 2016 14:02:07 -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=Perform, socket, (unknown) X-HELO: mail-yw0-f171.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=sS4vDCE9jo/PmYPNJWVCo52tPTsk3E4VZiwU3i6nVbk=; b=CaBNEy6NOaQufpI73t1pkP07yqSgeUtACH18+LDVjSwollY9UkwHY8IsqvKgxfsilg hdyUHDbw/GI5UFxS1GwdAFSaX6Ck+PnwiV2vO8YaW7n78hHzsl86aSIu0y5mMPcP7zZD 9CSIrMFk8gtrhmdigVLBsIMMxbz0MsDnUL9GGjxIYMGuI/TqDW/1ejBmiTlzOluj7ugN Y+Tbq3mog8ikZunYaYn6N1ICbszHCc6ZhdOZZqk2yKZMNmaJnmsPH1+l9IyUOv8KyZrG yFFnF5iHMutTOhbVN4O6Fpi7fDHnmnQ0IcGngwuZG7AMClX0Bbqzly6VwtkdvmHoH+kj anFQ== X-Gm-Message-State: AIkVDXJIJ2v0eZO0WV9+4m2Ed3gnIOJAHR/rRIx0x/Ulvo5tui7l9n2xIQbGh/vcpch8ncSU X-Received: by 10.129.148.134 with SMTP id l128mr22092630ywg.260.1482847306862; Tue, 27 Dec 2016 06:01:46 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 10/17] Use semop syscall for Linux implementation Date: Tue, 27 Dec 2016 12:01:19 -0200 Message-Id: <1482847286-29933-11-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1482847286-29933-1-git-send-email-adhemerval.zanella@linaro.org> References: <1482847286-29933-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