aboutsummaryrefslogtreecommitdiff
path: root/kern/timer.h
diff options
context:
space:
mode:
authorLuca Dariz <luca@orpolo.org>2023-02-12 18:03:11 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-02-12 18:28:47 +0100
commit5fdc928d3d29fdc93ad00cea5f5c877a19013d44 (patch)
treeb4b63da236cd6d805d6bcd7bafad03ef3994bb40 /kern/timer.h
parentb0d39e2ffda3cdd67d81022f40b2a73518fda6d0 (diff)
downloadgnumach-5fdc928d3d29fdc93ad00cea5f5c877a19013d44.tar.gz
gnumach-5fdc928d3d29fdc93ad00cea5f5c877a19013d44.tar.bz2
gnumach-5fdc928d3d29fdc93ad00cea5f5c877a19013d44.zip
fix rpc time value for 64 bit
* include/mach/task_info.h: use rpc variant of time_value_t * include/mach/thread_info.h: Likewise * kern/mach_clock.c: use rpc variant of time_value_t in read_time_stamp() * kern/mach_clock.h: Likewise * kern/thread.c: use rpc variant of thread_read_times() * kern/timer.h_ add thread_read_times_rpc() by converting time_value_t to the corresponding rpc structures inline. Message-Id: <20230212170313.1501404-5-luca@orpolo.org>
Diffstat (limited to 'kern/timer.h')
-rw-r--r--kern/timer.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/kern/timer.h b/kern/timer.h
index 35782b41..89790230 100644
--- a/kern/timer.h
+++ b/kern/timer.h
@@ -134,6 +134,18 @@ extern unsigned timer_delta(timer_t, timer_save_t);
extern void timer_normalize(timer_t);
extern void timer_init(timer_t);
+static inline void
+thread_read_times_rpc(thread_t thread,
+ rpc_time_value_t *user_time_p, rpc_time_value_t *system_time_p)
+{
+ time_value_t user_p, system_p;
+ thread_read_times(thread, &user_p, &system_p);
+ user_time_p->seconds = user_p.seconds;
+ user_time_p->microseconds = user_p.microseconds;
+ system_time_p->seconds = system_p.seconds;
+ system_time_p->microseconds = system_p.microseconds;
+}
+
#if STAT_TIME
/*
* Macro to bump timer values.