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: 36795 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(-) 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