Fixed the Intel Sandy Bridge CPU core clock calculation.
authormoel.mich
Sat, 22 Jan 2011 17:58:32 +0000
changeset 250c19d56a0bcad
parent 249 3b5be5dce071
child 251 49c38a2958c8
Fixed the Intel Sandy Bridge CPU core clock calculation.
Hardware/CPU/IntelCPU.cs
Hardware/HDD/HDDGroup.cs
Properties/AssemblyVersion.cs
     1.1 --- a/Hardware/CPU/IntelCPU.cs	Fri Jan 21 21:41:14 2011 +0000
     1.2 +++ b/Hardware/CPU/IntelCPU.cs	Sat Jan 22 17:58:32 2011 +0000
     1.3 @@ -255,15 +255,21 @@
     1.4            {
     1.5              newBusClock = 
     1.6                TimeStampCounterFrequency / timeStampCounterMultiplier;
     1.7 -            if (microarchitecture == Microarchitecture.Nehalem ||
     1.8 -                microarchitecture == Microarchitecture.SandyBridge) 
     1.9 -            {
    1.10 -              uint multiplier = eax & 0xff;
    1.11 -              coreClocks[i].Value = (float)(multiplier * newBusClock);
    1.12 -            } else {
    1.13 -              double multiplier = ((eax >> 8) & 0x1f) + 0.5 * ((eax >> 14) & 1);
    1.14 -              coreClocks[i].Value = (float)(multiplier * newBusClock);
    1.15 -            }            
    1.16 +            switch (microarchitecture) {
    1.17 +              case Microarchitecture.Nehalem: {
    1.18 +                  uint multiplier = eax & 0xff;
    1.19 +                  coreClocks[i].Value = (float)(multiplier * newBusClock);
    1.20 +                } break;
    1.21 +              case Microarchitecture.SandyBridge: {
    1.22 +                  uint multiplier = (eax >> 8) & 0xff;
    1.23 +                  coreClocks[i].Value = (float)(multiplier * newBusClock);
    1.24 +                } break;
    1.25 +              default: {
    1.26 +                  double multiplier = 
    1.27 +                    ((eax >> 8) & 0x1f) + 0.5 * ((eax >> 14) & 1);
    1.28 +                  coreClocks[i].Value = (float)(multiplier * newBusClock);
    1.29 +                } break;
    1.30 +            }         
    1.31            } else { 
    1.32              // if IA32_PERF_STATUS is not available, assume TSC frequency
    1.33              coreClocks[i].Value = (float)TimeStampCounterFrequency;
     2.1 --- a/Hardware/HDD/HDDGroup.cs	Fri Jan 21 21:41:14 2011 +0000
     2.2 +++ b/Hardware/HDD/HDDGroup.cs	Sat Jan 22 17:58:32 2011 +0000
     2.3 @@ -193,23 +193,21 @@
     2.4          if (attributes.Length > 0) {
     2.5            r.AppendLine("Drive name: " + name);
     2.6            r.AppendLine();
     2.7 -          r.AppendFormat(CultureInfo.InvariantCulture, " {0}{1}{2}{3}{4}{5}",
     2.8 +          r.AppendFormat(CultureInfo.InvariantCulture, " {0}{1}{2}{3}{4}",
     2.9              ("ID").PadRight(6),
    2.10              ("RawValue").PadRight(20),
    2.11              ("WorstValue").PadRight(12),
    2.12              ("AttrValue").PadRight(12),
    2.13 -            ("Name"),
    2.14              Environment.NewLine);
    2.15  
    2.16            foreach (SMART.DriveAttribute a in attributes) {
    2.17              if (a.ID == SMART.AttributeID.None) continue;
    2.18              string raw = BitConverter.ToString(a.RawValue);
    2.19 -            r.AppendFormat(CultureInfo.InvariantCulture, " {0}{1}{2}{3}{4}{5}",
    2.20 +            r.AppendFormat(CultureInfo.InvariantCulture, " {0}{1}{2}{3}{4}",
    2.21                a.ID.ToString("d").PadRight(6), 
    2.22                raw.Replace("-", " ").PadRight(20),
    2.23                a.WorstValue.ToString(CultureInfo.InvariantCulture).PadRight(12),
    2.24                a.AttrValue.ToString(CultureInfo.InvariantCulture).PadRight(12),
    2.25 -              a.ID,
    2.26                Environment.NewLine);
    2.27            }
    2.28            r.AppendLine();
     3.1 --- a/Properties/AssemblyVersion.cs	Fri Jan 21 21:41:14 2011 +0000
     3.2 +++ b/Properties/AssemblyVersion.cs	Sat Jan 22 17:58:32 2011 +0000
     3.3 @@ -37,5 +37,5 @@
     3.4  
     3.5  using System.Reflection;
     3.6  
     3.7 -[assembly: AssemblyVersion("0.2.1.7")]
     3.8 -[assembly: AssemblyInformationalVersion("0.2.1.7 Alpha")]
     3.9 \ No newline at end of file
    3.10 +[assembly: AssemblyVersion("0.2.1.9")]
    3.11 +[assembly: AssemblyInformationalVersion("0.2.1.9 Alpha")]
    3.12 \ No newline at end of file