/* Pentium 4 Model 0 and 1 do not have the Core Clock Frequency *toSystemBusFrequencyRatioFieldintheProcessorFrequency *ConfigurationRegisteroftheMSR.Thereforethecurrent *frequencycannotbecalculatedandhastobemeasured.
*/ if (c->x86_model < 2) return cpu_khz;
/* Warning: may get called from smp_call_function_single. */ unsignedint speedstep_get_frequency(enum speedstep_processor processor)
{ switch (processor) { case SPEEDSTEP_CPU_PCORE: return pentium_core_get_frequency(); case SPEEDSTEP_CPU_PM: return pentiumM_get_frequency(); case SPEEDSTEP_CPU_P4D: case SPEEDSTEP_CPU_P4M: return pentium4_get_frequency(); case SPEEDSTEP_CPU_PIII_T: case SPEEDSTEP_CPU_PIII_C: case SPEEDSTEP_CPU_PIII_C_EARLY: return pentium3_get_frequency(processor); default: return0;
} return0;
}
EXPORT_SYMBOL_GPL(speedstep_get_frequency);
/* Keep in sync with the x86_cpu_id tables in the different modules */ enum speedstep_processor speedstep_detect_processor(void)
{ struct cpuinfo_x86 *c = &cpu_data(0);
u32 ebx, msr_lo, msr_hi;
switch (c->x86_model) { case0x0B: /* Intel PIII [Tualatin] */ /* cpuid_ebx(1) is 0x04 for desktop PIII,
* 0x06 for mobile PIII-M */
ebx = cpuid_ebx(0x00000001);
pr_debug("ebx is %x\n", ebx);
ebx &= 0x000000FF;
if (ebx != 0x06) return0;
/* So far all PIII-M processors support SpeedStep. See *Intel's24540640.pdfofJune2003
*/ return SPEEDSTEP_CPU_PIII_T;
case0x08: /* Intel PIII [Coppermine] */
/* all mobile PIII Coppermines have FSB 100 MHz
* ==> sort out a few desktop PIIIs. */
rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_hi);
pr_debug("Coppermine: MSR_IA32_EBL_CR_POWERON is 0x%x, 0x%x\n",
msr_lo, msr_hi);
msr_lo &= 0x00c0000; if (msr_lo != 0x0080000) return0;
if ((!processor) || (!low_speed) || (!high_speed) || (!set_state)) return -EINVAL;
pr_debug("trying to determine both speeds\n");
/* get current speed */
prev_speed = speedstep_get_frequency(processor); if (!prev_speed) return -EIO;
pr_debug("previous speed is %u\n", prev_speed);
preempt_disable();
local_irq_save(flags);
/* switch to low state */
set_state(SPEEDSTEP_LOW);
*low_speed = speedstep_get_frequency(processor); if (!*low_speed) {
ret = -EIO; goto out;
}
pr_debug("low speed is %u\n", *low_speed);
/* start latency measurement */ if (transition_latency)
tv1 = ktime_get();
/* switch to high state */
set_state(SPEEDSTEP_HIGH);
/* end latency measurement */ if (transition_latency)
tv2 = ktime_get();
*high_speed = speedstep_get_frequency(processor); if (!*high_speed) {
ret = -EIO; goto out;
}
pr_debug("high speed is %u\n", *high_speed);
if (*low_speed == *high_speed) {
ret = -ENODEV; goto out;
}
/* switch to previous state, if necessary */ if (*high_speed != prev_speed)
set_state(SPEEDSTEP_LOW);
if (transition_latency) {
*transition_latency = ktime_to_us(ktime_sub(tv2, tv1));
pr_debug("transition latency is %u uSec\n", *transition_latency);
/* convert uSec to nSec and add 20% for safety reasons */
*transition_latency *= 1200;
/* check if the latency measurement is too high or too low *andsetittoasafevalue(500uSec)inthatcase
*/ if (*transition_latency > 10000000 ||
*transition_latency < 50000) {
pr_warn("frequency transition measured seems out of range (%u nSec), falling back to a safe one of %u nSec\n",
*transition_latency, 500000);
*transition_latency = 500000;
}
}
#ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK
module_param(relaxed_check, int, 0444);
MODULE_PARM_DESC(relaxed_check, "Don't do all checks for speedstep capability."); #endif
MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
MODULE_DESCRIPTION("Library for Intel SpeedStep 1 or 2 cpufreq drivers.");
MODULE_LICENSE("GPL");
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.21 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.