Function report |
Source Code:arch\x86\kernel\apic\apic.c |
Create Date:2022-07-28 08:26:56 |
Last Modify:2020-03-16 21:21:31 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:calibrate_APIC_clock
Proto:static int __init calibrate_APIC_clock(void)
Type:int
Parameter:Nothing
866 | levt = this_cpu_ptr( & lapic_events) |
871 | pm_referenced = 0 |
873 | If boot_cpu_has(TSC deadline timer ) Then Return 0 |
881 | If Not lapic_init_clockevent() Then |
888 | features &= ~CLOCK_EVT_FEAT_DUMMY |
889 | Return 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 | local_irq_disable() |
915 | If tsc_khz Then |
928 | When 1 cycle |
929 | If tsc_khz Then |
935 | Else |
943 | cpu_relax() |
947 | local_irq_disable() |
952 | local_irq_disable() |
955 | delta = lapic_cal_t1 - lapic_cal_t2 |
958 | deltatsc = lapic_cal_tsc2 - lapic_cal_tsc1 |
961 | pm_referenced = Not calibrate_by_pmtimer(lapic_cal_pm2 - lapic_cal_pm1, & delta, & deltatsc) |
964 | lapic_timer_period = delta * Clock divisor / In this functions we calibrate APIC bus clocks to the external timer |
965 | lapic_init_clockevent() |
972 | If boot_cpu_has(Time Stamp Counter ) Then |
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 | If lapic_timer_period < 1000000 / HZ Then |
989 | pr_warn("APIC frequency too slow, disabling apic timer\n") |
990 | Return -1 |
993 | features &= ~CLOCK_EVT_FEAT_DUMMY |
1007 | lapic_timer_set_periodic(levt) |
1008 | lapic_cal_loops = -1 |
1013 | When lapic_cal_loops <= In this functions we calibrate APIC bus clocks to the external timer cycle |
1014 | cpu_relax() |
1017 | local_irq_disable() |
1018 | lapic_timer_shutdown(levt) |
1021 | deltaj = lapic_cal_j2 - lapic_cal_j1 |
1027 | Else features |= CLOCK_EVT_FEAT_DUMMY |
1032 | If features & CLOCK_EVT_FEAT_DUMMY Then |
1033 | pr_warn("APIC timer disabled due to verification failure\n") |
1034 | Return -1 |
1037 | Return 0 |
Name | Describe |
---|---|
x86_init_noop | Setup the boot APIC* Calibrate and verify the result. |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |