.. | .. |
---|
6 | 6 | #define _ASM_X86_TSC_H |
---|
7 | 7 | |
---|
8 | 8 | #include <asm/processor.h> |
---|
9 | | - |
---|
10 | | -#define NS_SCALE 10 /* 2^10, carefully chosen */ |
---|
11 | | -#define US_SCALE 32 /* 2^32, arbitralrily chosen */ |
---|
| 9 | +#include <asm/cpufeature.h> |
---|
12 | 10 | |
---|
13 | 11 | /* |
---|
14 | 12 | * Standard way to access the cycle counter. |
---|
.. | .. |
---|
22 | 20 | |
---|
23 | 21 | static inline cycles_t get_cycles(void) |
---|
24 | 22 | { |
---|
25 | | -#ifndef CONFIG_X86_TSC |
---|
26 | | - if (!boot_cpu_has(X86_FEATURE_TSC)) |
---|
| 23 | + if (!IS_ENABLED(CONFIG_X86_TSC) && |
---|
| 24 | + !cpu_feature_enabled(X86_FEATURE_TSC)) |
---|
27 | 25 | return 0; |
---|
28 | | -#endif |
---|
29 | | - |
---|
30 | 26 | return rdtsc(); |
---|
31 | 27 | } |
---|
| 28 | +#define get_cycles get_cycles |
---|
32 | 29 | |
---|
33 | 30 | extern struct system_counterval_t convert_art_to_tsc(u64 art); |
---|
34 | 31 | extern struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns); |
---|
35 | 32 | |
---|
36 | 33 | extern void tsc_early_init(void); |
---|
37 | 34 | extern void tsc_init(void); |
---|
| 35 | +extern unsigned long calibrate_delay_is_known(void); |
---|
38 | 36 | extern void mark_tsc_unstable(char *reason); |
---|
39 | 37 | extern int unsynchronized_tsc(void); |
---|
40 | 38 | extern int check_tsc_unstable(void); |
---|