From patchwork Tue Dec 27 14:01:24 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: 89090 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp5000421qgi; Tue, 27 Dec 2016 06:05:12 -0800 (PST) X-Received: by 10.99.172.9 with SMTP id v9mr29203850pge.12.1482847512101; Tue, 27 Dec 2016 06:05:12 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e5si46578546plb.138.2016.12.27.06.05.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 06:05:12 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-76367-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-76367-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-76367-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=ZbtE52ucMPH/xT/fXrRV2+OOS59S7Nw G2Sz7XTCBxdC0oU/Hg2udGidkhM7xi/0GSU1aKiA8lSFgUQN9rTmz/jd5uuQ/+l6 pwkJYAcHiy94p/OzAqCBZaeD62RyXatHrD2MsdDrsiBmhBsY/DhKmuw/srDNf3vR D4JT3VvYXwZQ= 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=m0KYhsEOnMyrFGhr7AWomJpuDu8=; b=HV8jq XTivlf5bCgnLA4Tcsgf0szV0t7QjAqtSPq2z+vXBjB6Z2qUftTY4D1CiJne7H4iE hzG9nj9alANI2ddZs647goD6OLKb30L3yjMjQKowRnm8TTfbT//kcZnCLv1L75nT KLlVCoQew+uIPgNZgEZD+5sd9EBK9Fyzhp+A/M= Received: (qmail 79908 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 78261 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=socket X-HELO: mail-yw0-f176.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=TzsDwBn/OYY55JDhiZ35nWjvXDtxbJsThxygnwPHO0c=; b=Cw7ysH0dSzITTco6M8Ta/Ut+Tc2Jfb9HeDgHT99YOGsXYvKRmDjSuKX/GnM+pcdTxj zXfWH5vMe2nFoOSOi3k/VcRzxzCKyUIQU5hOPGR1u4MgiUTxSvsTFH0sZGpGLBbfJPmh 8Sc303xNCjuc/58odlJv8D2VzMHI3P7mtbPDpzWleBYt2Pibm+br0AQbIvubzo+ZCKSN +6CyBXtF8lweMVLyGy42EsVdConizT6VYHeLOrKoMqscz0PrdaRrVK3Qr1flW4K6w8sW xQqQUfyBQ1QoG+CrcPN1z8d5Z5SNJw5Sqnxuos8vxvDeMRrL5pG2QFc6MAT9jFBsLL0k DRaw== X-Gm-Message-State: AIkVDXJLa7uKE3FIbiDszp3XolEPaFNkHPMb1Vqp8fdS6/waiTZdqc7vIPktAkgbSM5uqxj1 X-Received: by 10.129.4.130 with SMTP id 124mr23873370ywe.333.1482847313388; Tue, 27 Dec 2016 06:01:53 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 15/17] Use shmdt syscall for linux implementation Date: Tue, 27 Dec 2016 12:01:24 -0200 Message-Id: <1482847286-29933-16-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 shmdt syscall if it is supported by kernel features. hecked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/alpha/syscalls.list (shmdt): Remove. * sysdeps/unix/sysv/linux/arm/syscalls.list (shmdt): Likewise. * sysdeps/unix/sysv/linux/generic/syscalls.list (shmdt): Likewise. * sysdeps/unix/sysv/linux/hppa/syscalls.list (shmdt): Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list (shmdt): Likewise. * sysdeps/unix/sysv/linux/microblaze/syscalls.list (shmdt): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (shmdt): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (shmdt): Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list (shmdt): Likewise. * sysdeps/unix/sysv/linux/shmdt.c (shmdt): Use shmdt 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/shmdt.c | 12 +++++++----- sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 11 files changed, 21 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index bf9c8ad..096bf22 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -1,6 +1,5 @@ # File name Caller Syscall name # args Strong name Weak names -shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget sigstack - sigstack 2 sigstack diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index f50a5cf..b1ea664 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -23,7 +23,6 @@ personality EXTRA personality Ei:i __personality personality # Semaphore and shm system calls. msgctl, shmctl, and semctl have C # wrappers (to set __IPC_64). -shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget # proper socket implementations: diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 80244c4..51ce148 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -2,7 +2,6 @@ # SysV APIs shmget - shmget i:iii __shmget shmget -shmdt - shmdt i:s __shmdt shmdt # Socket APIs socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index d755bfd..e75dd43 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # semaphore and shm system calls -shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget # proper socket implementations: diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 90bd870..5ebade1 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -5,7 +5,6 @@ umount2 - umount 2 __umount2 umount2 getpriority - getpriority i:ii __getpriority getpriority # semaphore and shm system calls -shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget # proper socket implementations: diff --git a/sysdeps/unix/sysv/linux/microblaze/syscalls.list b/sysdeps/unix/sysv/linux/microblaze/syscalls.list index 8b844f2..7a5666f 100644 --- a/sysdeps/unix/sysv/linux/microblaze/syscalls.list +++ b/sysdeps/unix/sysv/linux/microblaze/syscalls.list @@ -8,5 +8,4 @@ personality EXTRA personality Ei:i __personality personality # Semaphore and shm system calls. msgctl, shmctl, and semctl have C # wrappers (to set __IPC_64). -shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list index e93c87a..e8e381b 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list @@ -2,5 +2,4 @@ # Semaphore and shm system calls. msgctl, shmctl, and semctl have C # wrappers (to set __IPC_64). -shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list index 4d478ce..0ccbffa 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list @@ -1,5 +1,4 @@ # File name Caller Syscall name # args Strong name Weak names # semaphore and shm system calls -shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget diff --git a/sysdeps/unix/sysv/linux/shmdt.c b/sysdeps/unix/sysv/linux/shmdt.c index 7224d6f..5f3363e 100644 --- a/sysdeps/unix/sysv/linux/shmdt.c +++ b/sysdeps/unix/sysv/linux/shmdt.c @@ -16,12 +16,10 @@ License along with the GNU C Library; if not, see . */ -#include -#include +#include #include - #include -#include +#include /* Detach shared memory segment starting at address specified by SHMADDR from the caller's data segment. */ @@ -29,5 +27,9 @@ int shmdt (const void *shmaddr) { - return INLINE_SYSCALL (ipc, 5, IPCOP_shmdt, 0, 0, 0, (void *) shmaddr); +#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS + return INLINE_SYSCALL_CALL (shmdt, shmaddr); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_shmdt, 0, 0, 0, shmaddr); +#endif } diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index 18bd588..cb1a9f9 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,7 +6,6 @@ pread64 - pread64 Ci:ipii __libc_pread __libc_pread64 __pread64 pread64 __prea preadv64 - preadv Ci:ipii preadv64 preadv pwrite64 - pwrite64 Ci:ipii __libc_pwrite __libc_pwrite64 __pwrite64 pwrite64 __pwrite pwrite pwritev64 - pwritev Ci:ipii pwritev64 pwritev -shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime