1 #ifndef _TIMEKEEPING_INTERNAL_H
2 #define _TIMEKEEPING_INTERNAL_H
4 * timekeeping debug functions
6 #include <linux/clocksource.h>
7 #include <linux/time.h>
10 extern void tk_debug_account_sleep_time(struct timespec64
*t
);
12 #define tk_debug_account_sleep_time(x)
15 #ifdef CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE
16 static inline cycle_t
clocksource_delta(cycle_t now
, cycle_t last
, cycle_t mask
)
18 cycle_t ret
= (now
- last
) & mask
;
21 * Prevent time going backwards by checking the MSB of mask in
22 * the result. If set, return 0.
24 return ret
& ~(mask
>> 1) ? 0 : ret
;
27 static inline cycle_t
clocksource_delta(cycle_t now
, cycle_t last
, cycle_t mask
)
29 return (now
- last
) & mask
;
33 extern time64_t
__ktime_get_real_seconds(void);
35 #endif /* _TIMEKEEPING_INTERNAL_H */