[PATCH 02/10] dovetail/clock: implement pipeline_read_cycle_counter

Philippe Gerum rpm at xenomai.org
Mon Jan 11 18:26:27 CET 2021


hongzha1 via Xenomai <xenomai at xenomai.org> writes:

> Signed-off-by: hongzha1 <hongzhan.chen at intel.com>
> ---
>  include/cobalt/kernel/dovetail/pipeline/clock.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/include/cobalt/kernel/dovetail/pipeline/clock.h b/include/cobalt/kernel/dovetail/pipeline/clock.h
> index 19e3d8986..5176b1506 100644
> --- a/include/cobalt/kernel/dovetail/pipeline/clock.h
> +++ b/include/cobalt/kernel/dovetail/pipeline/clock.h
> @@ -13,9 +13,7 @@ struct timespec64;
>  static inline u64 pipeline_read_cycle_counter(void)
>  {
>  	/* Read the raw cycle counter of the core clock. */
> -	TODO();
> -
> -	return 0;
> +	return  ktime_get_raw_fast_ns();
>  }
>  
>  static inline void pipeline_set_timer_shot(unsigned long cycles)

Ack, picking up this patch. Thanks.

NOTE: this can only work because Dovetail requires us to align on the
in-band kernel's idea of time, i.e. nanosecs. In that case, one Cobalt
"TSC" tick equals one nanosecond.

-- 
Philippe.



More information about the Xenomai mailing list