mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
timekeeping: Provide ktime_get[*]_ns() helpers
A lot of code converts either timespecs or ktime_t to nanoseconds. Provide helper functions. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
This commit is contained in:
parent
dcaab54e34
commit
897994e32b
1 changed files with 15 additions and 0 deletions
|
@ -145,6 +145,21 @@ static inline ktime_t ktime_mono_to_real(ktime_t mono)
|
||||||
return ktime_mono_to_any(mono, TK_OFFS_REAL);
|
return ktime_mono_to_any(mono, TK_OFFS_REAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline u64 ktime_get_ns(void)
|
||||||
|
{
|
||||||
|
return ktime_to_ns(ktime_get());
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline u64 ktime_get_real_ns(void)
|
||||||
|
{
|
||||||
|
return ktime_to_ns(ktime_get_real());
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline u64 ktime_get_boot_ns(void)
|
||||||
|
{
|
||||||
|
return ktime_to_ns(ktime_get_boottime());
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RTC specific
|
* RTC specific
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue