public AMD10CPU(int processorIndex, CPUID[][] cpuid) { this.processorIndex = processorIndex; this.name = cpuid[0][0].Name; this.icon = Utilities.EmbeddedResources.GetImage("cpu.png"); int coreCount = cpuid.Length; totalLoad = new Sensor("CPU Total", 0, SensorType.Load, this); coreLoads = new Sensor[coreCount]; for (int i = 0; i < coreCount; i++) { coreLoads[i] = new Sensor("Core #" + (i + 1), i + 1, SensorType.Load, this); } cpuLoad = new CPULoad(cpuid); if (cpuLoad.IsAvailable) { foreach (Sensor sensor in coreLoads) { ActivateSensor(sensor); } ActivateSensor(totalLoad); } // AMD family 10h processors support only one temperature sensor coreTemperature = new Sensor( "Core" + (coreCount > 1 ? " #1 - #" + coreCount : ""), 0, null, SensorType.Temperature, this, new ParameterDescription[] { new ParameterDescription("Offset", "Temperature offset.", 0) }); pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID, PCI_AMD_10H_MISCELLANEOUS_DEVICE_ID, (byte)processorIndex); if (pciAddress == 0xFFFFFFFF) { pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID, PCI_AMD_11H_MISCELLANEOUS_DEVICE_ID, (byte)processorIndex); } Update(); }
public AMD10CPU(string name, uint family, uint model, uint stepping, uint[,] cpuidData, uint[,] cpuidExtData) { this.name = name; this.icon = Utilities.EmbeddedResources.GetImage("cpu.png"); uint coreCount = 1; if (cpuidExtData.GetLength(0) > 8) { coreCount = (cpuidExtData[8, 2] & 0xFF) + 1; } totalLoad = new Sensor("CPU Total", 0, SensorType.Load, this); coreLoads = new Sensor[coreCount]; for (int i = 0; i < coreCount; i++) { coreLoads[i] = new Sensor("Core #" + (i + 1), i + 1, SensorType.Load, this); } cpuLoad = new CPULoad(coreCount, 1); if (cpuLoad.IsAvailable) { foreach (Sensor sensor in coreLoads) { ActivateSensor(sensor); } ActivateSensor(totalLoad); } // AMD family 10h processors support only one temperature sensor coreTemperature = new Sensor( "Core" + (coreCount > 1 ? " #1 - #" + coreCount : ""), 0, SensorType.Temperature, this); pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID, PCI_AMD_10H_MISCELLANEOUS_DEVICE_ID, 0); Update(); }
public AMD0FCPU(int processorIndex, CPUID[][] cpuid) { this.processorIndex = processorIndex; this.name = cpuid[0][0].Name; this.icon = Utilities.EmbeddedResources.GetImage("cpu.png"); int coreCount = cpuid.Length; totalLoad = new Sensor("CPU Total", 0, SensorType.Load, this); float offset = -49.0f; // AM2+ 65nm +21 offset uint model = cpuid[0][0].Model; if (model >= 0x69 && model != 0xc1 && model != 0x6c && model != 0x7c) { offset += 21; } // check if processor supports a digital thermal sensor if (cpuid[0][0].ExtData.GetLength(0) > 7 && (cpuid[0][0].ExtData[7, 3] & 1) != 0) { coreTemperatures = new Sensor[coreCount]; for (int i = 0; i < coreCount; i++) { coreTemperatures[i] = new Sensor("Core #" + (i + 1), i, null, SensorType.Temperature, this, new ParameterDescription[] { new ParameterDescription("Offset [°C]", "Temperature offset of the thermal sensor.\n" + "Temperature = Value + Offset.", offset) }); } } else { coreTemperatures = new Sensor[0]; } coreLoads = new Sensor[coreCount]; for (int i = 0; i < coreCount; i++) { coreLoads[i] = new Sensor("Core #" + (i + 1), i + 1, SensorType.Load, this); } cpuLoad = new CPULoad(cpuid); if (cpuLoad.IsAvailable) { foreach (Sensor sensor in coreLoads) { ActivateSensor(sensor); } ActivateSensor(totalLoad); } pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID, PCI_AMD_0FH_MISCELLANEOUS_DEVICE_ID, (byte)processorIndex); Update(); }