On 12/19/24 4:18 AM, Luca wrote:
Hi,
Hello,
Il 18/12/24 02:20, Zhaoming Luo ha scritto:
The precision of this implmentation is 10ms. Not sure how to do with the
possible data race.
Signed-off-by: Zhaoming Luo <zhming...@163.com>
---
include/mach/mach_host.defs | 7 +++++++
kern/mach_clock.c | 20 ++++++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/include/mach/mach_host.defs b/include/mach/mach_host.defs
index 8fd9d6b3..67f72cda 100644
--- a/include/mach/mach_host.defs
+++ b/include/mach/mach_host.defs
@@ -386,3 +386,10 @@ routine host_adjust_time64(
routine host_get_kernel_version(
host : host_t;
out kernel_version : new_kernel_version_t);
+
+/*
+ * Get the elapsed time on this host.
+ */
+routine host_get_elapsed_time(
+ host : host_t;
+ out elapsed_time : time_value_t);
Why not expose this with a kernel device that can be memory mapped, as
done by the "time" device?
To be honest I came across /dev/time several times but I'm still quite
confused about it. I tried to read the documentation and the code of
storeio translator (`showtrans /dev/time` gave me /hurd/storeio ...) but
I didn't find something useful. May I have a detail explanation about
the "time" device? (purpose and mechanism). Or any documentation that's
worth to read?
Best,
--
Zhaoming Luo