# HG changeset patch # User moel.mich # Date 1325537118 0 # Node ID 756af5ee409e42797eac7f476b15f8c54141d0f4 # Parent f837f9f0973e63feb3a54e710de52dd88febd1f9 Small corrections for AMD family 15h CPUs (based on documentation). diff -r f837f9f0973e -r 756af5ee409e Hardware/CPU/AMD10CPU.cs --- a/Hardware/CPU/AMD10CPU.cs Mon Jan 02 18:44:19 2012 +0000 +++ b/Hardware/CPU/AMD10CPU.cs Mon Jan 02 20:45:18 2012 +0000 @@ -246,42 +246,46 @@ private double GetCoreMultiplier(uint cofvidEax) { switch (family) { case 0x10: - case 0x11: - // 8:6 CpuDid: current core divisor ID - // 5:0 CpuFid: current core frequency ID - uint cpuDid = (cofvidEax >> 6) & 7; - uint cpuFid = cofvidEax & 0x1F; - return 0.5 * (cpuFid + 0x10) / (1 << (int)cpuDid); - case 0x12: - // 8:4 CpuFid: current CPU core frequency ID - // 3:0 CpuDid: current CPU core divisor ID - uint CpuFid = (cofvidEax >> 4) & 0x1F; - uint CpuDid = cofvidEax & 0xF; - double divisor; - switch (CpuDid) { - case 0: divisor = 1; break; - case 1: divisor = 1.5; break; - case 2: divisor = 2; break; - case 3: divisor = 3; break; - case 4: divisor = 4; break; - case 5: divisor = 6; break; - case 6: divisor = 8; break; - case 7: divisor = 12; break; - case 8: divisor = 16; break; - default: divisor = 1; break; + case 0x11: + case 0x15: { + // 8:6 CpuDid: current core divisor ID + // 5:0 CpuFid: current core frequency ID + uint cpuDid = (cofvidEax >> 6) & 7; + uint cpuFid = cofvidEax & 0x1F; + return 0.5 * (cpuFid + 0x10) / (1 << (int)cpuDid); } - return (CpuFid + 0x10) / divisor; - case 0x14: - // 8:4: current CPU core divisor ID most significant digit - // 3:0: current CPU core divisor ID least significant digit - uint divisorIdMSD = (cofvidEax >> 4) & 0x1F; - uint divisorIdLSD = cofvidEax & 0xF; - uint value = 0; - Ring0.ReadPciConfig(miscellaneousControlAddress, - CLOCK_POWER_TIMING_CONTROL_0_REGISTER, out value); - uint frequencyId = value & 0x1F; - return (frequencyId + 0x10) / - (divisorIdMSD + (divisorIdLSD * 0.25) + 1); + case 0x12: { + // 8:4 CpuFid: current CPU core frequency ID + // 3:0 CpuDid: current CPU core divisor ID + uint cpuFid = (cofvidEax >> 4) & 0x1F; + uint cpuDid = cofvidEax & 0xF; + double divisor; + switch (cpuDid) { + case 0: divisor = 1; break; + case 1: divisor = 1.5; break; + case 2: divisor = 2; break; + case 3: divisor = 3; break; + case 4: divisor = 4; break; + case 5: divisor = 6; break; + case 6: divisor = 8; break; + case 7: divisor = 12; break; + case 8: divisor = 16; break; + default: divisor = 1; break; + } + return (cpuFid + 0x10) / divisor; + } + case 0x14: { + // 8:4: current CPU core divisor ID most significant digit + // 3:0: current CPU core divisor ID least significant digit + uint divisorIdMSD = (cofvidEax >> 4) & 0x1F; + uint divisorIdLSD = cofvidEax & 0xF; + uint value = 0; + Ring0.ReadPciConfig(miscellaneousControlAddress, + CLOCK_POWER_TIMING_CONTROL_0_REGISTER, out value); + uint frequencyId = value & 0x1F; + return (frequencyId + 0x10) / + (divisorIdMSD + (divisorIdLSD * 0.25) + 1); + } default: return 1; } @@ -308,8 +312,13 @@ uint value; if (Ring0.ReadPciConfig(miscellaneousControlAddress, REPORTED_TEMPERATURE_CONTROL_REGISTER, out value)) { - coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f + - coreTemperature.Parameters[0].Value; + if (family == 0x15 && (value & 0x30000) == 0x30000) { + coreTemperature.Value = ((value >> 21) & 0x7FC) / 8.0f + + coreTemperature.Parameters[0].Value - 49; + } else { + coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f + + coreTemperature.Parameters[0].Value; + } ActivateSensor(coreTemperature); } else { DeactivateSensor(coreTemperature); diff -r f837f9f0973e -r 756af5ee409e Hardware/CPU/CPUID.cs --- a/Hardware/CPU/CPUID.cs Mon Jan 02 18:44:19 2012 +0000 +++ b/Hardware/CPU/CPUID.cs Mon Jan 02 20:45:18 2012 +0000 @@ -174,8 +174,11 @@ cpuBrandString = nameBuilder.ToString().Trim(); nameBuilder.Replace("(R)", " "); nameBuilder.Replace("(TM)", " "); - nameBuilder.Replace("(tm)", " "); + nameBuilder.Replace("(tm)", ""); nameBuilder.Replace("CPU", ""); + nameBuilder.Replace("Quad-Core Processor", ""); + nameBuilder.Replace("Six-Core Processor", ""); + nameBuilder.Replace("Eight-Core Processor", ""); for (int i = 0; i < 10; i++) nameBuilder.Replace(" ", " "); name = nameBuilder.ToString(); if (name.Contains("@")) diff -r f837f9f0973e -r 756af5ee409e Properties/AssemblyVersion.cs --- a/Properties/AssemblyVersion.cs Mon Jan 02 18:44:19 2012 +0000 +++ b/Properties/AssemblyVersion.cs Mon Jan 02 20:45:18 2012 +0000 @@ -37,5 +37,5 @@ using System.Reflection; -[assembly: AssemblyVersion("0.3.2.5")] -[assembly: AssemblyInformationalVersion("0.3.2.5 Alpha")] \ No newline at end of file +[assembly: AssemblyVersion("0.3.2.6")] +[assembly: AssemblyInformationalVersion("0.3.2.6 Alpha")] \ No newline at end of file