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:18
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:quick_pit_calibrate

Proto:static unsigned long quick_pit_calibrate(void)

Type:unsigned long

Parameter:Nothing

525  If Not has_legacy_pic() Then Return 0
529  Basic port I/O
540  Basic port I/O
543  Basic port I/O
544  Basic port I/O
552  This reads the current MSB of the PIT counter, and* checks if we are running on sufficiently fast and* non-virtualized hardware
554  If pit_expect_msb(0xff, & tsc, & d1) Then
556  If Not pit_expect_msb(0xff - i, & delta, & d2) Then Break
559  delta -= tsc
565  If i == 1 && d1 + d2 >= delta * MAX_QUICK_PIT_ITERATIONS >> 11 Then Return 0
572  If d1 + d2 >= delta >> 11 Then Continue
584  Go to success
587  pr_info("Fast TSC calibration failed\n")
588  Return 0
590  success :
604  delta *= The clock frequency of the i8253/i8254 PIT
605  do_div() is NOT a C function(delta, i * 256 * 1000)
606  pr_info("Fast TSC calibration using PIT\n")
607  Return delta
Caller
NameDescribe
native_calibrate_cpu_earlyative_calibrate_cpu_early - can calibrate the cpu early in boot