mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-09-02 15:25:22 +00:00
Fixed the initialization of the TSC estimating code.
This commit is contained in:
@@ -64,8 +64,6 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
|||||||
|
|
||||||
private double timeStampCounterMultiplier;
|
private double timeStampCounterMultiplier;
|
||||||
|
|
||||||
private StringBuilder debug = new StringBuilder();
|
|
||||||
|
|
||||||
public AMD10CPU(int processorIndex, CPUID[][] cpuid, ISettings settings)
|
public AMD10CPU(int processorIndex, CPUID[][] cpuid, ISettings settings)
|
||||||
: base(processorIndex, cpuid, settings)
|
: base(processorIndex, cpuid, settings)
|
||||||
{
|
{
|
||||||
@@ -180,9 +178,6 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
|||||||
CultureInfo.InvariantCulture));
|
CultureInfo.InvariantCulture));
|
||||||
r.AppendLine();
|
r.AppendLine();
|
||||||
|
|
||||||
r.Append(debug);
|
|
||||||
r.AppendLine();
|
|
||||||
|
|
||||||
return r.ToString();
|
return r.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -119,14 +119,24 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
|||||||
ActivateSensor(totalLoad);
|
ActivateSensor(totalLoad);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasTimeStampCounter)
|
if (hasTimeStampCounter) {
|
||||||
estimatedTimeStampCounterFrequency = EstimateTimeStampCounterFrequency();
|
estimatedTimeStampCounterFrequency =
|
||||||
else
|
EstimateTimeStampCounterFrequency();
|
||||||
estimatedTimeStampCounterFrequency = 0;
|
|
||||||
timeStampCounterFrequency = estimatedTimeStampCounterFrequency;
|
// set initial values
|
||||||
|
uint lsb, msb;
|
||||||
|
WinRing0.RdtscTx(out lsb, out msb, (UIntPtr)1);
|
||||||
|
lastTime = Stopwatch.GetTimestamp();
|
||||||
|
lastTimeStampCount = ((ulong)msb << 32) | lsb;
|
||||||
|
|
||||||
lastTimeStampCount = 0;
|
} else {
|
||||||
lastTime = 0;
|
estimatedTimeStampCounterFrequency = 0;
|
||||||
|
|
||||||
|
lastTime = 0;
|
||||||
|
lastTimeStampCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
timeStampCounterFrequency = estimatedTimeStampCounterFrequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static double EstimateTimeStampCounterFrequency() {
|
private static double EstimateTimeStampCounterFrequency() {
|
||||||
|
@@ -37,5 +37,5 @@
|
|||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("0.1.37.23")]
|
[assembly: AssemblyVersion("0.1.37.24")]
|
||||||
[assembly: AssemblyInformationalVersion("0.1.37.23 Alpha")]
|
[assembly: AssemblyInformationalVersion("0.1.37.24 Alpha")]
|
Reference in New Issue
Block a user