From patchwork Wed Nov 2 19:26:51 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: 80541 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp291896qge; Wed, 2 Nov 2016 12:29:32 -0700 (PDT) X-Received: by 10.99.105.70 with SMTP id e67mr468316pgc.99.1478114972237; Wed, 02 Nov 2016 12:29:32 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e3si4772021pgn.44.2016.11.02.12.29.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 12:29:32 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-74327-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-74327-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74327-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=rWDVIkqSHek21b419c/mhm6xVSv7M6b YE+hqme4zRp2LTE76v2JxfblW+K9YyuAuXlkGcfApEupAL7HnyI8fAq2s4mHVF/K ocBd6EeQ+SxKvndmNv3mKyK1RAVkWKCxi9BKw/7i2FfZZ42Zm/B/s/2gAMW6JjdW 4zo0CyolYdQI= 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=fbWXS9AKuoDCJ6DIKIuwvKTjlT8=; b=NrZAp Qxo8oDlUyqID9p0Yz0LOqeAY9EG2OBq0EMHYI5Dojz1pSks+WpXhOnNRkaIhpSC/ brugJ61bORocMkUFAHWu+Aqae9V3HIrExI0HdtU5sEn+P/dxImnv/6NL/3rGbH7t 21V7HzdSDTairl+HTElFizjNRKukmQwJXo0sjo= Received: (qmail 65746 invoked by alias); 2 Nov 2016 19:27:28 -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 65527 invoked by uid 89); 2 Nov 2016 19:27:26 -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= X-HELO: mail-vk0-f51.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=PVCluU6n+3/ehaaED3cU+/PkgyF1moXipMHpOHeqIWg=; b=PIC+B8H5Am1lL48tlfkgdebFovt9KuBkGjzc8O3PgzAqvGWOutlXS2keOvzHBoHSoZ +9f41+56HIafZvxv2zv7NUsz9Twb9CHUkHWrMwQt9TzCt5Z+ZoQbQpX8aJoZAjsvRAUf 513rzoAchj3sW76dmsEsJJUv+5CHi4UnjA51/T2kMWSRhvZ3A6RNh3UCbqklfvarDmtY 1ypJdWqU3bEDKLcLyeU6c83UUe3tviO5nd+rUIBgFWinoaR+/xzULn5HBU7KdJfnanXg 7wi45X48izoYYSscfsaytbcNTg4LV2aH2NAygWToLJu2dQQ87s4WPrvOit+z+xN/mkLk 1NuA== X-Gm-Message-State: ABUngvca8b9CshvfIyuqw/ob1L+TLEHWS9RzzBl9GlIsfvxJTSfYVpz+ZeFP3NadJ7PVn5do X-Received: by 10.31.107.135 with SMTP id k7mr4164342vki.119.1478114837861; Wed, 02 Nov 2016 12:27:17 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 14/16] Use shmdt syscall for linux implementation Date: Wed, 2 Nov 2016 17:26:51 -0200 Message-Id: <1478114813-3526-15-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 shmdt syscall if it is supported by kernel features. hecked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/shmdt.c (shmdt): Use shmdt syscall if it is defined. --- ChangeLog | 3 +++ sysdeps/unix/sysv/linux/shmdt.c | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/shmdt.c b/sysdeps/unix/sysv/linux/shmdt.c index 7224d6f..2f5b316 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_SYSVIPC_SYSCALL + return INLINE_SYSCALL_CALL (shmdt, 0, 0, 0, shmaddr); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_shmdt, 0, 0, 0, shmaddr); +#endif }