bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH Mach] Add a mach host operation which returns elapsed tim


From: Luca
Subject: Re: [RFC PATCH Mach] Add a mach host operation which returns elapsed time since bootup
Date: Wed, 18 Dec 2024 21:18:53 +0100

Hi,

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 <zhmingluo@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?


Luca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]