H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_TIMER_H |
| 2 | #define _ASM_X86_TIMER_H |
Shaohua Li | c3c433e | 2005-09-03 15:57:07 -0700 | [diff] [blame] | 3 | #include <linux/pm.h> |
Guillaume Chazarain | 53d517c | 2008-01-30 13:30:06 +0100 | [diff] [blame] | 4 | #include <linux/percpu.h> |
Ingo Molnar | 8e6dafd | 2009-02-23 00:34:39 +0100 | [diff] [blame] | 5 | #include <linux/interrupt.h> |
Peter Zijlstra | 5dd12c21 | 2013-11-29 18:04:39 +0100 | [diff] [blame] | 6 | #include <linux/math64.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #define TICK_SIZE (tick_nsec / 1000) |
Zachary Amsden | 6cb9a83 | 2007-03-05 00:30:35 -0800 | [diff] [blame] | 9 | |
Zachary Amsden | 6cb9a83 | 2007-03-05 00:30:35 -0800 | [diff] [blame] | 10 | unsigned long long native_sched_clock(void); |
Stephen Rothwell | 25c1a41 | 2009-03-30 11:10:27 +1100 | [diff] [blame] | 11 | extern int recalibrate_cpu_khz(void); |
Jaswinder Singh | cc03849 | 2008-07-21 21:52:51 +0530 | [diff] [blame] | 12 | |
| 13 | extern int no_timer_check; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
Peter Zijlstra | 20d1c86 | 2013-11-29 15:40:29 +0100 | [diff] [blame] | 15 | /* |
| 16 | * We use the full linear equation: f(x) = a + b*x, in order to allow |
| 17 | * a continuous function in the face of dynamic freq changes. |
| 18 | * |
| 19 | * Continuity means that when our frequency changes our slope (b); we want to |
| 20 | * ensure that: f(t) == f'(t), which gives: a + b*t == a' + b'*t. |
| 21 | * |
| 22 | * Without an offset (a) the above would not be possible. |
| 23 | * |
| 24 | * See the comment near cycles_2_ns() for details on how we compute (b). |
| 25 | */ |
| 26 | struct cyc2ns_data { |
| 27 | u32 cyc2ns_mul; |
| 28 | u32 cyc2ns_shift; |
| 29 | u64 cyc2ns_offset; |
| 30 | u32 __count; |
| 31 | /* u32 hole */ |
| 32 | }; /* 24 bytes -- do not grow */ |
| 33 | |
| 34 | extern struct cyc2ns_data *cyc2ns_read_begin(void); |
| 35 | extern void cyc2ns_read_end(struct cyc2ns_data *); |
Jeremy Fitzhardinge | 688340e | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 36 | |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 37 | #endif /* _ASM_X86_TIMER_H */ |