diff --git a/LibreHardwareMonitorLib/Hardware/SMBios.cs b/LibreHardwareMonitorLib/Hardware/SMBios.cs index c97b17c..7be7f00 100644 --- a/LibreHardwareMonitorLib/Hardware/SMBios.cs +++ b/LibreHardwareMonitorLib/Hardware/SMBios.cs @@ -301,6 +301,22 @@ namespace LibreHardwareMonitor.Hardware Dsp, VideoProcessor } + + /// + /// Processor characteristics based on DMTF SMBIOS Reference Specification v.3.3.0, Chapter 7.5.9. + /// + [Flags] + public enum ProcessorCharacteristics + { + None = 0, + _64BitCapable = 1, + MultiCore = 2, + HardwareThread = 4, + ExecuteProtection = 8, + EnhancedVirtualization = 16, + PowerPerformanceControl = 32, + _128BitCapable = 64 + } /// /// Processor type based on DMTF SMBIOS Reference Specification v.3.3.0, Chapter 7.5.1. @@ -744,11 +760,6 @@ namespace LibreHardwareMonitor.Hardware /// public SystemEnclosureState BootUpState { get; } - /// - /// Gets - /// - public SystemEnclosureType Type { get; } - /// /// Gets or sets the system enclosure lock. /// @@ -796,6 +807,11 @@ namespace LibreHardwareMonitor.Hardware /// public SystemEnclosureState ThermalState { get; } + /// + /// Gets + /// + public SystemEnclosureType Type { get; } + /// /// Gets the number of null-terminated string representing the chassis or enclosure version. /// @@ -864,6 +880,31 @@ namespace LibreHardwareMonitor.Hardware Id = GetQword(0x08); Handle = GetWord(0x02); + byte characteristics1 = GetByte(0x26); + byte characteristics2 = GetByte(0x27); + + Characteristics = ProcessorCharacteristics.None; + if (IsBitSet(characteristics1, 2)) + Characteristics |= ProcessorCharacteristics._64BitCapable; + + if (IsBitSet(characteristics1, 3)) + Characteristics |= ProcessorCharacteristics.MultiCore; + + if (IsBitSet(characteristics1, 4)) + Characteristics |= ProcessorCharacteristics.HardwareThread; + + if (IsBitSet(characteristics1, 5)) + Characteristics |= ProcessorCharacteristics.ExecuteProtection; + + if (IsBitSet(characteristics1, 6)) + Characteristics |= ProcessorCharacteristics.EnhancedVirtualization; + + if (IsBitSet(characteristics1, 7)) + Characteristics |= ProcessorCharacteristics.PowerPerformanceControl; + + if (IsBitSet(characteristics2, 0)) + Characteristics |= ProcessorCharacteristics._128BitCapable; + ProcessorType = (ProcessorType)GetByte(0x05); Socket = (ProcessorSocket)GetByte(0x19); @@ -873,8 +914,18 @@ namespace LibreHardwareMonitor.Hardware L1CacheHandle = GetWord(0x1A); L2CacheHandle = GetWord(0x1C); L3CacheHandle = GetWord(0x1E); + + bool IsBitSet(byte b, int pos) + { + return (b & (1 << pos)) != 0; + } } + /// + /// Gets the characteristics of the processor. + /// + public ProcessorCharacteristics Characteristics { get; } + /// /// Gets the value that represents the number of cores per processor socket. /// @@ -1232,11 +1283,6 @@ namespace LibreHardwareMonitor.Hardware /// public BaseBoardInformation Board { get; } - /// - /// Gets - /// - public SystemEnclosure SystemEnclosure { get; } - /// /// Gets /// @@ -1257,6 +1303,11 @@ namespace LibreHardwareMonitor.Hardware /// public SystemInformation System { get; } + /// + /// Gets + /// + public SystemEnclosure SystemEnclosure { get; } + private static string ReadSysFs(string path) { try