timekeeping_internal.h 663 B

1234567891011121314151617181920212223242526272829
  1. #ifndef _TIMEKEEPING_INTERNAL_H
  2. #define _TIMEKEEPING_INTERNAL_H
  3. /*
  4. * timekeeping debug functions
  5. */
  6. #include <linux/clocksource.h>
  7. #include <linux/time.h>
  8. #ifdef CONFIG_DEBUG_FS
  9. extern void tk_debug_account_sleep_time(struct timespec64 *t);
  10. #else
  11. #define tk_debug_account_sleep_time(x)
  12. #endif
  13. #ifdef CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE
  14. static inline cycle_t clocksource_delta(cycle_t now, cycle_t last, cycle_t mask)
  15. {
  16. cycle_t ret = (now - last) & mask;
  17. return (s64) ret > 0 ? ret : 0;
  18. }
  19. #else
  20. static inline cycle_t clocksource_delta(cycle_t now, cycle_t last, cycle_t mask)
  21. {
  22. return (now - last) & mask;
  23. }
  24. #endif
  25. #endif /* _TIMEKEEPING_INTERNAL_H */