From patchwork Thu Jun 13 15:11:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raoni Fassina Firmino X-Patchwork-Id: 1115132 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-102676-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="r9inl2SM"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45PnKF1LTZz9sNy for ; Fri, 14 Jun 2019 01:12:16 +1000 (AEST) 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:in-reply-to:references :mime-version:content-transfer-encoding:message-id; q=dns; s= default; b=v/WmrL0oSEVkfBe6BfYIf73o6EUK+7BVxft0SvMc1NWrq69aEdOWJ uBVOsN+aJ5Jk65XRttMxxwu7kDhC7ddqB8+xU9uRXEQeb5X1iNCydxMoErpuwVDq rZ/jie20O7jQl5jcKZAIBWQcqMXq0nbXKVoBWBEXf7BvJvu0iUckYA= 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:in-reply-to:references :mime-version:content-transfer-encoding:message-id; s=default; bh=1ueuOqiX/yEnJLI+MsDtvkoHLMs=; b=r9inl2SM3xEB4K0BDM6fW2kA0ij4 VW0T+8x4jpKiRPoc6dCAtQ/+vOeRBcOKRuSLLlsQgyVlcMDiIgEWd8pnSayMcyYk wBcKBHxxbttWBE10uOfY19VdI2nHfCQKn8KrGuf+i5UMpyUjoI5Q4QsH0KlS8bwy ih3WVXzYxgOKD2g= Received: (qmail 43407 invoked by alias); 13 Jun 2019 15:11:58 -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 43333 invoked by uid 89); 13 Jun 2019 15:11:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=2019-05 X-HELO: mx0a-001b2d01.pphosted.com From: Raoni Fassina Firmino To: libc-alpha@sourceware.org Subject: [PATCH 1/4] powerpc: Fix static-linked version of __ppc_get_timebase_freq [BZ #24640] Date: Thu, 13 Jun 2019 12:11:42 -0300 In-Reply-To: <20190613151145.22243-1-raoni@linux.ibm.com> References: <20190613151145.22243-1-raoni@linux.ibm.com> MIME-Version: 1.0 x-cbid: 19061315-0016-0000-0000-000009C2288F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011255; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01217420; UDB=6.00640188; IPR=6.00998531; MB=3.00027295; MTD=3.00000008; XFM=3.00000015; UTC=2019-06-13 15:11:50 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061315-0017-0000-0000-000043A3A561 Message-Id: <20190613151145.22243-2-raoni@linux.ibm.com> From: Stan Shebs __ppc_get_timebase_freq() always return 0 when using static linked glibc. This is a minimal example.c to reproduce: /******************************/ #include #include #include #include int main() { uint64_t freq = __ppc_get_timebase_freq(); printf("Time Base frequency = %"PRIu64" Hz\n", freq); if (freq == 0) return -1; return 0; } /******************************/ Compile command: gcc -static example.c This bug has been reproduced, fixed and tested on all powerpc platforms (ppc32, ppc64 and ppc64le). The underlying code of __ppc_get_timebase_freq uses __get_timebase_freq that has a different implementation for shared and static version of glibc. In the static version, there is an incorrect sense in the if check for the fd returned when opening /proc/cpuinfo. This solution is mostly a cherry-pick from: commit 4791e4f773d060c1a37b27aac5b03cdfa9327afc Author: Stan Shebs Date: Fri May 17 12:25:19 2019 -0700 Subject: Fix sense of a test in the static-linking version of ppc get_clockfreq That is in branch glibc/google/grte/v5-2.27/master and was mentioned for inclusion on master here: https://www.sourceware.org/ml/libc-alpha/2019-05/msg00409.html Adapted from original fix for get_clockfreq. That code was moved to get_timebase_freq. ChangeLog: 2019-06-13 Stan Shebs Raoni Fassina Firmino [BZ #24640] * sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c [!SHARED] (__get_timebase_freq): Fix sense of a test in the static-linking version. Reviewed-by: Adhemerval Zanella --- sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c index 23e7694d87..c245e97526 100644 --- a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c +++ b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c @@ -39,7 +39,7 @@ __get_timebase_freq (void) timebase : 33333333 We search for this line and convert the number into an integer. */ int fd = __open_nocancel ("/proc/cpuinfo", O_RDONLY); - if (__glibc_likely (fd != -1)) + if (__glibc_unlikely (fd == -1)) return result; /* The timebase will be in the 1st 1024 bytes for systems with up From patchwork Thu Jun 13 15:11:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raoni Fassina Firmino X-Patchwork-Id: 1115130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-102675-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="SYEtrhBY"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45PnK44y2gz9sNR for ; Fri, 14 Jun 2019 01:12:08 +1000 (AEST) 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:mime-version:content-transfer-encoding; q=dns; s= default; b=vt0su0JVC1MFAVXDgZRrLfiIWca3vG830iWN1nsoaGIulLGPANF6j ib3PVcdBdy5e7+l1Mos73ryOWCyaYWUrSDJUqZulLwFhXO7frK3t09R76QgOvNT6 MUcT+rQZQM9u6siHLu5LpBZk68XTQr9VCz7hGiTRlo6cCdUn56hrto= 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:mime-version:content-transfer-encoding; s=default; bh=5ETezrzNpdzoMBwy+ALbGutVSWc=; b=SYEtrhBYv26xqs5lsQkbHzlJVABp cOdJV6cKYDS64RtFW05uIiEqVU42QNDVSBsnn+RDbRFIXuvardBz5u/HlfV6b2n1 hMEq3frGUJmIk7AbPx3WF1yFV0an8NoNwMMBcQyDS0hLg5dYIguXbhUVaq2GGMMl evTFd9Qw9m4juT0= Received: (qmail 43044 invoked by alias); 13 Jun 2019 15:11:55 -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 42977 invoked by uid 89); 13 Jun 2019 15:11:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx0a-001b2d01.pphosted.com From: Raoni Fassina Firmino To: libc-alpha@sourceware.org Subject: [PATCH 2/4] powerpc: Add testcase for static version of __ppc_get_timebase_freq Date: Thu, 13 Jun 2019 12:11:43 -0300 Message-Id: <20190613151145.22243-3-raoni@linux.ibm.com> In-Reply-To: <20190613151145.22243-1-raoni@linux.ibm.com> References: <20190613151145.22243-1-raoni@linux.ibm.com> MIME-Version: 1.0 The underlying function has different implementations for shared and static build. ChangeLog: 2019-06-13 Raoni Fassina Firmino * sysdeps/unix/sysv/linux/powerpc/Makefile (tests-static): Add test-gettimebasefreq-static. (tests): Likewise. * sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c: New file. --- sysdeps/unix/sysv/linux/powerpc/Makefile | 2 ++ .../powerpc/test-gettimebasefreq-static.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c diff --git a/sysdeps/unix/sysv/linux/powerpc/Makefile b/sysdeps/unix/sysv/linux/powerpc/Makefile index 19ac59d862..4b7198dcec 100644 --- a/sysdeps/unix/sysv/linux/powerpc/Makefile +++ b/sysdeps/unix/sysv/linux/powerpc/Makefile @@ -25,6 +25,8 @@ endif ifeq ($(subdir),misc) sysdep_headers += bits/ppc.h sysdep_routines += get_timebase_freq +tests-static += test-gettimebasefreq-static +tests += test-gettimebasefreq-static tests += test-gettimebasefreq tests += test-powerpc-linux-sysconf endif diff --git a/sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c b/sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c new file mode 100644 index 0000000000..58b4eee98d --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/test-gettimebasefreq-static.c @@ -0,0 +1,19 @@ +/* Check __ppc_get_timebase_freq() for architecture changes + Copyright (C) 2019 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "test-gettimebasefreq.c" From patchwork Thu Jun 13 15:11:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raoni Fassina Firmino X-Patchwork-Id: 1115134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-102677-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="KRpLoLAt"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45PnKP0R7Gz9sQy for ; Fri, 14 Jun 2019 01:12:24 +1000 (AEST) 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:in-reply-to:references :mime-version:content-transfer-encoding:message-id; q=dns; s= default; b=mG1q0g79RJ/dnbQfryIJEhE28y6Dzdjgim9DcOeztj4jsZsVnaZxw R1/lQQrHKNxcoeQWgMcsSvroGd3lfeyjxuyrr3wGfnbRjSdlvWcjzvtXJvf7TO4m h8qUL4dKSpOFBzqj11GmdnqGL3yyu4pNkM/SLpQ2Sx38TcOIiaeyCE= 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:in-reply-to:references :mime-version:content-transfer-encoding:message-id; s=default; bh=r+voqaiKnUpmlPxoftrux8pUfNU=; b=KRpLoLAtjwo8B/ImT6R1ODFmbQjl k12Veau2RsjlTVDmVSYyIQooJcJpy21yCtZKKEHN4fIrgbLOIrcp6Lso+yYLpeFI LQnBUFFOJPP3SxyzzxfB1gW+0EWiNw7ni3uUwS9bIQ9TyVBrDm5dPm74edeRs+Hw a5EfivrfahSPfXI= Received: (qmail 43459 invoked by alias); 13 Jun 2019 15:11:58 -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 43365 invoked by uid 89); 13 Jun 2019 15:11:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1803, 2019-05 X-HELO: mx0a-001b2d01.pphosted.com From: Raoni Fassina Firmino To: libc-alpha@sourceware.org Subject: [PATCH 3/4] powerpc: Refactor of _get_timebase_freq Date: Thu, 13 Jun 2019 12:11:44 -0300 In-Reply-To: <20190613151145.22243-1-raoni@linux.ibm.com> References: <20190613151145.22243-1-raoni@linux.ibm.com> MIME-Version: 1.0 x-cbid: 19061315-0004-0000-0000-0000151BDA61 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011255; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01217420; UDB=6.00640188; IPR=6.00998532; MB=3.00027295; MTD=3.00000008; XFM=3.00000015; UTC=2019-06-13 15:11:52 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061315-0005-0000-0000-00008C13261E Message-Id: <20190613151145.22243-4-raoni@linux.ibm.com> Since BZ#19767 is at least fixed for powerpc, we can now use the same code in an agnostic way for static and shared linkage. Also because all vDSO symbol do no fail we can simplify the vDSO calling without most of the wrapper macros. We keep the /proc/cpuinfo parsing as fallback if a kernel is built without vDSO support This implements the solution drafted by Adhemerval Zanella on the mailing list: https://www.sourceware.org/ml/libc-alpha/2019-05/msg00658.html ChangeLog: 2019-06-13 Raoni Fassina Firmino * sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c (__get_timebase_freq): Refactoring. --- sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c index c245e97526..959c311acb 100644 --- a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c +++ b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c @@ -28,12 +28,12 @@ __get_timebase_freq (void) { hp_timing_t result = 0L; -#ifdef SHARED - /* The vDSO does not return an error (it clear cr0.so on returning). */ - INTERNAL_SYSCALL_DECL (err); - result = - INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK (get_tbfreq, err, uint64_t, 0); -#else + /* The vDSO does not fail (it clears cr0.so on returning). */ + __typeof (VDSO_SYMBOL(get_tbfreq)) vdsop = VDSO_SYMBOL(get_tbfreq); + PTR_DEMANGLE (vdsop); + if (vdsop != NULL) + return vdsop (); + /* We read the information from the /proc filesystem. /proc/cpuinfo contains at least one line like: timebase : 33333333 @@ -99,7 +99,6 @@ __get_timebase_freq (void) } } } -#endif return result; } From patchwork Thu Jun 13 15:11:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raoni Fassina Firmino X-Patchwork-Id: 1115135 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-102678-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="bpH4MGIz"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45PnKY16tHz9sR2 for ; Fri, 14 Jun 2019 01:12:32 +1000 (AEST) 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:in-reply-to:references :mime-version:content-transfer-encoding:message-id; q=dns; s= default; b=KQ34f7UfrOqv7ELMs4sV2zzZltm4QdjVP8qUnKuzyvJ+PKXe5AXsQ KsaLzwpjovf2HvL9GQ+YGEYujwRgvaLoDnBuMZUn9ygpYScdT8lDjxj7vTAhUbNL kKjTlMIX6zwglPWlbQ4XCOceHgtsBn9FAjWEQ19v3L2Bejbdra3/JM= 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:in-reply-to:references :mime-version:content-transfer-encoding:message-id; s=default; bh=KzIu2j9GVDC9UKOMnPyWtP5tXgM=; b=bpH4MGIz8W0FyYXJ3HC/m1yvmiOL hbkyK/V/JWOGMeZrdbi/rFqMOloBkFXaEVU3AxfbuP6jZ1AVwxJH3eA3k6yufx+A MGGFKWUrKV3lnO0JlAyB5taJDUEnuO+28qDPvLlQaYxRuDhqcenJP2vcgXXQ0tYo XKruzEStq32OK1s= Received: (qmail 43609 invoked by alias); 13 Jun 2019 15:11:58 -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 43520 invoked by uid 89); 13 Jun 2019 15:11:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:4581 X-HELO: mx0a-001b2d01.pphosted.com From: Raoni Fassina Firmino To: libc-alpha@sourceware.org Subject: [PATCH 4/4] powerpc: Remove unused internal macros for vsyscall Date: Thu, 13 Jun 2019 12:11:45 -0300 In-Reply-To: <20190613151145.22243-1-raoni@linux.ibm.com> References: <20190613151145.22243-1-raoni@linux.ibm.com> MIME-Version: 1.0 x-cbid: 19061315-8235-0000-0000-00000EA7704D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011255; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01217420; UDB=6.00640188; IPR=6.00998531; MB=3.00027295; MTD=3.00000008; XFM=3.00000015; UTC=2019-06-13 15:11:53 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061315-8236-0000-0000-00004601B303 Message-Id: <20190613151145.22243-5-raoni@linux.ibm.com> Macros INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK and INTERNAL_VSYSCALL_CALL_TYPE were only used for __get_timebase_freq. After its refactoring they are not needed anymore. Also, INTERNAL_VSYSCALL_CALL, that had become a wrapper over INTERNAL_VSYSCALL_CALL_TYPE, can be itself the whole implementation again. ChangeLog: 2019-06-13 Raoni Fassina Firmino * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (INTERNAL_VSYSCALL_CALL): Move implementation. (INTERNAL_VSYSCALL_CALL_TYPE): Remove macro. (INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h (INTERNAL_VSYSCALL_CALL): Move implementation. (INTERNAL_VSYSCALL_CALL_TYPE): Remove macro. (INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Likewise. --- .../sysv/linux/powerpc/powerpc32/sysdep.h | 21 ++--------------- .../sysv/linux/powerpc/powerpc64/sysdep.h | 23 ++----------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h index bdbab8e41b..d493ec6222 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -43,7 +43,7 @@ function call, with the exception of LR (which is needed for the "sc; bnslr+" sequence) and CR (where only CR0.SO is clobbered to signal an error return status). */ -# define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, nr, type, args...) \ +# define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ ({ \ register void *r0 __asm__ ("r0"); \ register long int r3 __asm__ ("r3"); \ @@ -56,7 +56,7 @@ register long int r10 __asm__ ("r10"); \ register long int r11 __asm__ ("r11"); \ register long int r12 __asm__ ("r12"); \ - register type rval __asm__ ("r3"); \ + register long int rval __asm__ ("r3"); \ LOADARGS_##nr (funcptr, args); \ __asm__ __volatile__ \ ("mtctr %0\n\t" \ @@ -70,9 +70,6 @@ rval; \ }) -#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ - INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, nr, long int, args) - # undef INLINE_SYSCALL # define INLINE_SYSCALL(name, nr, args...) \ ({ \ @@ -133,20 +130,6 @@ # undef INTERNAL_SYSCALL_ERRNO # define INTERNAL_SYSCALL_ERRNO(val, err) (val) -# define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, type, nr, args...) \ - ({ \ - type sc_ret = ENOSYS; \ - \ - __typeof (__vdso_##name) vdsop = __vdso_##name; \ - PTR_DEMANGLE (vdsop); \ - if (vdsop != NULL) \ - sc_ret = \ - INTERNAL_VSYSCALL_CALL_TYPE (vdsop, err, nr, type, ##args); \ - else \ - err = 1 << 28; \ - sc_ret; \ - }) - /* List of system calls which are supported as vsyscalls. */ # define HAVE_CLOCK_GETRES_VSYSCALL 1 # define HAVE_CLOCK_GETTIME_VSYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h index 294517e3f3..454554061b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -47,22 +47,6 @@ #endif /* __ASSEMBLER__ */ -/* This version is for internal uses when there is no desire - to set errno */ -#define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, type, nr, args...) \ - ({ \ - type sc_ret = ENOSYS; \ - \ - __typeof (__vdso_##name) vdsop = __vdso_##name; \ - PTR_DEMANGLE (vdsop); \ - if (vdsop != NULL) \ - sc_ret = \ - INTERNAL_VSYSCALL_CALL_TYPE (vdsop, err, type, nr, ##args); \ - else \ - err = 1 << 28; \ - sc_ret; \ - }) - /* List of system calls which are supported as vsyscalls. */ #define HAVE_CLOCK_GETRES_VSYSCALL 1 #define HAVE_CLOCK_GETTIME_VSYSCALL 1 @@ -74,7 +58,7 @@ gave back in the non-error (CR0.SO cleared) case, otherwise (CR0.SO set) the negation of the return value in the kernel gets reverted. */ -#define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, type, nr, args...) \ +#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ ({ \ register void *r0 __asm__ ("r0"); \ register long int r3 __asm__ ("r3"); \ @@ -83,7 +67,7 @@ register long int r6 __asm__ ("r6"); \ register long int r7 __asm__ ("r7"); \ register long int r8 __asm__ ("r8"); \ - register type rval __asm__ ("r3"); \ + register long int rval __asm__ ("r3"); \ LOADARGS_##nr (funcptr, args); \ __asm__ __volatile__ \ ("mtctr %0\n\t" \ @@ -98,9 +82,6 @@ rval; \ }) -#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ - INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, long int, nr, args) - #undef INLINE_SYSCALL /* This version is for kernels that implement system calls that