From patchwork Tue Nov 8 20:30:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 81399 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1743077qge; Tue, 8 Nov 2016 12:32:58 -0800 (PST) X-Received: by 10.98.65.156 with SMTP id g28mr3957379pfd.110.1478637178299; Tue, 08 Nov 2016 12:32:58 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id a5si38573263pgd.80.2016.11.08.12.32.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 12:32:58 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-74539-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-74539-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74539-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=S0qjlx3VfWWftw+rsGrLFTHVGezeM72 uvqaSwo7qGLAr+Gtux56oJNJOf2gb2txGuNeSjkEZT4Pj2R1i+nAVa0bHxUm4qVK g41RwAsEF42Z0iWFR1ZGnNXqmTCadXlF9aAq+U9kYMq8cIDV96PExrHa068mmMAS k5XeBbxfNfIM= 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=8ifwJa5yk+GMNsDDgpt0fru71jA=; b=sMNaN ncAMaQxTldaaa8L2h9Rtraa3DeD/gLpctjMd8rpE78jodCs0znm1Q7FJkS0viIOZ mVtWXhPkPoSDYcIg5yDwQLNGs1fJiR2OlR88U/lrDNTZqSNx3dyNhYUzWKGFKCr2 LDZlajNOebJHWo0n/XwxGVEPX8TUEJIXKk2Wck= Received: (qmail 125171 invoked by alias); 8 Nov 2016 20:30:43 -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 125070 invoked by uid 89); 8 Nov 2016 20:30:42 -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=96, 9, 6, UD:syscall.h, adhemervalzanellalinaroorg X-HELO: mail-ua0-f180.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=z+Ovx3/Ym0byNPMUIL23AF5wALAunTAKJu6vUqG+05I=; b=d7Q+PuN9LlNgla4JigVerrBMGr2f38JNCkgiT6Ciuw2CwbHyPAd8T7o9Oss1mvf9fQ 7DLn+A2sJeM97JhiMY6oNqf3lEfW/2rxkJBkrnOWUsKSKLAgCjiy6g1ZZO109HlRKUCF PwvIiTUmJwPhyCBiP+8e5UPPVS0xZObwPfePYpALO+97cMMGiotHO32T3DvuhNsxeiRf KP89GMMmY0nE6hynDhDY0/vR5sUTflwMXs9RQrGYTGRLmfYqmJ8BKMhCwkE8xcQsCZ8/ PU8ZoltU/gBLGppKCH8koVPaSP/Vnj64XBVojnOfuB5LLFLX0lX1l2MbJ5R6K3SEerlJ aTKA== X-Gm-Message-State: ABUngvchOtletVxjF9+JrlvevdvK85YWaouVk87GHCgTFkjYx0A3WauLBGLydM6nBOu/120H X-Received: by 10.176.1.11 with SMTP id 11mr9685706uak.172.1478637031727; Tue, 08 Nov 2016 12:30:31 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v3 10/17] Use semop syscall for Linux implementation Date: Tue, 8 Nov 2016 18:30:00 -0200 Message-Id: <1478637007-31212-11-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1478637007-31212-1-git-send-email-adhemerval.zanella@linaro.org> References: <1478637007-31212-1-git-send-email-adhemerval.zanella@linaro.org> Changes from previous version: - Remove semop from syscalls.list. -- 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/ChangeLog b/ChangeLog index 6544bfd..d7a8b00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2016-11-08 Adhemerval Zanella + * 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. + * sysdeps/unix/sysv/linux/alpha/syscalls.list (semget): Remove. * sysdeps/unix/sysv/linux/arm/syscalls.list (semget): Likewise. * sysdeps/unix/sysv/linux/generic/syscalls.list (semget): Likewise. 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 facae19..308e9f8 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list @@ -8,5 +8,4 @@ truncate - truncate i:si truncate truncate64 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..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 } diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index a6d2636..0a333a4 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,7 +6,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