From patchwork Thu Dec 12 18:16:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 181513 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp1119671och; Thu, 12 Dec 2019 10:18:31 -0800 (PST) X-Google-Smtp-Source: APXvYqx6qxAxUbBF0h8BdR9dphT6cKzf5H2uXa7kfZZhf0yHxVQgG1+000PbhrYn1VajdvQUExko X-Received: by 2002:aca:dc45:: with SMTP id t66mr6074939oig.39.1576174711781; Thu, 12 Dec 2019 10:18:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576174711; cv=none; d=google.com; s=arc-20160816; b=Dd8c27G9TsOYGTC+p2kj+hQaAaXgAzaoN2BUEfradMkYVSrYxWDLUCGtogjugl+dj7 FzNNdLf/DUScNTiQlc9JnBzay5hT/s9n4iPruEXux1wSrqzc2rDdzWN0/N2QrApOOmC1 DRaFCsex9KDDvVZWvsuQQ7EirilewdXnjg3Es/wwHbmhO2kE7yVhcQDfl4GYVIibEygF 2Y+aGo5piCNuoCJT29fuBGtGO+7RlOmh0ppM5ylYl3UUkE4KjLjyLKljFq+9tSK3Gv5j fFw0Ze9Q7ZFrj1gW5AaM8x94z3x2R04pwgkiKkMo034iJuScloXdfOBzA88w1e30IqJC CrJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=o/cNTFlOubG8SP4Axe0HLItE6Y6ZGihHGqIB0xMhNTg=; b=C3Kahotd7arjIHCZTY/vbpcrYaLmGR7ivY8klabR3Z0kJ6Kq7x6TC3lKvmKgZhl7UZ 46leuwhb6g2Ilq+K2UQpHTDkLsm1uBnRJ8ozhY161nDiYAqaODStH+aVAZcV0szYsaC9 4pwkqeF9F3o7C5nKTsDeoTgJnPlcernBZxXT8ObtM5EpbkaRiIOxHbUGinY/mb0dVA72 ibOBEXTw+vdx4EU2bSfW2F2748v+IPR+2OSI4oz+gb9Uj6K1sIXgW2ZbdnLym7UeDVkc o0Zhd0qgun3B5oSf2XBhbLVeRgLcu/KWwBjHMrHKGxFhV/t3GF1cahcgv46JLkDv1ly2 kSpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=RrnyFFMZ; dkim=pass header.i=@linaro.org header.s=google header.b=yEc9i+rz; spf=pass (google.com: domain of libc-alpha-return-108025-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108025-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y24si3602221oih.24.2019.12.12.10.18.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2019 10:18:31 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-108025-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 header.s=default header.b=RrnyFFMZ; dkim=pass header.i=@linaro.org header.s=google header.b=yEc9i+rz; spf=pass (google.com: domain of libc-alpha-return-108025-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108025-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=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=KkucMy5PfS6+qJed0JKPMBZPPGUX9LR a5cynNlHpelEe5x91/CjQB8cBsMUCmXHSSER7ySEpcsWXchZHKxsahGh4D1gEwKc MBG1REcXW2K/wX25Nbo/AvScWlzTNFBII2ZvKTr4A/sTBfCjDS6r3MRaRrrWnCXp ll14FedqHf4c= 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=DDCaXE53O88OYFN4IpT38BFBYio=; b=RrnyF FMZowmdBTf5Ou3Gd4TYZc6ubXm7JBhJQ8m99N35A40zDlC1+zIbEDU9FKt5HJBiG zOjU+sU/UVaG5Tzi/ScRKHWHmSCqxO212fNs2dge+9fO6Uwg4ujUfWUuQDS7mF2h MVhPRG8nF03BqWO/KArCSHvU4swu3VgN0zxXEI= Received: (qmail 47829 invoked by alias); 12 Dec 2019 18:16:57 -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 45453 invoked by uid 89); 12 Dec 2019 18:16:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-vs1-f65.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=o/cNTFlOubG8SP4Axe0HLItE6Y6ZGihHGqIB0xMhNTg=; b=yEc9i+rzC4lXMwzQ5ZFm8UL+GiddkT3f1iH0KUkLyrKHTlOSeCThWr+lsAh+x7uy4d CIDTYgJvKWLAhCwIHIzH7zPYAP9exmDivULLsaPQZN6wFgnsdwGK4EY3yAxukU5Dhdp7 dcKVfOwl5FMo5GIMpVRI+TDuBH3YU0FErejo5a7I6g359ZiJ7oC4QmMvTGCjKzWV3k9G gBjpWJAYxZtzRdWVW+wQaMwQdqYZFjpHsDVpPMfaeqHp/I37SwHg+vhaUEgTsmQ1Kmc+ UkA7h+1GDzqfqvLDI3ldAJXsHleG55ZKsdCHcLcL6MC+OpPzp3BYGSWL+A4+F4d0xfou 37QA== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 12/12] Add support for clock_getres64 vDSO Date: Thu, 12 Dec 2019 15:16:14 -0300 Message-Id: <20191212181614.31782-12-adhemerval.zanella@linaro.org> In-Reply-To: <20191212181614.31782-1-adhemerval.zanella@linaro.org> References: <20191212181614.31782-1-adhemerval.zanella@linaro.org> No architecture currently defines the vDSO symbol. --- sysdeps/unix/sysv/linux/clock_getres.c | 12 ++++++++++-- sysdeps/unix/sysv/linux/dl-vdso-setup.c | 4 ++++ sysdeps/unix/sysv/linux/dl-vdso-setup.h | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c index 6c12f1d1e9..39481afe22 100644 --- a/sysdeps/unix/sysv/linux/clock_getres.c +++ b/sysdeps/unix/sysv/linux/clock_getres.c @@ -33,7 +33,11 @@ __clock_getres64 (clockid_t clock_id, struct __timespec64 *res) #ifdef __ASSUME_TIME64_SYSCALLS /* 64 bit ABIs or Newer 32-bit ABIs that only support 64-bit time_t. */ # ifdef __NR_clock_getres_time64 - r = INLINE_SYSCALL_CALL (clock_getres_time64, clock_id, res); +# ifdef HAVE_CLOCK_GETRES64_VSYSCALL + r = INLINE_VSYSCALL (clock_getres64, 2, clock_id, tp) +# endif + if (r == -1) + r = INLINE_SYSCALL_CALL (clock_getres_time64, clock_id, res); # else # ifdef HAVE_CLOCK_GETRES_VSYSCALL r = INLINE_VSYSCALL (clock_getres, 2, clock_id, res); @@ -44,7 +48,11 @@ __clock_getres64 (clockid_t clock_id, struct __timespec64 *res) #else /* Old 32-bit ABI with possible 64-bit time_t support. */ # ifdef __NR_clock_getres_time64 - r = INLINE_SYSCALL_CALL (clock_getres_time64, clock_id, res); +# ifdef HAVE_CLOCK_GETRES64_VSYSCALL + r = INLINE_VSYSCALL (clock_getres64, 2, clock_id, tp) +# endif + if (r == -1) + r = INLINE_SYSCALL_CALL (clock_getres_time64, clock_id, res); # endif if (r == -1) { diff --git a/sysdeps/unix/sysv/linux/dl-vdso-setup.c b/sysdeps/unix/sysv/linux/dl-vdso-setup.c index d19a4af6c1..620348e2c7 100644 --- a/sysdeps/unix/sysv/linux/dl-vdso-setup.c +++ b/sysdeps/unix/sysv/linux/dl-vdso-setup.c @@ -62,6 +62,10 @@ PROCINFO_CLASS int (*_dl_vdso_getcpu) (unsigned *, unsigned *, void *) RELRO; PROCINFO_CLASS int (*_dl_vdso_clock_getres) (clockid_t, struct timespec *) RELRO; # endif +# ifdef HAVE_CLOCK_GETRES64_VSYSCALL +PROCINFO_CLASS int (*_dl_vdso_clock_getres64) (clockid_t, + struct __timespec64 *) RELRO; +# endif /* PowerPC specific ones. */ # ifdef HAVE_GET_TBFREQ diff --git a/sysdeps/unix/sysv/linux/dl-vdso-setup.h b/sysdeps/unix/sysv/linux/dl-vdso-setup.h index 8a89e100c8..005acf15f7 100644 --- a/sysdeps/unix/sysv/linux/dl-vdso-setup.h +++ b/sysdeps/unix/sysv/linux/dl-vdso-setup.h @@ -41,6 +41,9 @@ setup_vdso_pointers (void) #ifdef HAVE_CLOCK_GETRES_VSYSCALL GLRO(dl_vdso_clock_getres) = dl_vdso_vsym (HAVE_CLOCK_GETRES_VSYSCALL); #endif +#ifdef HAVE_CLOCK_GETRES64_VSYSCALL + GLRO(dl_vdso_clock_getres64) = dl_vdso_vsym (HAVE_CLOCK_GETRES64_VSYSCALL); +#endif #ifdef HAVE_GET_TBFREQ GLRO(dl_vdso_get_tbfreq) = dl_vdso_vsym (HAVE_GET_TBFREQ); #endif