timer.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_TIMER_H
  3. #define _ASM_X86_TIMER_H
  4. #include <linux/pm.h>
  5. #include <linux/percpu.h>
  6. #include <linux/interrupt.h>
  7. #include <linux/math64.h>
  8. #define TICK_SIZE (tick_nsec / 1000)
  9. unsigned long long native_sched_clock(void);
  10. extern void recalibrate_cpu_khz(void);
  11. extern int no_timer_check;
  12. extern bool using_native_sched_clock(void);
  13. /*
  14. * We use the full linear equation: f(x) = a + b*x, in order to allow
  15. * a continuous function in the face of dynamic freq changes.
  16. *
  17. * Continuity means that when our frequency changes our slope (b); we want to
  18. * ensure that: f(t) == f'(t), which gives: a + b*t == a' + b'*t.
  19. *
  20. * Without an offset (a) the above would not be possible.
  21. *
  22. * See the comment near cycles_2_ns() for details on how we compute (b).
  23. */
  24. struct cyc2ns_data {
  25. u32 cyc2ns_mul;
  26. u32 cyc2ns_shift;
  27. u64 cyc2ns_offset;
  28. }; /* 16 bytes */
  29. extern void cyc2ns_read_begin(struct cyc2ns_data *);
  30. extern void cyc2ns_read_end(void);
  31. #endif /* _ASM_X86_TIMER_H */