From patchwork Sun Nov 10 02:56:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 35771 Received: (qmail 92994 invoked by alias); 10 Nov 2019 03:02:27 -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 92960 invoked by uid 89); 10 Nov 2019 03:02:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=5.1, HContent-Transfer-Encoding:8bit X-HELO: esa3.hgst.iphmx.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1573354942; x=1604890942; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=t6yiXLD7ionGNfbEb3/5GBf/JS1x7bVZ8EnMG81a1qY=; b=Pgq3ruBeXbStfsEoHGOelPtNuwlmX7XWKXm9LPCnpg0EmPgCDLgYfm/l ChrNNMGNx8qXL/MHZBn1FjOZoJWuz762pNCROOYyLmoa7M0u9KqQbAblb Flp9rhAi8ed9B5dPwW7LD8/j/MksYW1pARLvNMmUEY9hAY9GtldhgLCvQ 6JQ2ycdknQskuP2aByX4CRa2x966POvfZGS49DiFu6t3VTKFmCCyFO5WV IwE/nzwhBaQSEQ+sULz/qib3MqR9Ms62nsWWp7fHgMi3NeLOW7Eu5rMuN b2aUic4wvu+xwyou041R+DKGrQo3Z6Wcv2J3VUcFojTDv6dXhUk2051NS Q==; IronPort-SDR: troff2zG040W7IiPeTh1qCKpf4hcNEInuhMFDkC+P1wlHoNG1Mj/Cm4FigDR6CcFXvTLpzHT7F RUI2slOK6rCNisWh6WM/es2reFG+jx3rqZgkHpP8dfsqYkoc9M8ZlF/aOSsCTirLL/I4OJTleV GJ204T7plqp69bCbOA2V7TtGM1BVsRFmRVML9xOvytlTwrvnljtrLX4AGfhB3RK8sPEDcSuLAg Rwg5Rq4ioLA8SurNhwhrFfGHAi3t23UePaVQ/LM6WCs4tSF5OVJG1199WTUWWUFnBxNV0XmmAP Fr0= IronPort-SDR: cc635yjyjw7pk4vC5maa2pyFeg6m8HtDDP11OTIrQWw1HRgYYi1FKQrhkRg6xw0YEOiCi4PUyT VGBg6g0R3UUyBQCpjzsIjQ/lV4nLAxK3z8DX4ABMu2c9TIfz3prtdRVQhnp2jQVzU2e93FLOno 2YPlzAs5l8y/9EMzrrr2zyDey71sGG97c/OH/dx7q12rZ/xWexuMXVCPx5BycR5DDZlx3DDMUF HkjCIZTg2+IW6yG2W8oReGb5cdVwpPryDTCL5gOFjoqJXqvu+ICSVbce1odt4BJl7SOmqZnssk CWSDndCr9a/2V6N3H1p2tO4d IronPort-SDR: gHBLBtGzs/CYVm1O0nY49DkcG4dkyNUsstUoWSRdmZybPVhHHrAyvcNpgCwfw8FfOxbOkYXryU Ia+Ypmz/fNuvRBMKG0O4+7W/1OZTP58nWHqduCqvyWs4CxAkgN1Hdc8uKUkhv3EWSFny6N7Lni VAu5MjkQYmg5F9EBe+eYmwFkUy/a5up1sGVd8K+M14bUIWrvwP6uq4oghcSfuctAFXes+Fk+yO J9wBORKE2YNcgBSUup6/LUk3p1xyVJseSGl2SdZssnvE7BjFckZJXhjsRIwA6GQiQo+5BtkmYj yH4= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v2 1/2] sysdeps: Add clock_gettime64 vDSO Date: Sat, 9 Nov 2019 18:56:57 -0800 Message-Id: <20191110025658.3149-1-alistair.francis@wdc.com> MIME-Version: 1.0 Add support for the clock_gettim64 vDSO calls. These are protected by the HAVE_CLOCK_GETTIME64_VSYSCALL define. HAVE_CLOCK_GETTIME64_VSYSCALL should be defined for 32-bit platforms (WORDSIZE == 32) that only run on the 5.1 kernel or later. WORDSIZE == 64 platforms can use #define __vdso_clock_gettime64 __vdso_clock_gettime and use the __vdso_clock_gettime syscall as they don't have a __vdso_clock_gettime64 call. * sysdeps/unix/sysv/linux/init-first.c: Add clock_gettime64 vDSO. * sysdeps/unix/sysv/linux/libc-vdso.h: Likewise. Reviewed-by: Adhemerval Zanella --- sysdeps/unix/sysv/linux/init-first.c | 10 ++++++++++ sysdeps/unix/sysv/linux/libc-vdso.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c index d90ca820be0..d005d133220 100644 --- a/sysdeps/unix/sysv/linux/init-first.c +++ b/sysdeps/unix/sysv/linux/init-first.c @@ -24,6 +24,11 @@ int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *) attribute_hidden; #endif +/* vDSO symbol used on clock_gettime64 implementation. */ +#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL +int (*VDSO_SYMBOL(clock_gettime64)) (clockid_t, struct __timespec64 *) + attribute_hidden; +#endif /* vDSO symbol used on clock_getres implementation. */ #ifdef HAVE_CLOCK_GETRES_VSYSCALL int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *) @@ -52,6 +57,11 @@ __libc_vdso_platform_setup (void) = get_vdso_mangle_symbol (HAVE_CLOCK_GETTIME_VSYSCALL); #endif +#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL + VDSO_SYMBOL(clock_gettime64) + = get_vdso_mangle_symbol (HAVE_CLOCK_GETTIME64_VSYSCALL); +#endif + #ifdef HAVE_CLOCK_GETRES_VSYSCALL VDSO_SYMBOL(clock_getres) = get_vdso_mangle_symbol (HAVE_CLOCK_GETRES_VSYSCALL); diff --git a/sysdeps/unix/sysv/linux/libc-vdso.h b/sysdeps/unix/sysv/linux/libc-vdso.h index 792ac39d85a..c6d505bab39 100644 --- a/sysdeps/unix/sysv/linux/libc-vdso.h +++ b/sysdeps/unix/sysv/linux/libc-vdso.h @@ -32,6 +32,10 @@ extern int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *) attribute_hidden; #endif +#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL +extern int (*VDSO_SYMBOL(clock_gettime64)) (clockid_t, struct __timespec64 *) + attribute_hidden; +#endif #ifdef HAVE_CLOCK_GETRES_VSYSCALL extern int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *) attribute_hidden;