[v0.97] Do not consider CPUID freq == 0 as a bug. Check udev if CPUID freq is not supported

This commit is contained in:
Dr-Noob
2021-04-13 15:33:54 +02:00
parent 9fa7b4ce7f
commit 37eba4ba0c

View File

@@ -649,12 +649,7 @@ struct frequency* get_frequency_info(struct cpuInfo* cpu) {
freq->max = get_max_freq_from_file(0, cpu->hv->present); freq->max = get_max_freq_from_file(0, cpu->hv->present);
if(freq->max == 0) { if(freq->max == 0) {
if(cpu->hv->present) { printWarn("Read max CPU frequency from udev and got 0 MHz");
printWarn("Read max CPU frequency and got 0 MHz");
}
else {
printBug("Read max CPU frequency and got 0 MHz");
}
freq->max = UNKNOWN_FREQ; freq->max = UNKNOWN_FREQ;
} }
#endif #endif
@@ -671,24 +666,19 @@ struct frequency* get_frequency_info(struct cpuInfo* cpu) {
freq->max = ebx; freq->max = ebx;
if(freq->base == 0) { if(freq->base == 0) {
if(cpu->hv->present) { printWarn("Read base CPU frequency from CPUID and got 0 MHz");
printWarn("Read base CPU frequency and got 0 MHz");
}
else {
printBug("Read base CPU frequency and got 0 MHz");
}
freq->base = UNKNOWN_FREQ; freq->base = UNKNOWN_FREQ;
} }
if(freq->max == 0) { if(freq->max == 0) {
if(cpu->hv->present) { printWarn("Read max CPU frequency from CPUID and got 0 MHz. Using udev");
printWarn("Read max CPU frequency and got 0 MHz"); freq->max = get_max_freq_from_file(0, cpu->hv->present);
}
else { if(freq->max == 0) {
printBug("Read max CPU frequency and got 0 MHz"); printWarn("Read max CPU frequency from udev and got 0 MHz");
}
freq->max = UNKNOWN_FREQ; freq->max = UNKNOWN_FREQ;
} }
} }
}
return freq; return freq;
} }