Blame view
kernel/time/timekeeping_internal.h
827 Bytes
b24413180 License cleanup: ... |
1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
5c83545f2 power: Add option... |
2 3 4 5 6 |
#ifndef _TIMEKEEPING_INTERNAL_H #define _TIMEKEEPING_INTERNAL_H /* * timekeeping debug functions */ |
3a9783778 clocksource: Make... |
7 |
#include <linux/clocksource.h> |
5c83545f2 power: Add option... |
8 9 10 |
#include <linux/time.h> #ifdef CONFIG_DEBUG_FS |
7d489d15c timekeeping: Conv... |
11 |
extern void tk_debug_account_sleep_time(struct timespec64 *t); |
5c83545f2 power: Add option... |
12 13 14 |
#else #define tk_debug_account_sleep_time(x) #endif |
09ec54429 clocksource: Move... |
15 |
#ifdef CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE |
a5a1d1c29 clocksource: Use ... |
16 |
static inline u64 clocksource_delta(u64 now, u64 last, u64 mask) |
09ec54429 clocksource: Move... |
17 |
{ |
a5a1d1c29 clocksource: Use ... |
18 |
u64 ret = (now - last) & mask; |
09ec54429 clocksource: Move... |
19 |
|
1f45f1f33 clocksource: Make... |
20 21 22 23 24 |
/* * Prevent time going backwards by checking the MSB of mask in * the result. If set, return 0. */ return ret & ~(mask >> 1) ? 0 : ret; |
09ec54429 clocksource: Move... |
25 26 |
} #else |
a5a1d1c29 clocksource: Use ... |
27 |
static inline u64 clocksource_delta(u64 now, u64 last, u64 mask) |
3a9783778 clocksource: Make... |
28 29 30 |
{ return (now - last) & mask; } |
09ec54429 clocksource: Move... |
31 |
#endif |
3a9783778 clocksource: Make... |
32 |
|
dee366541 timekeeping: Prov... |
33 |
extern time64_t __ktime_get_real_seconds(void); |
5c83545f2 power: Add option... |
34 |
#endif /* _TIMEKEEPING_INTERNAL_H */ |