Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_X86_TIMER_H
0003 #define _ASM_X86_TIMER_H
0004 #include <linux/pm.h>
0005 #include <linux/percpu.h>
0006 #include <linux/interrupt.h>
0007 #include <linux/math64.h>
0008 
0009 #define TICK_SIZE (tick_nsec / 1000)
0010 
0011 unsigned long long native_sched_clock(void);
0012 extern void recalibrate_cpu_khz(void);
0013 
0014 extern int no_timer_check;
0015 
0016 extern bool using_native_sched_clock(void);
0017 
0018 /*
0019  * We use the full linear equation: f(x) = a + b*x, in order to allow
0020  * a continuous function in the face of dynamic freq changes.
0021  *
0022  * Continuity means that when our frequency changes our slope (b); we want to
0023  * ensure that: f(t) == f'(t), which gives: a + b*t == a' + b'*t.
0024  *
0025  * Without an offset (a) the above would not be possible.
0026  *
0027  * See the comment near cycles_2_ns() for details on how we compute (b).
0028  */
0029 struct cyc2ns_data {
0030     u32 cyc2ns_mul;
0031     u32 cyc2ns_shift;
0032     u64 cyc2ns_offset;
0033 }; /* 16 bytes */
0034 
0035 extern void cyc2ns_read_begin(struct cyc2ns_data *);
0036 extern void cyc2ns_read_end(void);
0037 
0038 #endif /* _ASM_X86_TIMER_H */