2017-11-01 15:07:57 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2008-10-22 22:26:29 -07:00
|
|
|
#ifndef _ASM_X86_TIMER_H
|
|
|
|
|
#define _ASM_X86_TIMER_H
|
2005-09-03 15:57:07 -07:00
|
|
|
#include <linux/pm.h>
|
2008-01-30 13:30:06 +01:00
|
|
|
#include <linux/percpu.h>
|
2009-02-23 00:34:39 +01:00
|
|
|
#include <linux/interrupt.h>
|
2013-11-29 18:04:39 +01:00
|
|
|
#include <linux/math64.h>
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-03-05 00:30:35 -08:00
|
|
|
unsigned long long native_sched_clock(void);
|
2017-07-14 11:34:07 +08:00
|
|
|
extern void recalibrate_cpu_khz(void);
|
2008-07-21 21:52:51 +05:30
|
|
|
|
|
|
|
|
extern int no_timer_check;
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-03-17 12:48:18 +01:00
|
|
|
extern bool using_native_sched_clock(void);
|
2026-01-05 12:05:11 +01:00
|
|
|
void paravirt_set_sched_clock(u64 (*func)(void));
|
2017-03-17 12:48:18 +01:00
|
|
|
|
2013-11-29 15:40:29 +01:00
|
|
|
/*
|
|
|
|
|
* We use the full linear equation: f(x) = a + b*x, in order to allow
|
|
|
|
|
* a continuous function in the face of dynamic freq changes.
|
|
|
|
|
*
|
|
|
|
|
* Continuity means that when our frequency changes our slope (b); we want to
|
|
|
|
|
* ensure that: f(t) == f'(t), which gives: a + b*t == a' + b'*t.
|
|
|
|
|
*
|
|
|
|
|
* Without an offset (a) the above would not be possible.
|
|
|
|
|
*
|
|
|
|
|
* See the comment near cycles_2_ns() for details on how we compute (b).
|
|
|
|
|
*/
|
|
|
|
|
struct cyc2ns_data {
|
|
|
|
|
u32 cyc2ns_mul;
|
|
|
|
|
u32 cyc2ns_shift;
|
|
|
|
|
u64 cyc2ns_offset;
|
2017-05-02 13:22:07 +02:00
|
|
|
}; /* 16 bytes */
|
2013-11-29 15:40:29 +01:00
|
|
|
|
2017-05-02 13:22:07 +02:00
|
|
|
extern void cyc2ns_read_begin(struct cyc2ns_data *);
|
|
|
|
|
extern void cyc2ns_read_end(void);
|
2007-07-17 18:37:04 -07:00
|
|
|
|
2008-10-22 22:26:29 -07:00
|
|
|
#endif /* _ASM_X86_TIMER_H */
|