函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\tsc_msr.c Create Date:2022-07-27 08:46:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:unsigned long cpu_khz_from_msr(void)

返回类型:unsigned long

参数:

89  id等于x86_match_cpu(tsc_msr_cpu_ids)
90  如果非id则返回:0
93  freq_desc等于driver_data
94  如果1: use MSR_PLATFORM_INFO, 0: MSR_IA32_PERF_STATUS
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  否则
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等于freqratio
121  setup_force_cpu_cap(TSC has known frequency )
131  setup_force_cpu_cap(TSC is known to be reliable )
133  返回:res
调用者
名称描述
native_calibrate_cpu_earlyative_calibrate_cpu_early - can calibrate the cpu early in boot