# HG changeset patch # User moel.mich # Date 1295719112 0 # Node ID c19d56a0bcad2bb4b5e194783b3308afab73930a # Parent 3b5be5dce071a5f50ae35671969b98f3035ddda9 Fixed the Intel Sandy Bridge CPU core clock calculation. diff -r 3b5be5dce071 -r c19d56a0bcad Hardware/CPU/IntelCPU.cs --- a/Hardware/CPU/IntelCPU.cs Fri Jan 21 21:41:14 2011 +0000 +++ b/Hardware/CPU/IntelCPU.cs Sat Jan 22 17:58:32 2011 +0000 @@ -255,15 +255,21 @@ { newBusClock = TimeStampCounterFrequency / timeStampCounterMultiplier; - if (microarchitecture == Microarchitecture.Nehalem || - microarchitecture == Microarchitecture.SandyBridge) - { - uint multiplier = eax & 0xff; - coreClocks[i].Value = (float)(multiplier * newBusClock); - } else { - double multiplier = ((eax >> 8) & 0x1f) + 0.5 * ((eax >> 14) & 1); - coreClocks[i].Value = (float)(multiplier * newBusClock); - } + switch (microarchitecture) { + case Microarchitecture.Nehalem: { + uint multiplier = eax & 0xff; + coreClocks[i].Value = (float)(multiplier * newBusClock); + } break; + case Microarchitecture.SandyBridge: { + uint multiplier = (eax >> 8) & 0xff; + coreClocks[i].Value = (float)(multiplier * newBusClock); + } break; + default: { + double multiplier = + ((eax >> 8) & 0x1f) + 0.5 * ((eax >> 14) & 1); + coreClocks[i].Value = (float)(multiplier * newBusClock); + } break; + } } else { // if IA32_PERF_STATUS is not available, assume TSC frequency coreClocks[i].Value = (float)TimeStampCounterFrequency; diff -r 3b5be5dce071 -r c19d56a0bcad Hardware/HDD/HDDGroup.cs --- a/Hardware/HDD/HDDGroup.cs Fri Jan 21 21:41:14 2011 +0000 +++ b/Hardware/HDD/HDDGroup.cs Sat Jan 22 17:58:32 2011 +0000 @@ -193,23 +193,21 @@ if (attributes.Length > 0) { r.AppendLine("Drive name: " + name); r.AppendLine(); - r.AppendFormat(CultureInfo.InvariantCulture, " {0}{1}{2}{3}{4}{5}", + r.AppendFormat(CultureInfo.InvariantCulture, " {0}{1}{2}{3}{4}", ("ID").PadRight(6), ("RawValue").PadRight(20), ("WorstValue").PadRight(12), ("AttrValue").PadRight(12), - ("Name"), Environment.NewLine); foreach (SMART.DriveAttribute a in attributes) { if (a.ID == SMART.AttributeID.None) continue; string raw = BitConverter.ToString(a.RawValue); - r.AppendFormat(CultureInfo.InvariantCulture, " {0}{1}{2}{3}{4}{5}", + r.AppendFormat(CultureInfo.InvariantCulture, " {0}{1}{2}{3}{4}", a.ID.ToString("d").PadRight(6), raw.Replace("-", " ").PadRight(20), a.WorstValue.ToString(CultureInfo.InvariantCulture).PadRight(12), a.AttrValue.ToString(CultureInfo.InvariantCulture).PadRight(12), - a.ID, Environment.NewLine); } r.AppendLine(); diff -r 3b5be5dce071 -r c19d56a0bcad Properties/AssemblyVersion.cs --- a/Properties/AssemblyVersion.cs Fri Jan 21 21:41:14 2011 +0000 +++ b/Properties/AssemblyVersion.cs Sat Jan 22 17:58:32 2011 +0000 @@ -37,5 +37,5 @@ using System.Reflection; -[assembly: AssemblyVersion("0.2.1.7")] -[assembly: AssemblyInformationalVersion("0.2.1.7 Alpha")] \ No newline at end of file +[assembly: AssemblyVersion("0.2.1.9")] +[assembly: AssemblyInformationalVersion("0.2.1.9 Alpha")] \ No newline at end of file