This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 1/2] sysdeps: Add clock_gettime64 vDSO
- From: Alistair Francis <alistair dot francis at wdc dot com>
- To: libc-alpha at sourceware dot org
- Cc: alistair23 at gmail dot com, Alistair Francis <alistair dot francis at wdc dot com>
- Date: Tue, 5 Nov 2019 15:42:48 -0800
- Subject: [PATCH 1/2] sysdeps: Add clock_gettime64 vDSO
- Ironport-sdr: qH8Eac6g1w0z816xy2mn9KWn3BrxG2kFq/tfV6Wxw0YiXXVVjTzI2QCB/RPd6T0k2QvtbbBJeT 4aTkpJWlLX2QFQ1gByqJsu+WWwTUOQ6osDTStru5Rnlwl5PZHUSm9nayyeKDf9hArX+BPFOeJB Q5BXAUzKJyqL7p3/ISmzRO/Vcp7RzB0XKzt5Ec22QIqFgpfbS0U1ppJeDeU3C5j4sQ51+Ov+gP u0xPOVhqcZ5O/9Vu4EyQyHR3IxfIXPITl+jx45tw8mNFlhcvMcgdljEJUo05DjrYrPEuscYcoS TTs=
- Ironport-sdr: cbKftW7HRx/BJwng1WxBZaEEhiqSv94ZFktJ3m6ozoWR+3eX0UC6jcYSjgjEO8OwF2XYGp9SwN gEJbmU5u0OryrzJ4yh/8HokiCIIvgClcuyFyHgfvt/8EnFi1+6SDToPkuZyAyq3DZYx/LuxM5C F4uv5FnIyRKLyJR18Mvc9YIPyv1kIE2c5t11pPCfxI4SC/ZWJNTY5NjZUApa3ZCi2beUrepedy N34kupZE+fshnEsDNNcTmdEy1n7HRjYcH5sdakr6ENS1V7oPFGV9Wk3ndigSCgmfibRPT/oWN5 nHFmLxiKvYytrYueQTxadpEk
- Ironport-sdr: VAe6CZG3a8AdROFrpD2YkcJyst7RF13AtntGlyuNp64JdklrLuonkHWxI07H0lOCRCXdpW/vlj GZXyxu855T4cyL7UIsSNik0/lz9DXABb4FtYf3URwgbD8bsUPtBAQ0oE/slZqkCUCbg3jViB2f 9cgA2hMYMCRB1bd3VjXKhtZwHKaZwdnP0rKw6b7Ul5S3AdHQbG1Xgi5detOuE1wWTcoCnFEM6U tHoGDXy9FzhC6GBIcYGKoraPQmSbF5pmjNLhZdHyyvJ1BoEh4Qz3EYMFuT1+4Em2S4Dm6Wa3Ga Xuw=
- Wdcironportexception: Internal
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.
---
This was patch was runtime tested with RV32 and RV64
It was build tested using the ./scripts/build-many-glibcs.py script.
I will run:
$ make ; make install ; make check
tests on native ARM (32-bit) with the following three confiugrations:
- 4.19 Kernel and 4.19 Headers
- 5.2 Kernel and 4.19 Headers
- 5.2 Kernel and 5.2 Headers
I should have the results later this week.
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;
--
2.23.0