2013-05-22 05:32:14 +00:00
|
|
|
#ifndef _TIMEKEEPING_INTERNAL_H
|
|
|
|
#define _TIMEKEEPING_INTERNAL_H
|
|
|
|
/*
|
|
|
|
* timekeeping debug functions
|
|
|
|
*/
|
2014-07-16 21:05:10 +00:00
|
|
|
#include <linux/clocksource.h>
|
2013-05-22 05:32:14 +00:00
|
|
|
#include <linux/time.h>
|
|
|
|
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
2014-07-16 21:04:01 +00:00
|
|
|
extern void tk_debug_account_sleep_time(struct timespec64 *t);
|
2013-05-22 05:32:14 +00:00
|
|
|
#else
|
|
|
|
#define tk_debug_account_sleep_time(x)
|
|
|
|
#endif
|
|
|
|
|
2014-07-16 21:05:12 +00:00
|
|
|
#ifdef CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE
|
|
|
|
static inline cycle_t clocksource_delta(cycle_t now, cycle_t last, cycle_t mask)
|
|
|
|
{
|
|
|
|
cycle_t ret = (now - last) & mask;
|
|
|
|
|
|
|
|
return (s64) ret > 0 ? ret : 0;
|
|
|
|
}
|
|
|
|
#else
|
2014-07-16 21:05:10 +00:00
|
|
|
static inline cycle_t clocksource_delta(cycle_t now, cycle_t last, cycle_t mask)
|
|
|
|
{
|
|
|
|
return (now - last) & mask;
|
|
|
|
}
|
2014-07-16 21:05:12 +00:00
|
|
|
#endif
|
2014-07-16 21:05:10 +00:00
|
|
|
|
2013-05-22 05:32:14 +00:00
|
|
|
#endif /* _TIMEKEEPING_INTERNAL_H */
|