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.
This commit is contained in:
Marshall Mohror
2022-07-06 12:42:01 -05:00
parent 770611fdf3
commit b2ad4dd189
3 changed files with 19 additions and 1 deletions

View File

@ -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;