public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] timer: Decouple x86_64 specific timer_gettime from generic Linux implementation
@ 2019-12-05 23:41 Lukasz Majewski
0 siblings, 0 replies; only message in thread
From: Lukasz Majewski @ 2019-12-05 23:41 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=115959290f01f6c0674e16e0de5d8a16f79d19de
commit 115959290f01f6c0674e16e0de5d8a16f79d19de
Author: Lukasz Majewski <lukma@denx.de>
Date: Tue Nov 5 12:18:24 2019 +0100
timer: Decouple x86_64 specific timer_gettime from generic Linux implementation
The x86_64 specific timer_gettime implementation (from
./linux/x86_64/timer_gettime.c) reused the Linux generic one (from
./linux/timer_gettime.c) to implement handling some compatible timers
(previously defined in librt, now in libc).
As the generic implementation now is going to also support new (available
from Linux 5.1+) timer_gettime64 syscall, those two implementations have
been decoupled for easier conversion.
The original INLINE_SYSCALL() macro has been replaced with
INLINE_SYSCALL_CALL() to avoid explicit passing the number of arguments.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diff:
---
sysdeps/unix/sysv/linux/timer_gettime.c | 7 -------
sysdeps/unix/sysv/linux/x86_64/timer_gettime.c | 12 ++++++++----
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/timer_gettime.c b/sysdeps/unix/sysv/linux/timer_gettime.c
index 799e2c9..8d9bef9 100644
--- a/sysdeps/unix/sysv/linux/timer_gettime.c
+++ b/sysdeps/unix/sysv/linux/timer_gettime.c
@@ -22,16 +22,9 @@
#include <sysdep.h>
#include "kernel-posix-timers.h"
-
-#ifdef timer_gettime_alias
-# define timer_gettime timer_gettime_alias
-#endif
-
-
int
timer_gettime (timer_t timerid, struct itimerspec *value)
{
-#undef timer_gettime
struct timer *kt = (struct timer *) timerid;
/* Delete the kernel timer object. */
diff --git a/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c b/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
index 54daee2..0122dee 100644
--- a/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
+++ b/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
@@ -17,13 +17,17 @@
not, see <https://www.gnu.org/licenses/>. */
#include <shlib-compat.h>
+#include <sysdep.h>
+#include "kernel-posix-timers.h"
#include "compat-timer.h"
+int
+__timer_gettime_new (timer_t timerid, struct itimerspec *value)
+{
+ struct timer *kt = (struct timer *) timerid;
-#define timer_gettime_alias __timer_gettime_new
-#include <sysdeps/unix/sysv/linux/timer_gettime.c>
-
-#undef timer_gettime
+ return INLINE_SYSCALL_CALL (timer_gettime, kt->ktimerid, value);
+}
versioned_symbol (librt, __timer_gettime_new, timer_gettime, GLIBC_2_3_3);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-12-05 23:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 23:41 [glibc] timer: Decouple x86_64 specific timer_gettime from generic Linux implementation Lukasz Majewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).