Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\tsc.c Create Date:2022-07-28 07:46:19
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ative_calibrate_tsc* Determine TSC frequency via CPUID, else return 0.

Proto:unsigned long native_calibrate_tsc(void)

Type:unsigned long

Parameter:Nothing

619  If CPU vendor != X86_VENDOR_INTEL Then Return 0
622  If Maximum supported CPUID level, -1=no CPUID: < 0x15 Then Return 0
625  eax_denominator = ebx_numerator = ecx_hz = edx = 0
628  cpuid(0x15, & eax_denominator, & ebx_numerator, & ecx_hz, & edx)
630  If ebx_numerator == 0 || eax_denominator == 0 Then Return 0
633  crystal_khz = ecx_hz / 1000
640  If crystal_khz == 0 && x86_model == Denverton Then crystal_khz = 25000
649  If crystal_khz != 0 Then setup_force_cpu_cap(TSC has known frequency )
657  If crystal_khz == 0 && Maximum supported CPUID level, -1=no CPUID: >= 0x16 Then
660  cpuid(0x16, & eax_base_mhz, & ebx, & ecx, & edx)
661  crystal_khz = eax_base_mhz * 1000 * eax_denominator / ebx_numerator
665  If crystal_khz == 0 Then Return 0
672  If x86_model == Apollo Lake Then setup_force_cpu_cap(TSC is known to be reliable )
685  Return crystal_khz * ebx_numerator / eax_denominator