timer.h 1.0 KB

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