Commit 413ea171 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/clock: dovetail: use refined monotonic source

In order to have applications calling clock_gettime(CLOCK_MONOTONIC)
and Cobalt share the same monotonic source, we need Cobalt to get
timestamps from ktime_get_mono_fast_ns().

Although pipeline_read_cycle_counter() does seem to hint to a raw
source, with Dovetail, our idea of time is directly based on a refined
count of nanoseconds since the epoch, the hardware time counter is
transparent to us. This naming discrepancy comes from the legacy
I-pipe support where we do manipulate hardware ticks internally; this
issue should go when such support is discontinued eventually.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent 4b1eeab3
......@@ -13,8 +13,14 @@ struct timespec64;
static inline u64 pipeline_read_cycle_counter(void)
{
/* Read the raw cycle counter of the core clock. */
return ktime_get_raw_fast_ns();
/*
* With Dovetail, our idea of time is directly based on a
* refined count of nanoseconds since the epoch, the hardware
* time counter is transparent to us. For this reason,
* xnclock_ticks_to_ns() and xnclock_ns_to_ticks() are
* idempotent when building for Dovetail.
*/
return ktime_get_mono_fast_ns();
}
void pipeline_set_timer_shot(unsigned long cycles);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment