Hardware/CPU/AMD10CPU.cs
changeset 42 47385d4fc990
parent 31 c4d1fb76a9e1
child 63 1a7c13ac7348
     1.1 --- a/Hardware/CPU/AMD10CPU.cs	Fri Feb 12 08:17:51 2010 +0000
     1.2 +++ b/Hardware/CPU/AMD10CPU.cs	Fri Feb 12 22:46:31 2010 +0000
     1.3 @@ -57,6 +57,7 @@
     1.4  
     1.5      private const ushort PCI_AMD_VENDOR_ID = 0x1022;
     1.6      private const ushort PCI_AMD_10H_MISCELLANEOUS_DEVICE_ID = 0x1203;
     1.7 +    private const ushort PCI_AMD_11H_MISCELLANEOUS_DEVICE_ID = 0x1303;
     1.8      private const uint REPORTED_TEMPERATURE_CONTROL_REGISTER = 0xA4;
     1.9  
    1.10      public AMD10CPU(string name, uint family, uint model, uint stepping, 
    1.11 @@ -90,6 +91,10 @@
    1.12  
    1.13        pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID, 
    1.14          PCI_AMD_10H_MISCELLANEOUS_DEVICE_ID, 0);
    1.15 +      if (pciAddress == 0xFFFFFFFF) 
    1.16 +        pciAddress = WinRing0.FindPciDeviceById(PCI_AMD_VENDOR_ID,
    1.17 +          PCI_AMD_11H_MISCELLANEOUS_DEVICE_ID, 0);
    1.18 +
    1.19        Update();                   
    1.20      }
    1.21  
    1.22 @@ -110,16 +115,15 @@
    1.23      }
    1.24  
    1.25      public void Update() {
    1.26 -      if (pciAddress == 0xFFFFFFFF)
    1.27 -        return;
    1.28 -
    1.29 -      uint value;      
    1.30 -      if (WinRing0.ReadPciConfigDwordEx(pciAddress, 
    1.31 -        REPORTED_TEMPERATURE_CONTROL_REGISTER, out value)) {
    1.32 -        coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f;
    1.33 -        ActivateSensor(coreTemperature);
    1.34 -      } else {
    1.35 -        DeactivateSensor(coreTemperature);
    1.36 +      if (pciAddress != 0xFFFFFFFF) {
    1.37 +        uint value;
    1.38 +        if (WinRing0.ReadPciConfigDwordEx(pciAddress,
    1.39 +          REPORTED_TEMPERATURE_CONTROL_REGISTER, out value)) {
    1.40 +          coreTemperature.Value = ((value >> 21) & 0x7FF) / 8.0f;
    1.41 +          ActivateSensor(coreTemperature);
    1.42 +        } else {
    1.43 +          DeactivateSensor(coreTemperature);
    1.44 +        }
    1.45        }
    1.46  
    1.47        if (cpuLoad.IsAvailable) {