mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-09-04 00:05:27 +00:00
Added support for AMD 10h core temperature sensors and Asus ATK0110 devices on Linux.
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Michael Möller <m.moeller@gmx.ch>.
|
Michael Möller <m.moeller@gmx.ch>.
|
||||||
Portions created by the Initial Developer are Copyright (C) 2009-2010
|
Portions created by the Initial Developer are Copyright (C) 2009-2011
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -42,6 +42,7 @@ using System.Globalization;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace OpenHardwareMonitor.Hardware.CPU {
|
namespace OpenHardwareMonitor.Hardware.CPU {
|
||||||
|
|
||||||
@@ -64,6 +65,8 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
|||||||
private readonly uint miscellaneousControlAddress;
|
private readonly uint miscellaneousControlAddress;
|
||||||
private readonly ushort miscellaneousControlDeviceId;
|
private readonly ushort miscellaneousControlDeviceId;
|
||||||
|
|
||||||
|
private readonly StreamReader temperatureReader;
|
||||||
|
|
||||||
private double timeStampCounterMultiplier;
|
private double timeStampCounterMultiplier;
|
||||||
|
|
||||||
public AMD10CPU(int processorIndex, CPUID[][] cpuid, ISettings settings)
|
public AMD10CPU(int processorIndex, CPUID[][] cpuid, ISettings settings)
|
||||||
@@ -114,6 +117,25 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
|||||||
// restore the thread affinity.
|
// restore the thread affinity.
|
||||||
ThreadAffinity.Set(mask);
|
ThreadAffinity.Set(mask);
|
||||||
|
|
||||||
|
// the file reader for lm-sensors support on Linux
|
||||||
|
temperatureReader = null;
|
||||||
|
int p = (int)Environment.OSVersion.Platform;
|
||||||
|
if ((p == 4) || (p == 128)) {
|
||||||
|
string[] devicePaths = Directory.GetDirectories("/sys/class/hwmon/");
|
||||||
|
foreach (string path in devicePaths) {
|
||||||
|
string name = null;
|
||||||
|
try {
|
||||||
|
using (StreamReader reader = new StreamReader(path + "/device/name"))
|
||||||
|
name = reader.ReadLine();
|
||||||
|
} catch (IOException) { }
|
||||||
|
switch (name) {
|
||||||
|
case "k10temp":
|
||||||
|
temperatureReader = new StreamReader(path + "/device/temp1_input");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,16 +218,28 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
|||||||
public override void Update() {
|
public override void Update() {
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
if (miscellaneousControlAddress != Ring0.InvalidPciAddress) {
|
if (temperatureReader == null) {
|
||||||
uint value;
|
if (miscellaneousControlAddress != Ring0.InvalidPciAddress) {
|
||||||
if (Ring0.ReadPciConfig(miscellaneousControlAddress,
|
uint value;
|
||||||
REPORTED_TEMPERATURE_CONTROL_REGISTER, out value)) {
|
if (Ring0.ReadPciConfig(miscellaneousControlAddress,
|
||||||
coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f +
|
REPORTED_TEMPERATURE_CONTROL_REGISTER, out value)) {
|
||||||
coreTemperature.Parameters[0].Value;
|
coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f +
|
||||||
ActivateSensor(coreTemperature);
|
coreTemperature.Parameters[0].Value;
|
||||||
} else {
|
ActivateSensor(coreTemperature);
|
||||||
DeactivateSensor(coreTemperature);
|
} else {
|
||||||
|
DeactivateSensor(coreTemperature);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
temperatureReader.BaseStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
string s = temperatureReader.ReadLine();
|
||||||
|
try {
|
||||||
|
coreTemperature.Value = 0.001f *
|
||||||
|
long.Parse(s, CultureInfo.InvariantCulture);
|
||||||
|
ActivateSensor(coreTemperature);
|
||||||
|
} catch {
|
||||||
|
DeactivateSensor(coreTemperature);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasTimeStampCounter) {
|
if (HasTimeStampCounter) {
|
||||||
@@ -240,5 +274,11 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Close() {
|
||||||
|
if (temperatureReader != null) {
|
||||||
|
temperatureReader.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Michael Möller <m.moeller@gmx.ch>.
|
Michael Möller <m.moeller@gmx.ch>.
|
||||||
Portions created by the Initial Developer are Copyright (C) 2009-2010
|
Portions created by the Initial Developer are Copyright (C) 2009-2011
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -42,8 +42,8 @@ using System.Text;
|
|||||||
|
|
||||||
namespace OpenHardwareMonitor.Hardware.CPU {
|
namespace OpenHardwareMonitor.Hardware.CPU {
|
||||||
|
|
||||||
internal class CPUGroup : IGroup {
|
internal class CPUGroup : IGroup {
|
||||||
private readonly List<IHardware> hardware = new List<IHardware>();
|
private readonly List<GenericCPU> hardware = new List<GenericCPU>();
|
||||||
|
|
||||||
private readonly CPUID[][][] threads;
|
private readonly CPUID[][][] threads;
|
||||||
|
|
||||||
@@ -207,6 +207,10 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
|||||||
return r.ToString();
|
return r.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close() { }
|
public void Close() {
|
||||||
|
foreach (GenericCPU cpu in hardware) {
|
||||||
|
cpu.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Michael Möller <m.moeller@gmx.ch>.
|
Michael Möller <m.moeller@gmx.ch>.
|
||||||
Portions created by the Initial Developer are Copyright (C) 2010
|
Portions created by the Initial Developer are Copyright (C) 2010-2011
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -305,5 +305,9 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
|||||||
totalLoad.Value = cpuLoad.GetTotalLoad();
|
totalLoad.Value = cpuLoad.GetTotalLoad();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void Close() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -39,12 +39,26 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
|||||||
|
|
||||||
internal enum Chip : ushort {
|
internal enum Chip : ushort {
|
||||||
Unknown = 0,
|
Unknown = 0,
|
||||||
|
|
||||||
|
ATK0110 = 0x0110,
|
||||||
|
|
||||||
|
F71858 = 0x0507,
|
||||||
|
F71862 = 0x0601,
|
||||||
|
F71869 = 0x0814,
|
||||||
|
F71882 = 0x0541,
|
||||||
|
F71889ED = 0x0909,
|
||||||
|
F71889F = 0x0723,
|
||||||
|
|
||||||
IT8712F = 0x8712,
|
IT8712F = 0x8712,
|
||||||
IT8716F = 0x8716,
|
IT8716F = 0x8716,
|
||||||
IT8718F = 0x8718,
|
IT8718F = 0x8718,
|
||||||
IT8720F = 0x8720,
|
IT8720F = 0x8720,
|
||||||
IT8721F = 0x8721,
|
IT8721F = 0x8721,
|
||||||
IT8726F = 0x8726,
|
IT8726F = 0x8726,
|
||||||
|
|
||||||
|
NCT6771F = 0xB470,
|
||||||
|
NCT6776F = 0xC330,
|
||||||
|
|
||||||
W83627DHG = 0xA020,
|
W83627DHG = 0xA020,
|
||||||
W83627DHGP = 0xB070,
|
W83627DHGP = 0xB070,
|
||||||
W83627EHF = 0x8800,
|
W83627EHF = 0x8800,
|
||||||
@@ -52,15 +66,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
|||||||
W83627THF = 0x8280,
|
W83627THF = 0x8280,
|
||||||
W83667HG = 0xA510,
|
W83667HG = 0xA510,
|
||||||
W83667HGB = 0xB350,
|
W83667HGB = 0xB350,
|
||||||
W83687THF = 0x8541,
|
W83687THF = 0x8541
|
||||||
NCT6771F = 0xB470,
|
|
||||||
NCT6776F = 0xC330,
|
|
||||||
F71858 = 0x0507,
|
|
||||||
F71862 = 0x0601,
|
|
||||||
F71869 = 0x0814,
|
|
||||||
F71882 = 0x0541,
|
|
||||||
F71889ED = 0x0909,
|
|
||||||
F71889F = 0x0723
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class ChipName {
|
internal class ChipName {
|
||||||
@@ -69,18 +75,25 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
|||||||
|
|
||||||
public static string GetName(Chip chip) {
|
public static string GetName(Chip chip) {
|
||||||
switch (chip) {
|
switch (chip) {
|
||||||
|
case Chip.ATK0110: return "Asus ATK0110";
|
||||||
|
|
||||||
case Chip.F71858: return "Fintek F71858";
|
case Chip.F71858: return "Fintek F71858";
|
||||||
case Chip.F71862: return "Fintek F71862";
|
case Chip.F71862: return "Fintek F71862";
|
||||||
case Chip.F71869: return "Fintek F71869";
|
case Chip.F71869: return "Fintek F71869";
|
||||||
case Chip.F71882: return "Fintek F71882";
|
case Chip.F71882: return "Fintek F71882";
|
||||||
case Chip.F71889ED: return "Fintek F71889ED";
|
case Chip.F71889ED: return "Fintek F71889ED";
|
||||||
case Chip.F71889F: return "Fintek F71889F";
|
case Chip.F71889F: return "Fintek F71889F";
|
||||||
|
|
||||||
case Chip.IT8712F: return "ITE IT8712F";
|
case Chip.IT8712F: return "ITE IT8712F";
|
||||||
case Chip.IT8716F: return "ITE IT8716F";
|
case Chip.IT8716F: return "ITE IT8716F";
|
||||||
case Chip.IT8718F: return "ITE IT8718F";
|
case Chip.IT8718F: return "ITE IT8718F";
|
||||||
case Chip.IT8721F: return "ITE IT8721F";
|
case Chip.IT8721F: return "ITE IT8721F";
|
||||||
case Chip.IT8720F: return "ITE IT8720F";
|
case Chip.IT8720F: return "ITE IT8720F";
|
||||||
case Chip.IT8726F: return "ITE IT8726F";
|
case Chip.IT8726F: return "ITE IT8726F";
|
||||||
|
|
||||||
|
case Chip.NCT6771F: return "Nuvoton NCT6771F";
|
||||||
|
case Chip.NCT6776F: return "Nuvoton NCT6776F";
|
||||||
|
|
||||||
case Chip.W83627DHG: return "Winbond W83627DHG";
|
case Chip.W83627DHG: return "Winbond W83627DHG";
|
||||||
case Chip.W83627DHGP: return "Winbond W83627DHG-P";
|
case Chip.W83627DHGP: return "Winbond W83627DHG-P";
|
||||||
case Chip.W83627EHF: return "Winbond W83627EHF";
|
case Chip.W83627EHF: return "Winbond W83627EHF";
|
||||||
@@ -89,8 +102,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
|||||||
case Chip.W83667HG: return "Winbond W83667HG";
|
case Chip.W83667HG: return "Winbond W83667HG";
|
||||||
case Chip.W83667HGB: return "Winbond W83667HG-B";
|
case Chip.W83667HGB: return "Winbond W83667HG-B";
|
||||||
case Chip.W83687THF: return "Winbond W83687THF";
|
case Chip.W83687THF: return "Winbond W83687THF";
|
||||||
case Chip.NCT6771F: return "Nuvoton NCT6771F";
|
|
||||||
case Chip.NCT6776F: return "Nuvoton NCT6776F";
|
|
||||||
case Chip.Unknown: return "Unkown";
|
case Chip.Unknown: return "Unkown";
|
||||||
default: return "Unknown";
|
default: return "Unknown";
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Michael Möller <m.moeller@gmx.ch>.
|
Michael Möller <m.moeller@gmx.ch>.
|
||||||
Portions created by the Initial Developer are Copyright (C) 2009-2010
|
Portions created by the Initial Developer are Copyright (C) 2009-2011
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -46,44 +46,52 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
|||||||
private readonly List<LMChip> lmChips = new List<LMChip>();
|
private readonly List<LMChip> lmChips = new List<LMChip>();
|
||||||
|
|
||||||
public LMSensors() {
|
public LMSensors() {
|
||||||
string[] devicePaths = Directory.GetDirectories("/sys/class/hwmon/");
|
string[] basePaths = Directory.GetDirectories("/sys/class/hwmon/");
|
||||||
foreach (string path in devicePaths) {
|
foreach (string basePath in basePaths) {
|
||||||
string name = null;
|
foreach (string devicePath in new[] { "/device", "" }) {
|
||||||
try {
|
string path = basePath + devicePath;
|
||||||
using (StreamReader reader = new StreamReader(path + "/device/name"))
|
|
||||||
name = reader.ReadLine();
|
|
||||||
} catch (IOException) { }
|
|
||||||
switch (name) {
|
|
||||||
case "f71858fg":
|
|
||||||
lmChips.Add(new LMChip(Chip.F71858, path + "/device")); break;
|
|
||||||
case "f71862fg":
|
|
||||||
lmChips.Add(new LMChip(Chip.F71862, path + "/device")); break;
|
|
||||||
case "f71882fg":
|
|
||||||
lmChips.Add(new LMChip(Chip.F71882, path + "/device")); break;
|
|
||||||
case "f71889fg":
|
|
||||||
lmChips.Add(new LMChip(Chip.F71889F, path + "/device")); break;
|
|
||||||
|
|
||||||
case "it8712":
|
string name = null;
|
||||||
lmChips.Add(new LMChip(Chip.IT8712F, path + "/device")); break;
|
try {
|
||||||
case "it8716":
|
using (StreamReader reader = new StreamReader(path + "/name"))
|
||||||
lmChips.Add(new LMChip(Chip.IT8716F, path + "/device")); break;
|
name = reader.ReadLine();
|
||||||
case "it8718":
|
} catch (IOException) { }
|
||||||
lmChips.Add(new LMChip(Chip.IT8718F, path + "/device")); break;
|
|
||||||
case "it8720":
|
|
||||||
lmChips.Add(new LMChip(Chip.IT8720F, path + "/device")); break;
|
|
||||||
|
|
||||||
case "w83627ehf":
|
switch (name) {
|
||||||
lmChips.Add(new LMChip(Chip.W83627EHF, path + "/device")); break;
|
case "atk0110":
|
||||||
case "w83627dhg":
|
lmChips.Add(new LMChip(Chip.ATK0110, path)); break;
|
||||||
lmChips.Add(new LMChip(Chip.W83627DHG, path + "/device")); break;
|
|
||||||
case "w83667hg":
|
case "f71858fg":
|
||||||
lmChips.Add(new LMChip(Chip.W83667HG, path + "/device")); break;
|
lmChips.Add(new LMChip(Chip.F71858, path)); break;
|
||||||
case "w83627hf":
|
case "f71862fg":
|
||||||
lmChips.Add(new LMChip(Chip.W83627HF, path + "/device")); break;
|
lmChips.Add(new LMChip(Chip.F71862, path)); break;
|
||||||
case "w83627thf":
|
case "f71882fg":
|
||||||
lmChips.Add(new LMChip(Chip.W83627THF, path + "/device")); break;
|
lmChips.Add(new LMChip(Chip.F71882, path)); break;
|
||||||
case "w83687thf":
|
case "f71889fg":
|
||||||
lmChips.Add(new LMChip(Chip.W83687THF, path + "/device")); break;
|
lmChips.Add(new LMChip(Chip.F71889F, path)); break;
|
||||||
|
|
||||||
|
case "it8712":
|
||||||
|
lmChips.Add(new LMChip(Chip.IT8712F, path)); break;
|
||||||
|
case "it8716":
|
||||||
|
lmChips.Add(new LMChip(Chip.IT8716F, path)); break;
|
||||||
|
case "it8718":
|
||||||
|
lmChips.Add(new LMChip(Chip.IT8718F, path)); break;
|
||||||
|
case "it8720":
|
||||||
|
lmChips.Add(new LMChip(Chip.IT8720F, path)); break;
|
||||||
|
|
||||||
|
case "w83627ehf":
|
||||||
|
lmChips.Add(new LMChip(Chip.W83627EHF, path)); break;
|
||||||
|
case "w83627dhg":
|
||||||
|
lmChips.Add(new LMChip(Chip.W83627DHG, path)); break;
|
||||||
|
case "w83667hg":
|
||||||
|
lmChips.Add(new LMChip(Chip.W83667HG, path)); break;
|
||||||
|
case "w83627hf":
|
||||||
|
lmChips.Add(new LMChip(Chip.W83627HF, path)); break;
|
||||||
|
case "w83627thf":
|
||||||
|
lmChips.Add(new LMChip(Chip.W83627THF, path)); break;
|
||||||
|
case "w83687thf":
|
||||||
|
lmChips.Add(new LMChip(Chip.W83687THF, path)); break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -37,5 +37,5 @@
|
|||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("0.2.1.14")]
|
[assembly: AssemblyVersion("0.2.1.16")]
|
||||||
[assembly: AssemblyInformationalVersion("0.2.1.14 Alpha")]
|
[assembly: AssemblyInformationalVersion("0.2.1.16 Alpha")]
|
Reference in New Issue
Block a user