Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:MSR-based CPU/TSC frequency discovery for certain CPUs.* Set global "lapic_timer_period" to bus_clock_cycles/jiffy* Return processor base frequency in KHz, or 0 on failure.

Proto:unsigned long cpu_khz_from_msr(void)

Type:unsigned long

Parameter:Nothing

89  id = x86_match_cpu(tsc_msr_cpu_ids)
90  If Not id Then Return 0
93  freq_desc = driver_data
94  If 1: use MSR_PLATFORM_INFO, 0: MSR_IA32_PERF_STATUS Then
95  Access to machine-specific registers (available on 586 and better only)* Note: the rd* operations modify the parameters directly (without using* pointer indirection), this allows gcc to optimize better(MSR_PLATFORM_INFO, lo, hi)
96  ratio = lo >> 8 & 0xff
97  Else
98  Access to machine-specific registers (available on 586 and better only)* Note: the rd* operations modify the parameters directly (without using* pointer indirection), this allows gcc to optimize better(MSR_IA32_PERF_STATUS, lo, hi)
99  ratio = hi >> 8 & 0x1f
103  Access to machine-specific registers (available on 586 and better only)* Note: the rd* operations modify the parameters directly (without using* pointer indirection), this allows gcc to optimize better(MSR_FSB_FREQ, lo, hi)
106  freq = freqs[lo & 0x7]
109  res = freq * ratio
121  setup_force_cpu_cap(TSC has known frequency )
131  setup_force_cpu_cap(TSC is known to be reliable )
133  Return res