Hardware/CPU/CPUID.cs
changeset 195 0ee888c485d5
parent 182 4801e9eaf979
child 236 763675f19ff4
     1.1 --- a/Hardware/CPU/CPUID.cs	Tue Sep 21 10:33:28 2010 +0000
     1.2 +++ b/Hardware/CPU/CPUID.cs	Tue Sep 21 20:32:36 2010 +0000
     1.3 @@ -48,31 +48,31 @@
     1.4  
     1.5    internal class CPUID {
     1.6  
     1.7 -    private int thread;
     1.8 +    private readonly int thread;
     1.9  
    1.10 -    private Vendor vendor = Vendor.Unknown;
    1.11 +    private readonly Vendor vendor = Vendor.Unknown;
    1.12  
    1.13 -    private string cpuBrandString = "";
    1.14 -    private string name = "";
    1.15 +    private readonly string cpuBrandString = "";
    1.16 +    private readonly string name = "";
    1.17  
    1.18 -    private uint[,] cpuidData = new uint[0, 0];
    1.19 -    private uint[,] cpuidExtData = new uint[0, 0];
    1.20 +    private readonly uint[,] cpuidData = new uint[0, 0];
    1.21 +    private readonly uint[,] cpuidExtData = new uint[0, 0];
    1.22  
    1.23 -    private uint family;
    1.24 -    private uint model;
    1.25 -    private uint stepping;
    1.26 +    private readonly uint family;
    1.27 +    private readonly uint model;
    1.28 +    private readonly uint stepping;
    1.29  
    1.30 -    private uint apicId;
    1.31 +    private readonly uint apicId;
    1.32  
    1.33 -    private uint threadMaskWith;
    1.34 -    private uint coreMaskWith;
    1.35 +    private readonly uint threadMaskWith;
    1.36 +    private readonly uint coreMaskWith;
    1.37  
    1.38 -    private uint processorId;
    1.39 -    private uint coreId;
    1.40 -    private uint threadId;
    1.41 +    private readonly uint processorId;
    1.42 +    private readonly uint coreId;
    1.43 +    private readonly uint threadId;
    1.44  
    1.45 -    public static uint CPUID_0 = 0;
    1.46 -    public static uint CPUID_EXT = 0x80000000;
    1.47 +    public const uint CPUID_0 = 0;
    1.48 +    public const uint CPUID_EXT = 0x80000000;
    1.49  
    1.50      private static void AppendRegister(StringBuilder b, uint value) {
    1.51        b.Append((char)((value) & 0xff));
    1.52 @@ -217,8 +217,8 @@
    1.53            break;
    1.54        }
    1.55  
    1.56 -      processorId = (uint)(apicId >> (int)(coreMaskWith + threadMaskWith));
    1.57 -      coreId = (uint)((apicId >> (int)(threadMaskWith)) 
    1.58 +      processorId = (apicId >> (int)(coreMaskWith + threadMaskWith));
    1.59 +      coreId = ((apicId >> (int)(threadMaskWith)) 
    1.60          - (processorId << (int)(coreMaskWith)));
    1.61        threadId = apicId
    1.62          - (processorId << (int)(coreMaskWith + threadMaskWith))