hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * SPDX-License-Identifier: GPL-2.0
 */
 
#ifndef _COBALT_KERNEL_IPIPE_CLOCK_H
#define _COBALT_KERNEL_IPIPE_CLOCK_H
 
#include <linux/ipipe_tickdev.h>
#include <cobalt/uapi/kernel/types.h>
 
struct timespec64;
 
static inline u64 pipeline_read_cycle_counter(void)
{
   u64 t;
   ipipe_read_tsc(t);
   return t;
}
 
xnticks_t pipeline_read_wallclock(void);
 
int pipeline_set_wallclock(xnticks_t epoch_ns);
 
static inline void pipeline_set_timer_shot(unsigned long cycles)
{
   ipipe_timer_set(cycles);
}
 
static inline const char *pipeline_timer_name(void)
{
   return ipipe_timer_name();
}
 
static inline const char *pipeline_clock_name(void)
{
   return ipipe_clock_name();
}
 
int pipeline_get_host_time(struct timespec64 *tp);
 
void pipeline_update_clock_freq(unsigned long long freq);
 
void pipeline_init_clock(void);
 
#endif /* !_COBALT_KERNEL_IPIPE_CLOCK_H */