@@ -38,12 +38,16 @@ internal sealed class AMD10CPU : AMDCPU {
38
38
private const ushort FAMILY_15H_MODEL_00_MISC_CONTROL_DEVICE_ID = 0x1603 ;
39
39
private const ushort FAMILY_15H_MODEL_10_MISC_CONTROL_DEVICE_ID = 0x1403 ;
40
40
private const ushort FAMILY_15H_MODEL_30_MISC_CONTROL_DEVICE_ID = 0x141D ;
41
+ private const ushort FAMILY_15H_MODEL_60_MISC_CONTROL_DEVICE_ID = 0x1573 ;
41
42
private const ushort FAMILY_16H_MODEL_00_MISC_CONTROL_DEVICE_ID = 0x1533 ;
42
43
private const ushort FAMILY_16H_MODEL_30_MISC_CONTROL_DEVICE_ID = 0x1583 ;
44
+ private const ushort FAMILY_17H_MODEL_00_MISC_CONTROL_DEVICE_ID = 0x1577 ;
43
45
44
46
private const uint REPORTED_TEMPERATURE_CONTROL_REGISTER = 0xA4 ;
45
47
private const uint CLOCK_POWER_TIMING_CONTROL_0_REGISTER = 0xD4 ;
46
48
49
+ private const uint F15H_M60H_REPORTED_TEMP_CTRL_OFFSET = 0xD8200CA4 ;
50
+
47
51
private readonly uint miscellaneousControlAddress ;
48
52
private readonly ushort miscellaneousControlDeviceId ;
49
53
@@ -79,6 +83,8 @@ public AMD10CPU(int processorIndex, CPUID[][] cpuid, ISettings settings)
79
83
FAMILY_15H_MODEL_10_MISC_CONTROL_DEVICE_ID ; break ;
80
84
case 0x30 : miscellaneousControlDeviceId =
81
85
FAMILY_15H_MODEL_30_MISC_CONTROL_DEVICE_ID ; break ;
86
+ case 0x60 : miscellaneousControlDeviceId =
87
+ FAMILY_15H_MODEL_60_MISC_CONTROL_DEVICE_ID ; break ;
82
88
default : miscellaneousControlDeviceId = 0 ; break ;
83
89
} break ;
84
90
case 0x16 :
@@ -89,6 +95,8 @@ public AMD10CPU(int processorIndex, CPUID[][] cpuid, ISettings settings)
89
95
FAMILY_16H_MODEL_30_MISC_CONTROL_DEVICE_ID ; break ;
90
96
default : miscellaneousControlDeviceId = 0 ; break ;
91
97
} break ;
98
+ case 0x17 : miscellaneousControlDeviceId =
99
+ FAMILY_17H_MODEL_00_MISC_CONTROL_DEVICE_ID ; break ;
92
100
default : miscellaneousControlDeviceId = 0 ; break ;
93
101
}
94
102
@@ -136,8 +144,8 @@ public AMD10CPU(int processorIndex, CPUID[][] cpuid, ISettings settings)
136
144
137
145
// the file reader for lm-sensors support on Linux
138
146
temperatureStream = null ;
139
- int p = ( int ) Environment . OSVersion . Platform ;
140
- if ( ( p == 4 ) || ( p == 128 ) ) {
147
+
148
+ if ( Software . OperatingSystem . IsLinux ) {
141
149
string [ ] devicePaths = Directory . GetDirectories ( "/sys/class/hwmon/" ) ;
142
150
foreach ( string path in devicePaths ) {
143
151
string name = null ;
@@ -304,6 +312,15 @@ public override void Update() {
304
312
if ( temperatureStream == null ) {
305
313
if ( miscellaneousControlAddress != Ring0 . InvalidPciAddress ) {
306
314
uint value ;
315
+ if ( miscellaneousControlAddress == FAMILY_15H_MODEL_60_MISC_CONTROL_DEVICE_ID ) {
316
+ value = F15H_M60H_REPORTED_TEMP_CTRL_OFFSET ;
317
+ Ring0 . WritePciConfig ( Ring0 . GetPciAddress ( 0 , 0 , 0 ) , 0xB8 , value ) ;
318
+ Ring0 . ReadPciConfig ( Ring0 . GetPciAddress ( 0 , 0 , 0 ) , 0xBC , out value ) ;
319
+ coreTemperature . Value = ( ( value >> 21 ) & 0x7FF ) * 0.125f +
320
+ coreTemperature . Parameters [ 0 ] . Value ;
321
+ ActivateSensor ( coreTemperature ) ;
322
+ return ;
323
+ }
307
324
if ( Ring0 . ReadPciConfig ( miscellaneousControlAddress ,
308
325
REPORTED_TEMPERATURE_CONTROL_REGISTER , out value ) ) {
309
326
if ( family == 0x15 && ( value & 0x30000 ) == 0x30000 ) {
@@ -345,7 +362,7 @@ public override void Update() {
345
362
Thread . Sleep ( 1 ) ;
346
363
347
364
uint curEax , curEdx ;
348
- if ( Ring0 . Rdmsr ( COFVID_STATUS , out curEax , out curEdx , cpuid [ i ] [ 0 ] . Thread ) )
365
+ if ( Ring0 . Rdmsr ( COFVID_STATUS , out curEax , out curEdx , cpuid [ i ] [ 0 ] . Thread ) )
349
366
{
350
367
double multiplier ;
351
368
multiplier = GetCoreMultiplier ( curEax ) ;
0 commit comments