From patchwork Sat Nov 23 22:27:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 36158 Received: (qmail 118994 invoked by alias); 23 Nov 2019 22:32:47 -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 118956 invoked by uid 89); 23 Nov 2019 22:32:43 -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=HContent-Transfer-Encoding:8bit X-HELO: esa2.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=1574548394; x=1606084394; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=197rsUtPlvmIlmVhdyYvr9nOZ/3XpqcFEdcAHTGBXEQ=; b=OFfpkIUxoo/cYa5ACwZRjbKcwXbCnwsK7OQPTNV4j0Ox45EiUpNShDfi ioYX5qCTEy4GYNTwoT3sZbrDl3KlXxV2C1Dp8SSoQNOlTRx/l4gWKH6Or 9QSptHgS3Lh2RNGdBTg5QEn28Sh7/9o5V4HN9jN5rNGIJbeJkOXhJd6pm wpc94ux8Tif/UOCkNaDDrLkY8w7+K9NZ+BVVOzPB4cuoPTD7VJ4233gxK P0/bQE1TcCU2g3pwaoDMDQCj3gtWjcgbFA9+xCprB7Gsj5XDWL5hikguX tEyq1EbZ3KOv7iepp9PInMVCKG6rSW3LqQcgtX+wcLEkObDpLOxSuJ5YG A==; IronPort-SDR: w7tVOdYPOZm3CNcpvJ+EejaIQ0ziHqHwd+Skh6UvKxwh2dQxvsD5znFpbGQIetTvlvRtoGbzA5 yUW7U5IjKf86Kj1uzB8JAL5lWmkW0IX7v1MpzoKzabBTqPMV1/RVg5CUckBAZhzCaae6p8kcJn IA+LwRniqKyRuyQwg9drwfAFLvHgocsYWTjxIAJgiVdBM3xnFxoUwC4EvY9OAXUxDjLvFqG2SL ip18DeeSddM15P7mn9gWizLLn+HqE3BLVejl+oScb7vtUABBCGYEFFnKnmxtHA9IsqQnPS+wsx 70U= IronPort-SDR: /FN4tfA6Xf0I/43iKwdVw0WLqFud1ecVNnNxvTSvN/IiNsAZP5WWVQ867PwQhP2m2WWfib8d+N fg3JsN926NLb2J4X3hBjhjA2V1HM0+oBW8ONls1nLvixlrK00MnkldkHv2GFCTfwE9WUggffOs 4peZkqnXmEUPf6SzE9WVVg4UsxuP5TPVxrxMtOYXlcZozvBs7Z/OMQfhIyChY2vVOvpsrPwKqY NPiYhYkR1MmrmYReS6t2+cipF43jq3Q3GDUffhk3D+02fh4BPxJgnZSAMoLe0EjGgb1q2qbK5G BxL9/meD5xyG/kf+WSA87uR/ IronPort-SDR: IIIzhaft7yb/3fIIPlyjwlNqWN4Ayorkzj6xqGFRz/3RZHl+wbUxv/EgmyVtkI06IOY8LPxrAA TCEKqIIu1lk7mL2t1iUJCr9UpcmBS0HUKd5QT/pIXHyO3Dhkfcs/smQx33LmVcHbelpgVxhBob cWWWycbNCVi1+B1DumfMTHWVLiSQqDZOdm6PmDQCQbVWKXrxM4RUHHt2RjO70OzTGUxcuB7Eqg JCRc5sqspKdhqpV27s3dyLeiADbvclkPzmuOj5GQVesEiWLmlzGir+jhtntrEStvBjHoByLuEt QY4= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, Alistair Francis , Adhemerval Zanella Subject: [PATCH v3 1/2] sysdeps: Add clock_gettime64 vDSO Date: Sat, 23 Nov 2019 14:27:07 -0800 Message-Id: <20191123222708.17021-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. 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 d90ca820be..d005d13322 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 792ac39d85..c6d505bab3 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;