From patchwork Thu Dec 12 18:16:10 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: 181509 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp1118866och; Thu, 12 Dec 2019 10:17:49 -0800 (PST) X-Google-Smtp-Source: APXvYqz1ng0fg4gE6cq93AvxkoIuyS4vypSF8UI1mjYdpayPwxlB0YK4EQOKYAs+R4hH7ZxOT7BC X-Received: by 2002:a9d:6e12:: with SMTP id e18mr9070679otr.47.1576174669522; Thu, 12 Dec 2019 10:17:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576174669; cv=none; d=google.com; s=arc-20160816; b=FhF/l0ZLhsiuNn1YwRkDXbyAze0JGgM7/OGWxznJTteInZ3qr1kWchhwLgivwNqOtX WiOzgb2fDu7x/KRjgSI8+w35hK9VwQ3tR4lwh2dqAqdoQYnlURs1P89mcLnFgrzxH1Qu z9fncs/KyGmI7vLty4pr0lHuLG839yUsSsQYThV48BZ4OL8JtkmWt5/e9PHML0BU7nxH Q9xETn5Waqw/q7cfC/BXcGQ0VLtvIlc2OtNDjHNQNI0nxwsNffvGO9qwrPXb14jP6CKl d9KcO6e3SBBj6cmhXOWzEB4HecJ8ISbenYS5yVsXbzLy0jCGh7LRX17W9tsFRIfRvDPR uLXQ== 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=b8k9nhragiPu+B7ySBhYABYhNVGYTdgJpA40aBVlSY4=; b=bqcJEuJaWp20g7deK/+0izuGFsF91spYtMGZi8K87lMLX+4Acq5kJtiYoZmUT2QYtq GIKKNAmRxD2AY4sqB7E0KMEJqKCMz/ueYG91WWPy2KoSTee4/I3C6KDrsvMuX4dbPSg5 gkFXcuRzJyDAtO/YK0UZKtrOtXoJB54StZARaEE4CFa5I2eAuRHrfqIh+XwUXrfiU7e3 6PtgC2nzrAlGPxRCHbtq2XQCXoDLtkO96GNjt+2V/bF65ltbZzSbsmuc9OQCiwrCqQDM fiwgojqtGOBFBioyDTc3E6T3ogFbgVjesL6AbrCuv5HBvxfn/TPwIVpYqrjAgJo0tTEu uZYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=QKOeJtfF; dkim=pass header.i=@linaro.org header.s=google header.b=GVNqtSXQ; spf=pass (google.com: domain of libc-alpha-return-108021-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108021-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 q18si3617777otc.189.2019.12.12.10.17.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2019 10:17:49 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-108021-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=QKOeJtfF; dkim=pass header.i=@linaro.org header.s=google header.b=GVNqtSXQ; spf=pass (google.com: domain of libc-alpha-return-108021-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-108021-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=QbKI0OM8oguysebo5G/4HHu1AVsMOv0 knw59wqk+UfiJ/QwQAFl5BqQAQLvEVm7yeAfYRtmaVYoaQHnZjxbCj2RPDVWANo4 l3J78Joc7+TsPGkaKVkJb6PfqFdqjne7h7wT7LIaWRMo221ugNG0wT5fVNQ9BJ6M bwJpX8vuzWKg= 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=1D1GweN48e3/wBZWkDjV1yacTEI=; b=QKOeJ tfF8kQsCSrfyzaSwMT5xkIF5lq0fShrlF/51S6M39DOdEsfVwWpm/qTlhZHVN9Z6 crAq4Ou8BuUJe9LTZ5dmmloHAEO/7xM26j9yo3v9q4MSfqTkfePZewZ5vW9nXTVi 2fgbGc5U/XCD8V3O+GW1L1N6TQ525S7vz7xmsI= Received: (qmail 44684 invoked by alias); 12 Dec 2019 18:16:35 -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 44515 invoked by uid 89); 12 Dec 2019 18:16:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.8 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-ua1-f66.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=b8k9nhragiPu+B7ySBhYABYhNVGYTdgJpA40aBVlSY4=; b=GVNqtSXQCPvtoumaTnAWxM5tJ9ebwRRWjyvmz9oU59vS5XoagS+N1Z2rajMwrm13wp CA+DWyVxuToYUugyaiI9IneWZrjoLJIPCEZbGUeDWlzYa78ppbpfSyStVmbwG6Z3JD/i wkWnS9ZpHEdnVhNNn3LGqjthCnelFBFBltISBzx0pG9ezzSJCuR2gsVkbBCIdS6uCpRk gM/r0t0cTPBKhkrrw7QxAjDI65FDdf6wZTOgWjUmnU2y4EN8ftGujCwtc8Tgb0dwilLk xxc9eskzzj6nyhc6TUMidzcMtvEJk3aYSv9Q3HXriwo3720YvTGKZE68nF++ONU6ged5 yrJQ== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 08/12] Add support for clock_gettime64 vDSO Date: Thu, 12 Dec 2019 15:16:10 -0300 Message-Id: <20191212181614.31782-8-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_gettime.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_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c index 4ea56c9a4b..43e378aa83 100644 --- a/sysdeps/unix/sysv/linux/clock_gettime.c +++ b/sysdeps/unix/sysv/linux/clock_gettime.c @@ -34,7 +34,11 @@ __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp) #ifdef __ASSUME_TIME64_SYSCALLS /* 64 bit ABIs or Newer 32-bit ABIs that only support 64-bit time_t. */ # ifdef __NR_clock_gettime64 - r = INLINE_SYSCALL_CALL (clock_gettime64, clock_id, tp); +# ifdef HAVE_CLOCK_GETTIME64_VSYSCALL + r = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp); +# endif + if (r == -1) + r = INLINE_SYSCALL_CALL (clock_gettime64, clock_id, tp); # else # ifdef HAVE_CLOCK_GETTIME_VSYSCALL r = INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); @@ -45,7 +49,11 @@ __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp) #else /* Old 32-bit ABI with possible 64-bit time_t support. */ # ifdef __NR_clock_gettime64 - r = INLINE_SYSCALL_CALL (clock_gettime64, clock_id, tp); +# ifdef HAVE_CLOCK_GETTIME64_VSYSCALL + r = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp); +# endif + if (r == -1) + r = INLINE_SYSCALL_CALL (clock_gettime64, clock_id, tp); # 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 1069879f1a..d19a4af6c1 100644 --- a/sysdeps/unix/sysv/linux/dl-vdso-setup.c +++ b/sysdeps/unix/sysv/linux/dl-vdso-setup.c @@ -45,6 +45,10 @@ PROCINFO_CLASS int (*_dl_vdso_clock_gettime) (clockid_t, struct timespec *) RELRO; #endif +# ifdef HAVE_CLOCK_GETTIME_VSYSCALL +PROCINFO_CLASS int (*_dl_vdso_clock_gettime64) (clockid_t, + struct __timespec64 *) RELRO; +#endif # ifdef HAVE_GETTIMEOFDAY_VSYSCALL PROCINFO_CLASS int (*_dl_vdso_gettimeofday) (struct timeval *, void *) RELRO; #endif diff --git a/sysdeps/unix/sysv/linux/dl-vdso-setup.h b/sysdeps/unix/sysv/linux/dl-vdso-setup.h index f4e76202fc..8a89e100c8 100644 --- a/sysdeps/unix/sysv/linux/dl-vdso-setup.h +++ b/sysdeps/unix/sysv/linux/dl-vdso-setup.h @@ -26,6 +26,9 @@ setup_vdso_pointers (void) #ifdef HAVE_CLOCK_GETTIME_VSYSCALL GLRO(dl_vdso_clock_gettime) = dl_vdso_vsym (HAVE_CLOCK_GETTIME_VSYSCALL); #endif +#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL + GLRO(dl_vdso_clock_gettime64) = dl_vdso_vsym (HAVE_CLOCK_GETTIME64_VSYSCALL); +#endif #ifdef HAVE_GETTIMEOFDAY_VSYSCALL GLRO(dl_vdso_gettimeofday) = dl_vdso_vsym (HAVE_GETTIMEOFDAY_VSYSCALL); #endif