hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/arch/x86/include/asm/tsc.h
....@@ -6,9 +6,7 @@
66 #define _ASM_X86_TSC_H
77
88 #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>
1210
1311 /*
1412 * Standard way to access the cycle counter.
....@@ -22,19 +20,19 @@
2220
2321 static inline cycles_t get_cycles(void)
2422 {
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))
2725 return 0;
28
-#endif
29
-
3026 return rdtsc();
3127 }
28
+#define get_cycles get_cycles
3229
3330 extern struct system_counterval_t convert_art_to_tsc(u64 art);
3431 extern struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns);
3532
3633 extern void tsc_early_init(void);
3734 extern void tsc_init(void);
35
+extern unsigned long calibrate_delay_is_known(void);
3836 extern void mark_tsc_unstable(char *reason);
3937 extern int unsynchronized_tsc(void);
4038 extern int check_tsc_unstable(void);