Added a processorIndex to CPU classes for multi CPU support.
1.1 --- a/Hardware/CPU/AMD0FCPU.cs Mon Apr 26 18:38:31 2010 +0000
1.2 +++ b/Hardware/CPU/AMD0FCPU.cs Mon Apr 26 18:51:22 2010 +0000
1.3 @@ -48,6 +48,7 @@
1.4 private string name;
1.5 private Image icon;
1.6
1.7 + private int processorIndex;
1.8 private uint pciAddress;
1.9
1.10 private Sensor[] coreTemperatures;
1.11 @@ -63,8 +64,9 @@
1.12 private const byte THERM_SENSE_CORE_SEL_CPU0 = 0x4;
1.13 private const byte THERM_SENSE_CORE_SEL_CPU1 = 0x0;
1.14
1.15 - public AMD0FCPU(CPUID[][] cpuid) {
1.16 + public AMD0FCPU(int processorIndex, CPUID[][] cpuid) {
1.17
1.18 + this.processorIndex = processorIndex;
1.19 this.name = cpuid[0][0].Name;
1.20 this.icon = Utilities.EmbeddedResources.GetImage("cpu.png");
1.21
1.22 @@ -110,7 +112,7 @@
1.23 }
1.24
1.25 pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID,
1.26 - PCI_AMD_0FH_MISCELLANEOUS_DEVICE_ID, 0);
1.27 + PCI_AMD_0FH_MISCELLANEOUS_DEVICE_ID, (byte)processorIndex);
1.28
1.29 Update();
1.30 }
1.31 @@ -120,7 +122,7 @@
1.32 }
1.33
1.34 public string Identifier {
1.35 - get { return "/amdcpu/0"; }
1.36 + get { return "/amdcpu/" + processorIndex; }
1.37 }
1.38
1.39 public Image Icon {
2.1 --- a/Hardware/CPU/AMD10CPU.cs Mon Apr 26 18:38:31 2010 +0000
2.2 +++ b/Hardware/CPU/AMD10CPU.cs Mon Apr 26 18:51:22 2010 +0000
2.3 @@ -47,6 +47,7 @@
2.4 private string name;
2.5 private Image icon;
2.6
2.7 + private int processorIndex;
2.8 private uint pciAddress;
2.9
2.10 private Sensor coreTemperature;
2.11 @@ -60,8 +61,9 @@
2.12 private const ushort PCI_AMD_11H_MISCELLANEOUS_DEVICE_ID = 0x1303;
2.13 private const uint REPORTED_TEMPERATURE_CONTROL_REGISTER = 0xA4;
2.14
2.15 - public AMD10CPU(CPUID[][] cpuid) {
2.16 + public AMD10CPU(int processorIndex, CPUID[][] cpuid) {
2.17
2.18 + this.processorIndex = processorIndex;
2.19 this.name = cpuid[0][0].Name;
2.20 this.icon = Utilities.EmbeddedResources.GetImage("cpu.png");
2.21
2.22 @@ -88,11 +90,11 @@
2.23 new ParameterDescription("Offset", "Temperature offset.", 0)
2.24 });
2.25
2.26 - pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID,
2.27 - PCI_AMD_10H_MISCELLANEOUS_DEVICE_ID, 0);
2.28 + pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID,
2.29 + PCI_AMD_10H_MISCELLANEOUS_DEVICE_ID, (byte)processorIndex);
2.30 if (pciAddress == 0xFFFFFFFF)
2.31 pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID,
2.32 - PCI_AMD_11H_MISCELLANEOUS_DEVICE_ID, 0);
2.33 + PCI_AMD_11H_MISCELLANEOUS_DEVICE_ID, (byte)processorIndex);
2.34
2.35 Update();
2.36 }
2.37 @@ -102,7 +104,7 @@
2.38 }
2.39
2.40 public string Identifier {
2.41 - get { return "/amdcpu/0"; }
2.42 + get { return "/amdcpu/" + processorIndex; }
2.43 }
2.44
2.45 public Image Icon {
3.1 --- a/Hardware/CPU/CPUGroup.cs Mon Apr 26 18:38:31 2010 +0000
3.2 +++ b/Hardware/CPU/CPUGroup.cs Mon Apr 26 18:51:22 2010 +0000
3.3 @@ -119,15 +119,15 @@
3.4
3.5 switch (threads[0].Vendor) {
3.6 case Vendor.Intel:
3.7 - hardware.Add(new IntelCPU(coreThreads));
3.8 + hardware.Add(new IntelCPU(index, coreThreads));
3.9 break;
3.10 case Vendor.AMD:
3.11 switch (threads[0].Family) {
3.12 case 0x0F:
3.13 - hardware.Add(new AMD0FCPU(coreThreads));
3.14 + hardware.Add(new AMD0FCPU(index, coreThreads));
3.15 break;
3.16 case 0x10:
3.17 - hardware.Add(new AMD10CPU(coreThreads));
3.18 + hardware.Add(new AMD10CPU(index, coreThreads));
3.19 break;
3.20 default:
3.21 break;
4.1 --- a/Hardware/CPU/IntelCPU.cs Mon Apr 26 18:38:31 2010 +0000
4.2 +++ b/Hardware/CPU/IntelCPU.cs Mon Apr 26 18:51:22 2010 +0000
4.3 @@ -48,6 +48,7 @@
4.4 namespace OpenHardwareMonitor.Hardware.CPU {
4.5 public class IntelCPU : Hardware, IHardware {
4.6
4.7 + private int processorIndex;
4.8 private CPUID[][] cpuid;
4.9 private int coreCount;
4.10
4.11 @@ -93,8 +94,9 @@
4.12 return result;
4.13 }
4.14
4.15 - public IntelCPU(CPUID[][] cpuid) {
4.16 + public IntelCPU(int processorIndex, CPUID[][] cpuid) {
4.17
4.18 + this.processorIndex = processorIndex;
4.19 this.cpuid = cpuid;
4.20 this.coreCount = cpuid.Length;
4.21 this.name = cpuid[0][0].Name;
4.22 @@ -236,7 +238,7 @@
4.23 }
4.24
4.25 public string Identifier {
4.26 - get { return "/intelcpu/0"; }
4.27 + get { return "/intelcpu/" + processorIndex; }
4.28 }
4.29
4.30 public Image Icon {