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