Added thermal and voltage/frequency MSRs for K8 CPUs, fixed chars-per-line limit
authorpaulwerelds
Tue, 21 Sep 2010 10:18:07 +0000
changeset 19352ef1cf6b8e5
parent 192 ad190510cddd
child 194 fbf22ccd9d6f
Added thermal and voltage/frequency MSRs for K8 CPUs, fixed chars-per-line limit
Hardware/CPU/AMD0FCPU.cs
     1.1 --- a/Hardware/CPU/AMD0FCPU.cs	Tue Sep 21 09:12:32 2010 +0000
     1.2 +++ b/Hardware/CPU/AMD0FCPU.cs	Tue Sep 21 10:18:07 2010 +0000
     1.3 @@ -87,7 +87,8 @@
     1.4        busClock = new Sensor("Bus Speed", 0, SensorType.Clock, this, settings);
     1.5        coreClocks = new Sensor[coreCount];
     1.6        for (int i = 0; i < coreClocks.Length; i++) {
     1.7 -        coreClocks[i] = new Sensor(CoreString(i), i + 1, SensorType.Clock, this, settings);
     1.8 +        coreClocks[i] = new Sensor(CoreString(i), i + 1, SensorType.Clock,
     1.9 +          this, settings);
    1.10          if (hasTSC)
    1.11            ActivateSensor(coreClocks[i]);
    1.12        }
    1.13 @@ -96,7 +97,12 @@
    1.14      }
    1.15  
    1.16      protected override uint[] GetMSRs() {
    1.17 -      return new uint[] { };
    1.18 +      return new uint[] {
    1.19 +        FIDVID_STATUS,
    1.20 +        THERMTRIP_STATUS_REGISTER,
    1.21 +        THERM_SENSE_CORE_SEL_CPU0,
    1.22 +        THERM_SENSE_CORE_SEL_CPU1
    1.23 +      };
    1.24      }
    1.25  
    1.26      public override void Update() {
    1.27 @@ -126,10 +132,12 @@
    1.28          for (int i = 0; i < coreClocks.Length; i++) {
    1.29            Thread.Sleep(1);
    1.30  
    1.31 -          coreClocks[i].Value = (float)MaxClock; // Fail-safe value - if the code below fails, we'll use this instead
    1.32 +          // Fail-safe value - if the code below fails, we'll use this instead
    1.33 +          coreClocks[i].Value = (float)MaxClock;
    1.34  
    1.35            uint eax, edx;
    1.36 -          if (WinRing0.RdmsrTx(FIDVID_STATUS, out eax, out edx, (UIntPtr)(1L << cpuid[i][0].Thread))) {
    1.37 +          if (WinRing0.RdmsrTx(FIDVID_STATUS, out eax, out edx,
    1.38 +            (UIntPtr)(1L << cpuid[i][0].Thread))) {
    1.39              // CurrFID can be found in eax bits 0-5, MaxFID in 16-21
    1.40              // 8-13 hold StartFID, we don't use that here.
    1.41              double curMP = 0.5 * ((eax & 0x3F) + 8);