summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-03-13 01:42:12 -0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-03-13 20:42:03 +0100
commit5ff6ff2707b7b482efc9e172c87bd5c4106d9ed4 (patch)
tree68abe2ad4b92c47deebb23bdcd54eb359d9921a9 /include
parentf72cc8c81afe03667cc1ee70169ed343a40f4578 (diff)
Track task and thread time using time_value64_t.
Changed kern/timer.c to use the higher precision time_value64_t. Of course, this won't suffer from the 2038 overflow but it does provide nanosecond precision (if gnumach ever uses a better timer) and moves us closer to only having time_value64_t. Message-Id: <ZA63tGcv3bETUJFJ@jupiter.tail36e24.ts.net>
Diffstat (limited to 'include')
-rw-r--r--include/mach/time_value.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mach/time_value.h b/include/mach/time_value.h
index 0643b740..ea661ec3 100644
--- a/include/mach/time_value.h
+++ b/include/mach/time_value.h
@@ -140,6 +140,11 @@ static __inline__ time_value_t convert_time_value_from_user(rpc_time_value_t tv)
time_value64_sub_nanos(result, (subtrahend)->nanoseconds); \
}
+#define time_value64_init(tv) { \
+ (tv)->seconds = 0; \
+ (tv)->nanoseconds = 0; \
+ }
+
#define TIME_VALUE64_TO_TIME_VALUE(tv64, tv) do { \
(tv)->seconds = (tv64)->seconds; \
(tv)->microseconds = (tv64)->nanoseconds / 1000; \