Hardware/CPU/CPUID.cs
changeset 167 b7cc9d09aefe
parent 165 813d8bc3192f
child 182 4801e9eaf979
     1.1 --- a/Hardware/CPU/CPUID.cs	Thu Aug 12 20:53:27 2010 +0000
     1.2 +++ b/Hardware/CPU/CPUID.cs	Sun Aug 15 14:46:58 2010 +0000
     1.3 @@ -75,14 +75,14 @@
     1.4      public static uint CPUID_0 = 0;
     1.5      public static uint CPUID_EXT = 0x80000000;
     1.6  
     1.7 -    private void AppendRegister(StringBuilder b, uint value) {
     1.8 +    private static void AppendRegister(StringBuilder b, uint value) {
     1.9        b.Append((char)((value) & 0xff));
    1.10        b.Append((char)((value >> 8) & 0xff));
    1.11        b.Append((char)((value >> 16) & 0xff));
    1.12        b.Append((char)((value >> 24) & 0xff));
    1.13      }
    1.14  
    1.15 -    private uint NextLog2(long x) {
    1.16 +    private static uint NextLog2(long x) {
    1.17        if (x <= 0)
    1.18          return 0;
    1.19  
    1.20 @@ -105,7 +105,7 @@
    1.21        uint eax, ebx, ecx, edx;
    1.22  
    1.23        if (thread >= 32)
    1.24 -        throw new ArgumentException();
    1.25 +        throw new ArgumentOutOfRangeException("thread");
    1.26        UIntPtr mask = (UIntPtr)(1L << thread);
    1.27  
    1.28        if (WinRing0.CpuidTx(CPUID_0, 0,
    1.29 @@ -139,10 +139,10 @@
    1.30            else
    1.31              return;
    1.32          } else {
    1.33 -          throw new ArgumentException();
    1.34 +          throw new ArgumentOutOfRangeException("thread");
    1.35          }
    1.36        } else {
    1.37 -        throw new ArgumentException();
    1.38 +        throw new ArgumentOutOfRangeException("thread");
    1.39        }
    1.40  
    1.41        maxCpuid = Math.Min(maxCpuid, 1024);