Function report |
Source Code:arch\x86\kernel\cpu\mce\therm_throt.c |
Create Date:2022-07-28 08:04:23 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:intel_init_thermal
Proto:void intel_init_thermal(struct cpuinfo_x86 *c)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
struct cpuinfo_x86 * | c |
645 | cpu = smp_processor_id() |
646 | tm2 = 0 |
649 | If Not Thermal monitoring depends on APIC, ACPI and clock modulation Then Return |
659 | h = lvtthmr_init |
670 | If (h & APIC_DM_FIXED_MASK) != APIC_DM_FIXED Then apic_write(APIC_LVTTHMR, lvtthmr_init) |
674 | If l & MSR_IA32_MISC_ENABLE_TM1 && h & APIC_DM_SMI Then |
675 | If Values used for system_state. Ordering of the states must not be changed* as code checks for <, <=, >, >= STATE. == SYSTEM_BOOTING Then pr_debug("CPU%d: Thermal monitoring handled by SMI\n", cpu) |
677 | Return |
681 | If cpu_has(c, Thermal Monitor 2 ) Then |
682 | If CPU family == 6 && ( x86_model == 9 || x86_model == 13 ) Then |
684 | If l & MSR_THERM2_CTL_TM_SELECT Then tm2 = 1 |
686 | Else if l & MSR_IA32_MISC_ENABLE_TM2 Then tm2 = 1 |
691 | h = THERMAL_APIC_VECTOR | APIC_DM_FIXED | APIC_LVT_MASKED |
692 | apic_write(APIC_LVTTHMR, h) |
695 | If cpu_has(c, Intel Power Limit Notification ) && Not int_pln_enable Then wrmsr(MSR_IA32_THERM_INTERRUPT, (l | (THERM_INT_LOW_ENABLE | THERM_INT_HIGH_ENABLE)) & ~THERM_INT_PLN_ENABLE, h) |
699 | Else if cpu_has(c, Intel Power Limit Notification ) && int_pln_enable Then wrmsr(MSR_IA32_THERM_INTERRUPT, l | (THERM_INT_LOW_ENABLE | THERM_INT_HIGH_ENABLE | THERM_INT_PLN_ENABLE), h) |
703 | Else wrmsr(MSR_IA32_THERM_INTERRUPT, l | (THERM_INT_LOW_ENABLE | THERM_INT_HIGH_ENABLE), h) |
707 | If cpu_has(c, Intel Package Thermal Status ) Then |
709 | If cpu_has(c, Intel Power Limit Notification ) && Not int_pln_enable Then wrmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT, (l | (PACKAGE_THERM_INT_LOW_ENABLE | PACKAGE_THERM_INT_HIGH_ENABLE)) & ~PACKAGE_THERM_INT_PLN_ENABLE, h) |
714 | Else if cpu_has(c, Intel Power Limit Notification ) && int_pln_enable Then wrmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT, l | (PACKAGE_THERM_INT_LOW_ENABLE | PACKAGE_THERM_INT_HIGH_ENABLE | PACKAGE_THERM_INT_PLN_ENABLE), h) |
728 | wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h) |
730 | pr_info_once("CPU0: Thermal monitoring enabled (%s)\n", tm2 ? "TM2" : "TM1") |
734 | atomic_set( & therm_throt_en, 1) |
Name | Describe |
---|---|
mce_intel_feature_init |
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 |