Changed the Intel core temperature reading to evaluate the "Reading Valid" bit 31 for package level sensors as well (undocumented).

This commit is contained in:
Michael Möller
2013-08-03 13:12:07 +00:00
parent 7513405fba
commit fb67ee38dc
2 changed files with 17 additions and 18 deletions

View File

@@ -305,27 +305,26 @@ namespace OpenHardwareMonitor.Hardware.CPU {
for (int i = 0; i < coreTemperatures.Length; i++) { for (int i = 0; i < coreTemperatures.Length; i++) {
uint eax, edx; uint eax, edx;
if (Ring0.RdmsrTx( // if reading is valid
IA32_THERM_STATUS_MSR, out eax, out edx, if (Ring0.RdmsrTx(IA32_THERM_STATUS_MSR, out eax, out edx,
1UL << cpuid[i][0].Thread)) { 1UL << cpuid[i][0].Thread) && (eax & 0x80000000) != 0)
// if reading is valid {
if ((eax & 0x80000000) != 0) { // get the dist from tjMax from bits 22:16
// get the dist from tjMax from bits 22:16 float deltaT = ((eax & 0x007F0000) >> 16);
float deltaT = ((eax & 0x007F0000) >> 16); float tjMax = coreTemperatures[i].Parameters[0].Value;
float tjMax = coreTemperatures[i].Parameters[0].Value; float tSlope = coreTemperatures[i].Parameters[1].Value;
float tSlope = coreTemperatures[i].Parameters[1].Value; coreTemperatures[i].Value = tjMax - tSlope * deltaT;
coreTemperatures[i].Value = tjMax - tSlope * deltaT; } else {
} else { coreTemperatures[i].Value = null;
coreTemperatures[i].Value = null;
}
} }
} }
if (packageTemperature != null) { if (packageTemperature != null) {
uint eax, edx; uint eax, edx;
if (Ring0.RdmsrTx( // if reading is valid
IA32_PACKAGE_THERM_STATUS, out eax, out edx, if (Ring0.RdmsrTx(IA32_PACKAGE_THERM_STATUS, out eax, out edx,
1UL << cpuid[0][0].Thread)) { 1UL << cpuid[0][0].Thread) && (eax & 0x80000000) != 0)
{
// get the dist from tjMax from bits 22:16 // get the dist from tjMax from bits 22:16
float deltaT = ((eax & 0x007F0000) >> 16); float deltaT = ((eax & 0x007F0000) >> 16);
float tjMax = packageTemperature.Parameters[0].Value; float tjMax = packageTemperature.Parameters[0].Value;

View File

@@ -10,5 +10,5 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("0.6.0.5")] [assembly: AssemblyVersion("0.6.0.6")]
[assembly: AssemblyInformationalVersion("0.6.0.5 Alpha")] [assembly: AssemblyInformationalVersion("0.6.0.6 Alpha")]