aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>2025-07-01 10:58:04 +0200
committerThomas Gleixner <tglx@linutronix.de>2025-07-18 13:45:32 +0200
commit9b7fc3f14576c268f62fe0b882fac5e61239b659 (patch)
treed95ef8658d48429c608884dbc780000aebe58071 /kernel/time
parentvdso/gettimeofday: Introduce vdso_get_timestamp() (diff)
downloadlinux-9b7fc3f14576c268f62fe0b882fac5e61239b659.tar.gz
linux-9b7fc3f14576c268f62fe0b882fac5e61239b659.zip
vdso: Introduce aux_clock_resolution_ns()
Move the constant resolution to a shared header, so the vDSO can use it and return it without going through a syscall. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250701-vdso-auxclock-v1-10-df7d9f87b9b8@linutronix.de
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/timekeeping.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index c6fe89bded02..cbcf090bb4be 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -26,6 +26,8 @@
#include <linux/audit.h>
#include <linux/random.h>
+#include <vdso/auxclock.h>
+
#include "tick-internal.h"
#include "ntp_internal.h"
#include "timekeeping_internal.h"
@@ -2876,8 +2878,8 @@ static int aux_get_res(clockid_t id, struct timespec64 *tp)
if (!clockid_aux_valid(id))
return -ENODEV;
- tp->tv_sec = 0;
- tp->tv_nsec = 1;
+ tp->tv_sec = aux_clock_resolution_ns() / NSEC_PER_SEC;
+ tp->tv_nsec = aux_clock_resolution_ns() % NSEC_PER_SEC;
return 0;
}