projects/linux·blob master · refs

37 lines · 1.0 KiB

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
9unsigned long long native_sched_clock(void);
10extern void recalibrate_cpu_khz(void);
11
12extern int no_timer_check;
13
14extern bool using_native_sched_clock(void);
15void paravirt_set_sched_clock(u64 (*func)(void));
16
17/*
18 * We use the full linear equation: f(x) = a + b*x, in order to allow
19 * a continuous function in the face of dynamic freq changes.
20 *
21 * Continuity means that when our frequency changes our slope (b); we want to
22 * ensure that: f(t) == f'(t), which gives: a + b*t == a' + b'*t.
23 *
24 * Without an offset (a) the above would not be possible.
25 *
26 * See the comment near cycles_2_ns() for details on how we compute (b).
27 */
28struct cyc2ns_data {
29 u32 cyc2ns_mul;
30 u32 cyc2ns_shift;
31 u64 cyc2ns_offset;
32}; /* 16 bytes */
33
34extern void cyc2ns_read_begin(struct cyc2ns_data *);
35extern void cyc2ns_read_end(void);
36
37#endif /* _ASM_X86_TIMER_H */