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 X-Patchwork-Id: 1208771 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108021-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="xRM5fiMn"; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="GVNqtSXQ"; 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 47YhqF5vtwz9sR7 for ; Fri, 13 Dec 2019 05:17:45 +1100 (AEDT) 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=EwhNzkvvTpUcex9TolVLX3S2uT1zGN7 +GFwjOmUSgacdcsB/W76ZOW7aGr9/hrHzaErJ9r47pys3xquyv87hCi0UPCOPp8P hIaU7e+gPgaQPutm8chdumCOEWio34z2xXgWJrzYCq8u06uA+eb/qPI3Wk4+wYk8 CTZK0oLakwx4= 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=xRM5f iMn4RvOaiBAa0a+FuYZNi5wsT6lgljVfNrMN7JDnVJQKr4il7pwTmIqCWNzRvasf B5mupWvIHixTQi/Heuf32FfF/G5bcMppMfvAbjfCjVd3uaZEryObzyN1PtpVv1uv r83jbzM7d/+hX0wmTAKmFdl7P0AgYhYdLoeg/M= 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== 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