函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\apic\apic.c Create Date:2022-07-27 09:26:39
Last Modify:2020-03-16 21:21:31 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:calibrate_APIC_clock

函数原型:static int __init calibrate_APIC_clock(void)

返回类型:int

参数:

866  levt等于this_cpu_ptr( & lapic_events)
867  tsc_perj等于0, tsc_start等于0
871  pm_referenced等于0
873  如果boot_cpu_has(TSC deadline timer )则返回:0
881  如果非lapic_init_clockevent()则
882  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "lapic timer already calibrated %d\n", lapic_timer_period)
888  features与等于CLOCK_EVT_FEAT_DUMMY的反
889  返回:0
892  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "Using local APIC timer interrupts.\ncalibrating APIC timer ...\n")
900  禁止中断()
906  This function sets up the local APIC timer, with a timeout of* 'clocks' APIC bus clock. During calibration we actually call* this function twice on the boot CPU, once with a bogus timeout* value, second time for real. The other (noncalibrating) CPUs
913  jif_start等于READ_ONCE(jiffies)
915  如果tsc_khz
916  tsc_start等于dtsc() - returns the current TSC without ordering constraints* rdtsc() returns the result of RDTSC as a 64-bit integer
917  tsc_perj等于div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
924  开中断()
926 lapic_cal_loops小于等于In this functions we calibrate APIC bus clocks to the external timer循环
928  当1循环
929  如果tsc_khz
935  否则
943  cpu_relax()
947  禁止中断()
948  Temporary interrupt handler and polled calibration function.
949  开中断()
952  禁止中断()
955  delta等于lapic_cal_t1lapic_cal_t2
956  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "... lapic delta = %ld\n", delta)
958  deltatsc等于lapic_cal_tsc2lapic_cal_tsc1
961  pm_referenced等于非calibrate_by_pmtimer(lapic_cal_pm2 - lapic_cal_pm1, & delta, & deltatsc)
964  lapic_timer_period等于deltaClock divisor In this functions we calibrate APIC bus clocks to the external timer
965  lapic_init_clockevent()
967  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "..... delta %ld\n", delta)
968  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "..... mult: %u\n", mult)
969  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "..... calibration result: %u\n", lapic_timer_period)
972  如果boot_cpu_has(Time Stamp Counter )则
973  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "..... CPU clock speed is %ld.%04ld MHz.\n", (deltatsc / In this functions we calibrate APIC bus clocks to the external timer) / (1000000 / HZ), (deltatsc / In this functions we calibrate APIC bus clocks to the external timer) % (1000000 / HZ))
979  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "..... host bus clock speed is %u.%04u MHz.\n", lapic_timer_period / (1000000 / HZ), lapic_timer_period % (1000000 / HZ))
987  如果lapic_timer_period小于1000000除HZ
988  开中断()
989  打印警告信息("APIC frequency too slow, disabling apic timer\n")
990  返回:负1
993  features与等于CLOCK_EVT_FEAT_DUMMY的反
1000  如果非pm_referencedHPET replaces the PIT, when enabled. So we need to know, which of* the two timers is used
1001  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "... verify APIC timer\n")
1006  event_handler等于Temporary interrupt handler and polled calibration function.
1007  lapic_timer_set_periodic(levt)
1008  lapic_cal_loops等于负1
1011  开中断()
1013 lapic_cal_loops小于等于In this functions we calibrate APIC bus clocks to the external timer循环
1014  cpu_relax()
1017  禁止中断()
1018  lapic_timer_shutdown(levt)
1021  deltaj等于lapic_cal_j2lapic_cal_j1
1022  Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "... jiffies delta = %lu\n", deltaj)
1025  如果deltaj大于等于In this functions we calibrate APIC bus clocks to the external timer减2且deltaj小于等于In this functions we calibrate APIC bus clocks to the external timer加2则Define the default level of output to be very little* This can be turned up by using apic=verbose for more* information and apic=debug for _lots_ of information.* apic_verbosity is defined in apic.c(APIC_VERBOSE, "... jiffies result ok\n")
1027  否则features或等于CLOCK_EVT_FEAT_DUMMY
1030  开中断()
1032  如果features按位与CLOCK_EVT_FEAT_DUMMY
1033  打印警告信息("APIC timer disabled due to verification failure\n")
1034  返回:负1
1037  返回:0
调用者
名称描述
x86_init_noopSetup the boot APIC* Calibrate and verify the result.