Added support for AMD family 11h CPUs.

This commit is contained in:
Michael Möller
2011-01-27 22:29:43 +00:00
parent 1915002fa9
commit 4d4c3aae8d
3 changed files with 16 additions and 5 deletions

View File

@@ -57,26 +57,36 @@ namespace OpenHardwareMonitor.Hardware.CPU {
private const uint COFVID_STATUS = 0xC0010071; private const uint COFVID_STATUS = 0xC0010071;
private const byte MISCELLANEOUS_CONTROL_FUNCTION = 3; private const byte MISCELLANEOUS_CONTROL_FUNCTION = 3;
private const ushort MISCELLANEOUS_CONTROL_DEVICE_ID = 0x1203; private const ushort FAMILY_10H_MISCELLANEOUS_CONTROL_DEVICE_ID = 0x1203;
private const ushort FAMILY_11H_MISCELLANEOUS_CONTROL_DEVICE_ID = 0x1303;
private const uint REPORTED_TEMPERATURE_CONTROL_REGISTER = 0xA4; private const uint REPORTED_TEMPERATURE_CONTROL_REGISTER = 0xA4;
private readonly uint miscellaneousControlAddress; private readonly uint miscellaneousControlAddress;
private readonly ushort miscellaneousControlDeviceId;
private double timeStampCounterMultiplier; private double timeStampCounterMultiplier;
public AMD10CPU(int processorIndex, CPUID[][] cpuid, ISettings settings) public AMD10CPU(int processorIndex, CPUID[][] cpuid, ISettings settings)
: base(processorIndex, cpuid, settings) : base(processorIndex, cpuid, settings)
{ {
// AMD family 10h processors support only one temperature sensor // AMD family 10h/11h processors support only one temperature sensor
coreTemperature = new Sensor( coreTemperature = new Sensor(
"Core" + (coreCount > 1 ? " #1 - #" + coreCount : ""), 0, "Core" + (coreCount > 1 ? " #1 - #" + coreCount : ""), 0,
SensorType.Temperature, this, new [] { SensorType.Temperature, this, new [] {
new ParameterDescription("Offset [°C]", "Temperature offset.", 0) new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
}, settings); }, settings);
switch (family) {
case 0x10: miscellaneousControlDeviceId =
FAMILY_10H_MISCELLANEOUS_CONTROL_DEVICE_ID; break;
case 0x11: miscellaneousControlDeviceId =
FAMILY_11H_MISCELLANEOUS_CONTROL_DEVICE_ID; break;
default: miscellaneousControlDeviceId = 0; break;
}
// get the pci address for the Miscellaneous Control registers // get the pci address for the Miscellaneous Control registers
miscellaneousControlAddress = GetPciAddress( miscellaneousControlAddress = GetPciAddress(
MISCELLANEOUS_CONTROL_FUNCTION, MISCELLANEOUS_CONTROL_DEVICE_ID); MISCELLANEOUS_CONTROL_FUNCTION, miscellaneousControlDeviceId);
busClock = new Sensor("Bus Speed", 0, SensorType.Clock, this, settings); busClock = new Sensor("Bus Speed", 0, SensorType.Clock, this, settings);
coreClocks = new Sensor[coreCount]; coreClocks = new Sensor[coreCount];

View File

@@ -124,6 +124,7 @@ namespace OpenHardwareMonitor.Hardware.CPU {
hardware.Add(new AMD0FCPU(index, coreThreads, settings)); hardware.Add(new AMD0FCPU(index, coreThreads, settings));
break; break;
case 0x10: case 0x10:
case 0x11:
hardware.Add(new AMD10CPU(index, coreThreads, settings)); hardware.Add(new AMD10CPU(index, coreThreads, settings));
break; break;
default: default:

View File

@@ -37,5 +37,5 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("0.2.1.9")] [assembly: AssemblyVersion("0.2.1.10")]
[assembly: AssemblyInformationalVersion("0.2.1.9 Alpha")] [assembly: AssemblyInformationalVersion("0.2.1.10 Alpha")]