From b2ad4dd189135be9a87af86619d6f5854525f7fa Mon Sep 17 00:00:00 2001 From: Marshall Mohror Date: Wed, 6 Jul 2022 12:42:01 -0500 Subject: common/x64: Use TSC clock rate from CPUID when available The current method used to estimate the TSC is fairly accurate - within a few kHz - but the exact value can be extracted from CPUID if available. --- src/common/x64/cpu_detect.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/common/x64/cpu_detect.h') diff --git a/src/common/x64/cpu_detect.h b/src/common/x64/cpu_detect.h index 9bdc9dbfa..6830f3795 100644 --- a/src/common/x64/cpu_detect.h +++ b/src/common/x64/cpu_detect.h @@ -30,6 +30,11 @@ struct CPUCaps { u32 max_frequency; u32 bus_frequency; + u32 tsc_crystal_ratio_denominator; + u32 tsc_crystal_ratio_numerator; + u32 crystal_frequency; + u64 tsc_frequency; // Derived from the above three values + bool sse : 1; bool sse2 : 1; bool sse3 : 1; -- cgit v1.2.3