diff --git a/source/lib/sysdep/os_cpu.cpp b/source/lib/sysdep/os_cpu.cpp index d516184a91..5e813c6ae3 100644 --- a/source/lib/sysdep/os_cpu.cpp +++ b/source/lib/sysdep/os_cpu.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2025 Wildfire Games. +/* Copyright (C) 2026 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -31,7 +31,6 @@ #include "lib/alignment.h" #include "lib/code_annotation.h" #include "lib/sysdep/os.h" -#include "lib/sysdep/smbios.h" #include "lib/types.h" #if OS_WIN @@ -56,10 +55,6 @@ double os_cpu_ClockFrequency() return clockFrequency = freqMhz * 1e6; #endif - const SMBIOS::Structures* structures = SMBIOS::GetStructures(); - if(structures->Processor_) - return clockFrequency = structures->Processor_->maxFrequency * 1e6; - return clockFrequency = -1.0; // unknown } @@ -71,18 +66,5 @@ size_t os_cpu_MemorySize() return memorySize; memorySize = os_cpu_QueryMemorySize(); - - // replace with the sum of all memory devices reported by SMBIOS if - // that's within 10% of what the OS reported - { - const SMBIOS::Structures* structures = SMBIOS::GetStructures(); - u64 memorySizeBytes = 0; - for(const SMBIOS::MemoryDevice* p = structures->MemoryDevice_; p; p = p->next) - memorySizeBytes += p->size; - const size_t memorySize2 = memorySizeBytes/MiB; - if(9*memorySize/10 <= memorySize2 && memorySize2 <= 11*memorySize/10) - memorySize = memorySize2; - } - return memorySize; } diff --git a/source/lib/sysdep/os_cpu.h b/source/lib/sysdep/os_cpu.h index 51bba9c048..a932681a91 100644 --- a/source/lib/sysdep/os_cpu.h +++ b/source/lib/sysdep/os_cpu.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2025 Wildfire Games. +/* Copyright (C) 2026 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -99,8 +99,7 @@ size_t os_cpu_QueryMemorySize(); /** * @return the size [MB] of physical memory; caches the result of - * os_cpu_QueryMemorySize and overrides it with a more exact value - * if SMBIOS information is available. + * os_cpu_QueryMemorySize. **/ size_t os_cpu_MemorySize(); diff --git a/source/lib/sysdep/smbios.cpp b/source/lib/sysdep/smbios.cpp deleted file mode 100644 index ce009f390a..0000000000 --- a/source/lib/sysdep/smbios.cpp +++ /dev/null @@ -1,735 +0,0 @@ -/* Copyright (C) 2026 Wildfire Games. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * provide access to System Management BIOS information - */ - -#include "precompiled.h" - -#include "smbios.h" - -#include "lib/alignment.h" -#include "lib/bits.h" -#include "lib/code_annotation.h" -#include "lib/code_generation.h" -#include "lib/debug.h" -#include "lib/module_init.h" -#include "lib/posix/posix.h" -#include "lib/status.h" -#include "lib/sysdep/os.h" - -#if OS_WIN -# include "lib/byte_order.h" -# include "lib/sysdep/os/win/wfirmware.h" -# include "lib/sysdep/os/win/wutil.h" -#endif - -#include -#include -#include -#include -#include -#include -#include - -namespace SMBIOS { - -//----------------------------------------------------------------------------- -// GetTable - -#if OS_WIN - -static Status GetTable(wfirmware::Table& table) -{ - // (MSDN mentions 'RSMB', but multi-character literals are implementation-defined.) - const DWORD provider = FOURCC_BE('R','S','M','B'); - - // (MSDN says this will be 0, but we'll retrieve it for 100% correctness.) - wfirmware::TableIds tableIds = wfirmware::GetTableIDs(provider); - if(tableIds.empty()) - return ERR::_1; // NOWARN (happens on 32-bit XP) - - table = wfirmware::GetTable(provider, tableIds[0]); - if(table.empty()) - WARN_RETURN(ERR::_2); - - // strip the WmiHeader - struct WmiHeader - { - u8 used20CallingMethod; - u8 majorVersion; - u8 minorVersion; - u8 dmiRevision; - u32 length; - }; - const WmiHeader* wmiHeader = (const WmiHeader*)&table[0]; - ENSURE(table.size() == sizeof(WmiHeader) + wmiHeader->length); - memmove(&table[0], &table[sizeof(WmiHeader)], table.size()-sizeof(WmiHeader)); - - return INFO::OK; -} - -#endif // OS_WIN - - -//----------------------------------------------------------------------------- -// strings - -// pointers to the strings (if any) at the end of an SMBIOS structure -typedef std::vector Strings; - -static Strings ExtractStrings(const Header* header, const char* end, const Header*& next) -{ - Strings strings; - - const char* pos = ((const char*)header) + header->length; - while(pos <= end-2) - { - if(*pos == '\0') - { - pos++; - if(*pos == 0) - { - pos++; - break; - } - } - - strings.push_back(pos); - pos += strlen(pos); - } - - next = (const Header*)pos; - return strings; -} - - -// storage for all structures' strings (must be copied from the original -// wfirmware table since its std::vector container cannot be stored in a -// static variable because we may be called before _cinit) -static char* stringStorage; -static char* stringStoragePos; - -// pointers to dynamically allocated structures -static Structures g_Structures; - -static void Cleanup() // called via atexit -{ - SAFE_FREE(stringStorage); - stringStoragePos = 0; - - // free each allocated structure -#define STRUCTURE(name, id)\ - while(g_Structures.name##_)\ - {\ - name* next = g_Structures.name##_->next;\ - SAFE_FREE(g_Structures.name##_);\ - g_Structures.name##_ = next;\ - } - STRUCTURES -#undef STRUCTURE -} - - -//----------------------------------------------------------------------------- -// FieldInitializer - -// define function templates that invoke a Visitor for each of a structure's fields -#define FIELD(flags, type, name, units) visitor(flags, p.name, #name, units); -#define STRUCTURE(name, id) template void VisitFields(name& p, Visitor& visitor) { name##_FIELDS } -STRUCTURES -#undef STRUCTURE -#undef FIELD - - -// initialize each of a structure's fields by copying from the SMBIOS data -class FieldInitializer -{ - NONCOPYABLE(FieldInitializer); // reference member -public: - FieldInitializer(const Header* header, const Strings& strings) - : data((const u8*)(header+1)) - , end((const u8*)header + header->length) - , strings(strings) - { - } - - template - void operator()(size_t flags, Field& field, const char* /*name*/, const char* /*units*/) - { - if((flags & F_DERIVED) || data >= end) - { - field = Field(); - return; - } - - Read(field, 0); // SFINAE - } - -private: - template - T ReadValue() - { - T value; - memcpy(&value, data, sizeof(value)); - data += sizeof(value); - return value; - } - - // construct from SMBIOS representations that don't match the - // actual type (e.g. enum) - template - void Read(Field& field, typename Field::T*) - { - field = Field(ReadValue()); - } - - template - void Read(Field& field, ...) - { - field = ReadValue(); - } - - const u8* data; - const u8* end; - const Strings& strings; -}; - - -// C++03 14.7.3(2): "An explicit specialization shall be declared [..] in the -// namespace of which the enclosing class [..] is a member. - -// (this specialization avoids a "forcing value to bool true or false" warning) -template<> -void FieldInitializer::operator()(size_t flags, bool& /*t*/, const char* /*name*/, - const char* /*units*/) -{ - // SMBIOS doesn't specify any individual booleans, so we're only called for - // derived fields and don't need to do anything. - ENSURE(flags & F_DERIVED); -} - -template<> -void FieldInitializer::operator()(size_t flags, const char*& t, const char* /*name*/, - const char* /*units*/) -{ - t = 0; // (allow immediate `return' when the string is found to be invalid) - - u8 number; - operator()(flags, number, 0, 0); - if(number == 0) // no string given - return; - - if(number > strings.size()) - { - debug_printf("SMBIOS: invalid string number %d (count=%d)\n", number, (int)strings.size()); - return; - } - - // copy to stringStorage - strcpy(stringStoragePos, strings[number-1]); - t = stringStoragePos; - stringStoragePos += strlen(t)+1; -} - - -//----------------------------------------------------------------------------- -// Fixup (e.g. compute derived fields) - -template -void Fixup(Structure&) -{ - // primary template: do nothing -} - -template<> -void Fixup(Bios& p) -{ - p.size = size_t(p.encodedSize+1) * 64*KiB; -} - -template<> -void Fixup(Processor& p) -{ - p.populated = (p.status & 0x40) != 0; - p.status = (ProcessorStatus)bits(p.status, 0, 2); - - if(p.voltage & 0x80) - p.voltage &= ~0x80; - else - { - // (arbitrarily) report the lowest supported value - if(IsBitSet(p.voltage, 0)) - p.voltage = 50; - if(IsBitSet(p.voltage, 1)) - p.voltage = 33; - if(IsBitSet(p.voltage, 2)) - p.voltage = 29; - } -} - -template<> -void Fixup(Cache& p) -{ - struct DecodeSize - { - u64 operator()(u16 size) const - { - const size_t granularity = IsBitSet(size, 15)? 64*KiB : 1*KiB; - return u64(bits(size, 0, 14)) * granularity; - } - }; - p.maxSize = DecodeSize()(p.maxSize16); - p.installedSize = DecodeSize()(p.installedSize16); - p.level = bits(p.configuration, 0, 2)+1; - p.location = (CacheLocation)bits(p.configuration, 5, 6); - p.mode = (CacheMode)bits(p.configuration, 8, 9); - p.configuration = (CacheConfigurationFlags)(p.configuration & ~0x367); -} - -template<> -void Fixup(SystemSlot& p) -{ - // (only initialize function and device numbers if functionAndDeviceNumber is valid) - if(p.functionAndDeviceNumber != 0xFF) - { - p.functionNumber = bits(p.functionAndDeviceNumber, 0, 2); - p.deviceNumber = bits(p.functionAndDeviceNumber, 3, 7); - } -} - -template<> -void Fixup(OnBoardDevices& p) -{ - p.enabled = (p.type.value & 0x80) != 0; - p.type = (OnBoardDeviceType)(p.type & ~0x80); -} - -template<> -void Fixup(MemoryArray& p) -{ - if(p.maxCapacity32 != (u32)INT32_MIN) - p.maxCapacity = u64(p.maxCapacity32) * KiB; -} - -template<> -void Fixup(MemoryDevice& p) -{ - if(p.size16 != INT16_MAX) - p.size = u64(bits(p.size16, 0, 14)) * (IsBitSet(p.size16, 15)? 1*KiB : 1*MiB); - else - p.size = u64(bits(p.size32, 0, 30)) * MiB; - p.rank = bits(p.attributes, 0, 3); -} - -template<> -void Fixup(MemoryArrayMappedAddress& p) -{ - if(p.startAddress32 != UINT32_MAX) - p.startAddress = u64(p.startAddress32) * KiB; - if(p.endAddress32 != UINT32_MAX) - p.endAddress = u64(p.endAddress32) * KiB; -} - -template<> -void Fixup(MemoryDeviceMappedAddress& p) -{ - if(p.startAddress32 != UINT32_MAX) - p.startAddress = u64(p.startAddress32) * KiB; - if(p.endAddress32 != UINT32_MAX) - p.endAddress = u64(p.endAddress32) * KiB; -} - -template<> -void Fixup(VoltageProbe& p) -{ - p.location = (VoltageProbeLocation)bits(p.locationAndStatus, 0, 4); - p.status = (State)bits(p.locationAndStatus, 5, 7); -} - -template<> -void Fixup(CoolingDevice& p) -{ - p.type = (CoolingDeviceType)bits(p.typeAndStatus, 0, 4); - p.status = (State)bits(p.typeAndStatus, 5, 7); -} - -template<> -void Fixup(TemperatureProbe& p) -{ - p.location = (TemperatureProbeLocation)bits(p.locationAndStatus, 0, 4); - p.status = (State)bits(p.locationAndStatus, 5, 7); -} - -template<> -void Fixup(SystemPowerSupply& p) -{ - p.type = (SystemPowerSupplyType)bits(p.characteristics, 10, 13); - p.status = (State)bits(p.characteristics, 7, 9); - p.inputSwitching = (SystemPowerSupplyInputSwitching)bits(p.characteristics, 3, 6); - p.characteristics = bits(p.characteristics, 0, 2); -} - -template<> -void Fixup(OnboardDevices2& p) -{ - p.enabled = IsBitSet(p.type, 7); - p.type = (OnBoardDeviceType)bits(p.type, 0, 6); - p.deviceNumber = bits(p.functionAndDeviceNumber, 3, 7); - p.functionNumber = bits(p.functionAndDeviceNumber, 0, 2); -} - - -//----------------------------------------------------------------------------- -// InitStructures - -template -void AddStructure(const Header* header, const Strings& strings, Structure*& listHead) -{ - Structure* const p = (Structure*)calloc(1, sizeof(Structure)); // freed in Cleanup - p->header = *header; - - if(listHead) - { - // insert at end of list to preserve order of caches/slots - Structure* last = listHead; - while(last->next) - last = last->next; - last->next = p; - } - else - listHead = p; - - FieldInitializer fieldInitializer(header, strings); - VisitFields(*p, fieldInitializer); - - Fixup(*p); -} - - -static Status InitStructures() -{ -#if OS_WIN - wfirmware::Table table; - RETURN_STATUS_IF_ERR(GetTable(table)); -#else - std::vector table; - return ERR::NOT_SUPPORTED; -#endif - - // (instead of counting the total string size, just use the - // SMBIOS size - typically 1-2 KB - as an upper bound.) - stringStoragePos = stringStorage = (char*)calloc(table.size(), sizeof(char)); // freed in Cleanup - if(!stringStorage) - WARN_RETURN(ERR::NO_MEM); - - atexit(Cleanup); - - const Header* header = (const Header*)&table[0]; - const Header* const end = (const Header*)(&table[0] + table.size()); - for(;;) - { - if(header+1 > end) - { - debug_printf("SMBIOS: table not terminated\n"); - break; - } - if(header->id == 127) // end - break; - if(header->length < sizeof(Header)) - return ERR::_3; // NOWARN (happens on some unknown BIOS, see https://gitea.wildfiregames.com/0ad/0ad/issues/2985) - - const Header* next; - const Strings strings = ExtractStrings(header, (const char*)end, next); - - switch(header->id) - { -#define STRUCTURE(name, id) case id: AddStructure(header, strings, g_Structures.name##_); break; - STRUCTURES -#undef STRUCTURE - - default: - if(32 < header->id && header->id < 126) // only mention non-proprietary structures of which we are not aware - debug_printf("SMBIOS: unknown structure type %d\n", header->id); - break; - } - - header = next; - } - - return INFO::OK; -} - - -//----------------------------------------------------------------------------- -// StringFromEnum - -template -std::string StringFromEnum(Enum /*field*/) -{ - return "(unknown enumeration)"; -} - -#define ENUM(enumerator, VALUE)\ - if(field.value == VALUE) /* single bit flag or matching enumerator */\ - return #enumerator;\ - if(!std::has_single_bit(static_cast(VALUE))) /* these aren't bit flags */\ - {\ - allowFlags = false;\ - string.clear();\ - }\ - if(allowFlags && (field.value & (VALUE)))\ - {\ - if(!string.empty())\ - string += "|";\ - string += #enumerator;\ - } -#define ENUMERATION(name, type)\ - template<>\ - std::string StringFromEnum(name field)\ - {\ - std::string string;\ - bool allowFlags = true;\ - name##_ENUMERATORS\ - /* (don't warn about the value 0, e.g. optional fields) */\ - if(string.empty() && field != 0)\ - {\ - std::stringstream ss;\ - ss << "(unknown " << #name << " " << field.value << ")";\ - return ss.str();\ - }\ - return string;\ - } -ENUMERATIONS -#undef ENUMERATION -#undef ENUM - - -//----------------------------------------------------------------------------- -// FieldStringizer - -class FieldStringizer -{ - NONCOPYABLE(FieldStringizer); // reference member -public: - FieldStringizer(std::stringstream& ss) - : ss(ss) - { - } - - template - void operator()(size_t flags, Field& field, const char* name, const char* units) - { - if(flags & F_INTERNAL) - return; - - Write(flags, field, name, units, 0); // SFINAE - } - - // special case for sizes [bytes] - template - void operator()(size_t flags, Size& size, const char* name, const char* units) - { - if(flags & F_INTERNAL) - return; - - const u64 value = (u64)size.value; - if(value == 0) - return; - - u64 divisor; - if(value > GiB) - { - divisor = GiB; - units = " GiB"; - } - else if(value > MiB) - { - divisor = MiB; - units = " MiB"; - } - else if(value > KiB) - { - divisor = KiB; - units = " KiB"; - } - else - { - divisor = 1; - units = " bytes"; - } - - WriteName(name); - - // (avoid floating-point output unless division would truncate the value) - if(value % divisor == 0) - ss << (value/divisor); - else - ss << (double(value)/divisor); - - WriteUnits(units); - } - -private: - void WriteName(const char* name) - { - ss << " "; // indent - ss << name << ": "; - } - - void WriteUnits(const char* units) - { - ss << units; - ss << "\n"; - } - - // enumerations and bit flags - template - void Write(size_t /*flags*/, Field& field, const char* name, const char* units, typename Field::Enum*) - { - // 0 usually means "not included in structure", but some packed - // enumerations actually use that value. therefore, only skip this - // field if it is zero AND no matching enumerator is found. - const std::string string = StringFromEnum(field); - if(string.empty()) - return; - - WriteName(name); - ss << StringFromEnum(field); - WriteUnits(units); - } - - // all other field types - template - void Write(size_t flags, Field& field, const char* name, const char* units, ...) - { - // SMBIOS uses the smallest and sometimes also largest representable - // signed/unsigned value to indicate `unknown' (except enumerators - - // but those are handled in the other function overload), so skip them. - if(field == std::numeric_limits::min() || field == std::numeric_limits::max()) - return; - - WriteName(name); - - if(flags & F_HEX) - ss << std::hex << std::uppercase; - - if(sizeof(field) == 1) // avoid printing as a character - ss << unsigned(field); - else - ss << field; - - if(flags & F_HEX) - ss << std::dec; // (revert to decimal, e.g. for displaying sizes) - - WriteUnits(units); - } - - std::stringstream& ss; -}; - -template<> -void FieldStringizer::operator()(size_t flags, bool& value, const char* name, const char* units) -{ - if(flags & F_INTERNAL) - return; - - WriteName(name); - ss << (value? "true" : "false"); - WriteUnits(units); -} - -template<> -void FieldStringizer::operator()(size_t flags, Handle& handle, const char* name, const char* units) -{ - if(flags & F_INTERNAL) - return; - - // don't display useless handles - if(handle.value == 0 || handle.value == 0xFFFE || handle.value == 0xFFFF) - return; - - WriteName(name); - ss << handle.value; - WriteUnits(units); -} - - -template<> -void FieldStringizer::operator()(size_t flags, const char*& value, const char* name, const char* units) -{ - if(flags & F_INTERNAL) - return; - - // don't display useless strings - if(value == 0) - return; - std::string string(value); - const size_t lastChar = string.find_last_not_of(' '); - if(lastChar == std::string::npos) // nothing but spaces - return; - string.resize(lastChar+1); // strip trailing spaces - if(!strcasecmp(value, "To Be Filled By O.E.M.")) - return; - - WriteName(name); - ss << "\"" << string << "\""; - WriteUnits(units); -} - - -//----------------------------------------------------------------------------- -// public interface - -const Structures* GetStructures() -{ - static ModuleInitState initState{ 0 }; - std::ignore = ModuleInit(&initState, InitStructures); - // (callers have to check if member pointers are nonzero anyway, so - // we always return a valid pointer to simplify most use cases.) - return &g_Structures; -} - - -template -void StringizeStructure(const char* name, Structure* p, std::stringstream& ss) -{ - for(; p; p = p->next) - { - ss << "\n[" << name << "]\n"; - FieldStringizer fieldStringizer(ss); - VisitFields(*p, fieldStringizer); - } -} - -std::string StringizeStructures(const Structures* structures) -{ - std::stringstream ss; -#define STRUCTURE(name, id) StringizeStructure(#name, structures->name##_, ss); - STRUCTURES -#undef STRUCTURE - - return ss.str(); -} - -} // namespace SMBIOS diff --git a/source/lib/sysdep/smbios.h b/source/lib/sysdep/smbios.h deleted file mode 100644 index 898c1b94df..0000000000 --- a/source/lib/sysdep/smbios.h +++ /dev/null @@ -1,1305 +0,0 @@ -/* Copyright (C) 2025 Wildfire Games. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * provide access to System Management BIOS information - */ - -#ifndef INCLUDED_SMBIOS -#define INCLUDED_SMBIOS - -#include "lib/types.h" - -#include -#include - -namespace SMBIOS { struct Baseboard; } -namespace SMBIOS { struct BaseboardFlags; } -namespace SMBIOS { struct BaseboardType; } -namespace SMBIOS { struct Bios; } -namespace SMBIOS { struct BiosFlags1; } -namespace SMBIOS { struct BiosFlags2; } -namespace SMBIOS { struct BiosFlags; } -namespace SMBIOS { struct Cache; } -namespace SMBIOS { struct CacheAssociativity; } -namespace SMBIOS { struct CacheConfigurationFlags; } -namespace SMBIOS { struct CacheFlags; } -namespace SMBIOS { struct CacheLocation; } -namespace SMBIOS { struct CacheMode; } -namespace SMBIOS { struct CacheType; } -namespace SMBIOS { struct Chassis; } -namespace SMBIOS { struct ChassisSecurityStatus; } -namespace SMBIOS { struct ChassisType; } -namespace SMBIOS { struct CoolingDevice; } -namespace SMBIOS { struct CoolingDeviceType; } -namespace SMBIOS { struct ECC; } -namespace SMBIOS { struct ManagementDevice; } -namespace SMBIOS { struct ManagementDeviceAddressType; } -namespace SMBIOS { struct ManagementDeviceComponent; } -namespace SMBIOS { struct ManagementDeviceThreshold; } -namespace SMBIOS { struct ManagementDeviceType; } -namespace SMBIOS { struct MemoryArray; } -namespace SMBIOS { struct MemoryArrayLocation; } -namespace SMBIOS { struct MemoryArrayMappedAddress; } -namespace SMBIOS { struct MemoryArrayUse; } -namespace SMBIOS { struct MemoryDevice; } -namespace SMBIOS { struct MemoryDeviceFormFactor; } -namespace SMBIOS { struct MemoryDeviceMappedAddress; } -namespace SMBIOS { struct MemoryDeviceType; } -namespace SMBIOS { struct MemoryDeviceTypeFlags; } -namespace SMBIOS { struct OnBoardDeviceType; } -namespace SMBIOS { struct OnBoardDevices; } -namespace SMBIOS { struct OnboardDevices2; } -namespace SMBIOS { struct PortConnector; } -namespace SMBIOS { struct PortConnectorType; } -namespace SMBIOS { struct PortType; } -namespace SMBIOS { struct PortableBattery; } -namespace SMBIOS { struct PortableBatteryChemistry; } -namespace SMBIOS { struct Processor; } -namespace SMBIOS { struct ProcessorFlags; } -namespace SMBIOS { struct ProcessorStatus; } -namespace SMBIOS { struct ProcessorType; } -namespace SMBIOS { struct ProcessorUpgrade; } -namespace SMBIOS { struct State; } -namespace SMBIOS { struct System; } -namespace SMBIOS { struct SystemBoot; } -namespace SMBIOS { struct SystemBootStatus; } -namespace SMBIOS { struct SystemPowerSupply; } -namespace SMBIOS { struct SystemPowerSupplyCharacteristics; } -namespace SMBIOS { struct SystemPowerSupplyInputSwitching; } -namespace SMBIOS { struct SystemPowerSupplyType; } -namespace SMBIOS { struct SystemSlot; } -namespace SMBIOS { struct SystemSlotBusWidth; } -namespace SMBIOS { struct SystemSlotFlags1; } -namespace SMBIOS { struct SystemSlotFlags2; } -namespace SMBIOS { struct SystemSlotLength; } -namespace SMBIOS { struct SystemSlotType; } -namespace SMBIOS { struct SystemSlotUsage; } -namespace SMBIOS { struct SystemWakeUpType; } -namespace SMBIOS { struct TemperatureProbe; } -namespace SMBIOS { struct TemperatureProbeLocation; } -namespace SMBIOS { struct VoltageProbe; } -namespace SMBIOS { struct VoltageProbeLocation; } - -namespace SMBIOS { - -// to introduce another enumeration: -// 1) add its name and underlying type here -// 2) define a _ENUMERATORS macro specifying its enumerators -// (prefer lower case to avoid conflicts with macros) -#define ENUMERATIONS\ - ENUMERATION(State, u8)\ - ENUMERATION(ECC, u8)\ - ENUMERATION(BiosFlags, u32)\ - ENUMERATION(BiosFlags1, u8)\ - ENUMERATION(BiosFlags2, u8)\ - ENUMERATION(SystemWakeUpType, u8)\ - ENUMERATION(BaseboardFlags, u8)\ - ENUMERATION(BaseboardType, u8)\ - ENUMERATION(ChassisType, u8)\ - ENUMERATION(ChassisSecurityStatus, u8)\ - ENUMERATION(ProcessorType, u8)\ - ENUMERATION(ProcessorStatus, u8)\ - ENUMERATION(ProcessorUpgrade, u8)\ - ENUMERATION(ProcessorFlags, u16)\ - ENUMERATION(CacheMode, u8)\ - ENUMERATION(CacheLocation, u8)\ - ENUMERATION(CacheConfigurationFlags, u16)\ - ENUMERATION(CacheFlags, u16)\ - ENUMERATION(CacheType, u8)\ - ENUMERATION(CacheAssociativity, u8)\ - ENUMERATION(PortConnectorType, u8)\ - ENUMERATION(PortType, u8)\ - ENUMERATION(SystemSlotType, u8)\ - ENUMERATION(SystemSlotBusWidth, u8)\ - ENUMERATION(SystemSlotUsage, u8)\ - ENUMERATION(SystemSlotLength, u8)\ - ENUMERATION(SystemSlotFlags1, u8)\ - ENUMERATION(SystemSlotFlags2, u8)\ - ENUMERATION(OnBoardDeviceType, u8)\ - ENUMERATION(MemoryArrayLocation, u8)\ - ENUMERATION(MemoryArrayUse, u8)\ - ENUMERATION(MemoryDeviceFormFactor, u8)\ - ENUMERATION(MemoryDeviceType, u8)\ - ENUMERATION(MemoryDeviceTypeFlags, u16)\ - ENUMERATION(PortableBatteryChemistry, u8)\ - ENUMERATION(VoltageProbeLocation, u8)\ - ENUMERATION(CoolingDeviceType, u8)\ - ENUMERATION(TemperatureProbeLocation, u8)\ - ENUMERATION(SystemBootStatus, u8)\ - ENUMERATION(ManagementDeviceType, u8)\ - ENUMERATION(ManagementDeviceAddressType, u8)\ - ENUMERATION(SystemPowerSupplyCharacteristics, u16)\ - ENUMERATION(SystemPowerSupplyType, u8)\ - ENUMERATION(SystemPowerSupplyInputSwitching, u8) - -// to introduce another structure: -// 1) add its name and ID here -// 2) define a _FIELDS macro specifying its fields -// 3) (optional) add a specialization of Fixup -#define STRUCTURES\ - STRUCTURE(Bios, 0)\ - STRUCTURE(System, 1)\ - STRUCTURE(Baseboard, 2)\ - STRUCTURE(Chassis, 3)\ - STRUCTURE(Processor, 4)\ - /* MemoryController (5) and MemoryModule (6) are obsolete */\ - STRUCTURE(Cache, 7)\ - STRUCTURE(PortConnector, 8)\ - STRUCTURE(SystemSlot, 9)\ - STRUCTURE(OnBoardDevices, 10)\ - /* OemStrings (11), SystemConfiguration (12), BiosLanguage (13), GroupAssociations (14), SystemEventLog (15) are optional */\ - STRUCTURE(MemoryArray, 16)\ - STRUCTURE(MemoryDevice, 17)\ - /* MemoryError32 (18) is optional */\ - STRUCTURE(MemoryArrayMappedAddress, 19)\ - STRUCTURE(MemoryDeviceMappedAddress, 20)\ - /* PointingDevice (21) is optional */\ - STRUCTURE(PortableBattery, 22)\ - /* SystemReset (23), HardwareSecurity (24), SystemPowerControls (25) are optional */\ - STRUCTURE(VoltageProbe, 26)\ - STRUCTURE(CoolingDevice, 27)\ - STRUCTURE(TemperatureProbe, 28)\ - /* ElectricalCurrentProbe (29), OutOfBandRemoteAccess (30), BootIntegrityServices (31) are optional */\ - STRUCTURE(SystemBoot, 32)\ - STRUCTURE(ManagementDevice, 34)\ - STRUCTURE(ManagementDeviceComponent, 35)\ - STRUCTURE(ManagementDeviceThreshold, 36)\ - STRUCTURE(SystemPowerSupply, 39)\ - STRUCTURE(OnboardDevices2, 41)\ - /* MemoryError64 (33), MemoryChannel (37), IpmiDevice (38) are optional */ - /* Additional (40), ManagementControllerHostInterface (42) are optional */ - - -//----------------------------------------------------------------------------- -// declarations required for the fields - -// indicates a field (:= member of a structure) is: -enum FieldFlags -{ - // computed via other fields (i.e. should not be copied from the SMBIOS data). - F_DERIVED = 1, - - // not intended for display / use by applications (usually because - // it is superseded by another - possibly derived - field). - F_INTERNAL = 2, - - // a number that should be displayed in hexadecimal form. - F_HEX = 4 -}; - - -// (wrapper classes allow special handling of certain fields via -// template specialization and function overloads) - -// size [bytes] - displayed with auto-range -template -struct Size -{ - Size(): value(0) {} - Size(T value): value(value) {} - T value; - operator T() const { return value; } -}; - -// SMBIOS structure handle - only displayed if meaningful -struct Handle -{ - Handle(): value(0) {} - Handle(u16 value): value(value) {} - u16 value; -}; - - -#define State_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(ok, 3)\ - ENUM(noncritical, 4)\ - ENUM(critical, 5)\ - ENUM(nonrecoverable, 6) - -#define ECC_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(none, 3)\ - ENUM(parity, 4)\ - ENUM(single_bit, 5)\ - ENUM(multiple_bit, 6)\ - ENUM(crc, 7) - - -#pragma pack(push, 1) - - -//----------------------------------------------------------------------------- -// Bios - -#define BiosFlags_ENUMERATORS\ - ENUM(isa, 0x10)\ - ENUM(mca, 0x20)\ - ENUM(eisa, 0x40)\ - ENUM(pci, 0x80)\ - ENUM(pcmcia, 0x100)\ - ENUM(plug_and_play, 0x200)\ - ENUM(apm, 0x400)\ - ENUM(upgradable, 0x800)\ - ENUM(shadowing, 0x1000)\ - ENUM(vl_vesa, 0x2000)\ - ENUM(escd, 0x4000)\ - ENUM(boot_cd, 0x8000)\ - ENUM(selectable_boot, 0x10000)\ - ENUM(socketed_rom, 0x20000)\ - ENUM(boot_pcmcia, 0x40000)\ - ENUM(edd, 0x80000)\ - ENUM(int13a, 0x100000)\ - ENUM(int13b, 0x200000)\ - ENUM(int13c, 0x400000)\ - ENUM(int13d, 0x800000)\ - ENUM(int13e, 0x1000000)\ - ENUM(int13f, 0x2000000)\ - ENUM(int5, 0x4000000)\ - ENUM(int9, 0x8000000)\ - ENUM(int14, 0x10000000)\ - ENUM(int17, 0x20000000)\ - ENUM(int10, 0x40000000)\ - ENUM(pc_98, 0x80000000) - -#define BiosFlags1_ENUMERATORS\ - ENUM(acpi, 0x01)\ - ENUM(usb_legacy, 0x02)\ - ENUM(agp, 0x04)\ - ENUM(boot_i2o, 0x08)\ - ENUM(boot_ls_120, 0x10)\ - ENUM(boot_zip_drive, 0x20)\ - ENUM(boot_1394, 0x40)\ - ENUM(smart_battery, 0x80) - -#define BiosFlags2_ENUMERATORS\ - ENUM(bios_boot, 0x01)\ - ENUM(function_key_boot, 0x02)\ - ENUM(targeted_content_distribution, 0x04)\ - ENUM(uefi, 0x08)\ - ENUM(virtual_machine, 0x10) - -#define Bios_FIELDS\ - FIELD(0, const char*, vendor, "")\ - FIELD(0, const char*, version, "")\ - FIELD(F_HEX, u16, startSegment, "")\ - FIELD(0, const char*, releaseDate, "")\ - FIELD(F_INTERNAL, u8, encodedSize, "")\ - FIELD(0, BiosFlags, flags, "")\ - FIELD(F_HEX, u32, vendorFlags, "")\ - FIELD(0, BiosFlags1, flags1, "")\ - FIELD(0, BiosFlags2, flags2, "")\ - FIELD(F_DERIVED, Size, size, "") - - -//----------------------------------------------------------------------------- -// System - -#define SystemWakeUpType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(apm_timer, 3)\ - ENUM(modem_ring, 4)\ - ENUM(lan_remote, 5)\ - ENUM(power_switch, 6)\ - ENUM(pci_pme, 7)\ - ENUM(ac_power_restored, 8) - -#define System_FIELDS\ - FIELD(0, const char*, manufacturer, "")\ - FIELD(0, const char*, productName, "")\ - FIELD(0, const char*, version, "")\ - FIELD(0, const char*, serialNumber, "")\ - FIELD(F_HEX, u64, uuid0, "")\ - FIELD(F_HEX, u64, uuid1, "")\ - FIELD(0, SystemWakeUpType, wakeUpType, "")\ - FIELD(0, const char*, skuNumber, "")\ - FIELD(0, const char*, m_Family, "") - - -//----------------------------------------------------------------------------- -// Baseboard - -#define BaseboardFlags_ENUMERATORS\ - ENUM(motherboard, 0x01)\ - ENUM(requires_add_in, 0x02)\ - ENUM(removable, 0x04)\ - ENUM(replaceable, 0x08)\ - ENUM(hot_swappable, 0x10) - -#define BaseboardType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(blade, 3)\ - ENUM(connectivity_switch, 4)\ - ENUM(system_management, 5)\ - ENUM(processor, 6)\ - ENUM(io, 7)\ - ENUM(memory, 8)\ - ENUM(daughter, 9)\ - ENUM(motherboard, 10)\ - ENUM(processor_memory, 11)\ - ENUM(processor_io, 12)\ - ENUM(interconnect, 13) - -#define Baseboard_FIELDS\ - FIELD(0, const char*, manufacturer, "")\ - FIELD(0, const char*, product, "")\ - FIELD(0, const char*, version, "")\ - FIELD(0, const char*, serialNumber, "")\ - FIELD(0, const char*, assetTag, "")\ - FIELD(0, BaseboardFlags, flags, "")\ - FIELD(0, const char*, location, "")\ - FIELD(0, Handle, hChassis, "")\ - FIELD(0, BaseboardType, type, "")\ - /* omit subsequent fields because we can't handle the variable-length contained objects */ - - -//----------------------------------------------------------------------------- -// Chassis - -#define ChassisType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(desktop, 3)\ - ENUM(low_profile_desktop, 4)\ - ENUM(pizza_box, 5)\ - ENUM(mini_tower, 6)\ - ENUM(tower, 7)\ - ENUM(portable, 8)\ - ENUM(laptop, 9)\ - ENUM(notebook, 10)\ - ENUM(handheld, 11)\ - ENUM(docking_station, 12)\ - ENUM(all_in_one, 13)\ - ENUM(subnotebook, 14)\ - ENUM(space_saving, 15)\ - ENUM(lunchbox, 16)\ - ENUM(main_server, 17)\ - ENUM(expansion, 18)\ - ENUM(sub, 19)\ - ENUM(bus_expansion, 20)\ - ENUM(peripheral, 21)\ - ENUM(raid, 22)\ - ENUM(rack_mount, 23)\ - ENUM(sealed_case, 24)\ - ENUM(multi_system, 25)\ - ENUM(compact_pci, 26)\ - ENUM(advanced_tca, 27)\ - ENUM(blade, 28)\ - ENUM(blade_enclosure, 29) - -#define ChassisSecurityStatus_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(none, 3)\ - ENUM(external_interface_locked, 4)\ - ENUM(external_interface_enabled, 5) - -#define Chassis_FIELDS\ - FIELD(0, const char*, manufacturer, "")\ - FIELD(0, ChassisType, type, "")\ - FIELD(0, const char*, version, "")\ - FIELD(0, const char*, serialNumber, "")\ - FIELD(0, const char*, assetTag, "")\ - FIELD(0, State, state, "")\ - FIELD(0, State, powerState, "")\ - FIELD(0, State, thermalState, "")\ - FIELD(0, ChassisSecurityStatus, securityStatus, "")\ - FIELD(0, u32, oemDefined, "")\ - FIELD(0, u8, height, "U")\ - FIELD(0, u8, numPowerCords, "")\ - /* omit subsequent fields because we can't handle the variable-length contained objects */ - - -//----------------------------------------------------------------------------- -// Processor - -#define ProcessorType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(CPU, 3)\ - ENUM(FPU, 4)\ - ENUM(DSP, 5)\ - ENUM(GPU, 6) - -#define ProcessorStatus_ENUMERATORS\ - ENUM(unknown, 0)\ - ENUM(other, 7)\ - ENUM(enabled, 1)\ - ENUM(user_disabled, 2)\ - ENUM(post_disabled, 3)\ - ENUM(idle, 4) - -#define ProcessorUpgrade_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(daughter, 3)\ - ENUM(zif, 4)\ - ENUM(piggyback, 5)\ - ENUM(none, 6)\ - ENUM(lif, 7)\ - ENUM(slot_1, 8)\ - ENUM(slot_2, 9)\ - ENUM(socket_370, 10)\ - ENUM(slot_a, 11)\ - ENUM(slot_m, 12)\ - ENUM(socket_423, 13)\ - ENUM(socket_a, 14)\ - ENUM(socket_478, 15)\ - ENUM(socket_754, 16)\ - ENUM(socket_940, 17)\ - ENUM(socket_939, 18)\ - ENUM(socket_604, 19)\ - ENUM(socket_771, 20)\ - ENUM(socket_775, 21)\ - ENUM(socket_s1, 22)\ - ENUM(socket_am2, 23)\ - ENUM(socket_1207, 24)\ - ENUM(socket_1366, 25)\ - ENUM(socket_g34, 26)\ - ENUM(socket_am3, 27)\ - ENUM(socket_c32, 28)\ - ENUM(socket_1156, 29)\ - ENUM(socket_1567, 30)\ - ENUM(socket_988a, 31)\ - ENUM(socket_1288, 32)\ - ENUM(socket_988b, 33)\ - ENUM(socket_1023, 34)\ - ENUM(socket_1224, 35)\ - ENUM(socket_1155, 36)\ - ENUM(socket_1356, 37)\ - ENUM(socket_2011, 38)\ - ENUM(socket_fs1, 39)\ - ENUM(socket_fs2, 40)\ - ENUM(socket_fm1, 41)\ - ENUM(socket_fm2, 42) - -#define ProcessorFlags_ENUMERATORS\ - ENUM(unknown, 0x2)\ - ENUM(x64, 0x4)\ - ENUM(multi_core, 0x8)/* indicates cores are present, but they might be disabled*/\ - ENUM(ht, 0x10)\ - ENUM(execute_protection, 0x20)\ - ENUM(enhanced_virtualization, 0x40)\ - ENUM(power_control, 0x80) - -#define Processor_FIELDS\ - FIELD(0, const char*, socket, "")\ - FIELD(0, ProcessorType, type, "")\ - FIELD(0, u8, m_Family, "") /* we don't bother providing enumerators for > 200 families */\ - FIELD(0, const char*, manufacturer, "")\ - FIELD(F_HEX, u64, id, "")\ - FIELD(0, const char*, version, "")\ - FIELD(0, u8, voltage, " dV")\ - FIELD(0, u16, externalClockFrequency, " MHz")\ - FIELD(0, u16, maxFrequency, " MHz")\ - FIELD(0, u16, bootFrequency, " MHz")\ - FIELD(0, ProcessorStatus, status, "")\ - FIELD(0, ProcessorUpgrade, upgrade, "")\ - FIELD(0, Handle, hL1, "")\ - FIELD(0, Handle, hL2, "")\ - FIELD(0, Handle, hL3, "")\ - FIELD(0, const char*, serialNumber, "")\ - FIELD(0, const char*, assetTag, "")\ - FIELD(0, const char*, partNumber, "")\ - FIELD(0, u8, coresPerPackage, "")\ - FIELD(0, u8, enabledCores, "")\ - FIELD(0, u8, logicalPerPackage, "")\ - FIELD(0, ProcessorFlags, flags, "")\ - FIELD(0, u16, family2, "")\ - FIELD(F_DERIVED, bool, populated, "") - - -//----------------------------------------------------------------------------- -// Cache - -#define CacheMode_ENUMERATORS\ - ENUM(write_through, 0)\ - ENUM(write_back, 1)\ - ENUM(varies, 2)\ - ENUM(unknown, 3) - -#define CacheLocation_ENUMERATORS\ - ENUM(internal, 0)\ - ENUM(external, 1)\ - ENUM(reserved, 2)\ - ENUM(unknown, 3) - -#define CacheConfigurationFlags_ENUMERATORS\ - ENUM(socketed, 0x08)\ - ENUM(enabled, 0x80) - -#define CacheFlags_ENUMERATORS\ - ENUM(other, 0x01)\ - ENUM(unknown, 0x02)\ - ENUM(non_burst, 0x04)\ - ENUM(burst, 0x08)\ - ENUM(pipeline_burst, 0x10)\ - ENUM(synchronous, 0x20)\ - ENUM(asynchronous, 0x40) - -#define CacheType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(instruction, 3)\ - ENUM(data, 4)\ - ENUM(unified, 5) - -#define CacheAssociativity_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(direct_mapped, 3)\ - ENUM(A2, 4)\ - ENUM(A4, 5)\ - ENUM(full, 6)\ - ENUM(A8, 7)\ - ENUM(A16, 8)\ - ENUM(A12, 9)\ - ENUM(A24, 10)\ - ENUM(A32, 11)\ - ENUM(A48, 12)\ - ENUM(A64, 13)\ - ENUM(A20, 14) - -#define Cache_FIELDS\ - FIELD(0, const char*, designation, "")\ - FIELD(0, CacheConfigurationFlags, configuration, "")\ - FIELD(F_INTERNAL, u16, maxSize16, "")\ - FIELD(F_INTERNAL, u16, installedSize16, "")\ - FIELD(0, CacheFlags, supportedFlags, "")\ - FIELD(0, CacheFlags, currentFlags, "")\ - FIELD(0, u8, speed, " ns")\ - FIELD(0, ECC, ecc, "")\ - FIELD(0, CacheType, type, "")\ - FIELD(0, CacheAssociativity, m_Associativity, "")\ - FIELD(F_DERIVED, size_t, level, "") /* 1..8 */\ - FIELD(F_DERIVED, CacheLocation, location, "")\ - FIELD(F_DERIVED, CacheMode, mode, "")\ - FIELD(F_DERIVED, Size, maxSize, "")\ - FIELD(F_DERIVED, Size, installedSize, "") - - -//----------------------------------------------------------------------------- -// PortConnector - -#define PortConnectorType_ENUMERATORS\ - ENUM(other, 255)\ - ENUM(none, 0)\ - ENUM(centronics, 1)\ - ENUM(mini_centronics, 2)\ - ENUM(proprietary, 3)\ - ENUM(db25_male, 4)\ - ENUM(db25_pin_female, 5)\ - ENUM(db15_pin_male, 6)\ - ENUM(db15_pin_female, 7)\ - ENUM(db9_pin_male, 8)\ - ENUM(db9_pin_female, 9)\ - ENUM(rj11, 10)\ - ENUM(rj45, 11)\ - ENUM(mini_scsi, 12)\ - ENUM(mini_din, 13)\ - ENUM(micro_din, 14)\ - ENUM(ps2, 15)\ - ENUM(infrared, 16)\ - ENUM(hp_hil, 17)\ - ENUM(access_bus_usb, 18)\ - ENUM(pc_ssa_scsi, 19)\ - ENUM(din8_male, 20)\ - ENUM(din8_female, 21)\ - ENUM(on_board_ide, 22)\ - ENUM(on_board_floppy, 23)\ - ENUM(dual_inline_9, 24)\ - ENUM(dual_inline_25, 25)\ - ENUM(dual_inline_50, 26)\ - ENUM(dual_inline_68, 27)\ - ENUM(on_board_sound_input_from_cd, 28)\ - ENUM(mini_centronics_14, 29)\ - ENUM(mini_centronics_26, 30)\ - ENUM(headphones, 31)\ - ENUM(bnc, 32)\ - ENUM(pc_firewire, 33)\ - ENUM(sas_sata, 34)\ - ENUM(pc_98, 160)\ - ENUM(pc_98_hireso, 161)\ - ENUM(pc_h98, 162)\ - ENUM(pc_98_note, 163)\ - ENUM(pc_98_full, 164) - -#define PortType_ENUMERATORS\ - ENUM(other, 255)\ - ENUM(none, 0)\ - ENUM(parallel_xt_at, 1)\ - ENUM(parallel_ps2, 2)\ - ENUM(parallel_ecp, 3)\ - ENUM(parallel_epp, 4)\ - ENUM(parallel_ecepp, 5)\ - ENUM(serial_xt_at, 6)\ - ENUM(serial_16450, 7)\ - ENUM(serial_16550, 8)\ - ENUM(serial_16550a, 9)\ - ENUM(scsi, 10)\ - ENUM(midi, 11)\ - ENUM(joystick, 12)\ - ENUM(keyboard, 13)\ - ENUM(mouse, 14)\ - ENUM(ssa_scsi, 15)\ - ENUM(usb, 16)\ - ENUM(firewire, 17)\ - ENUM(pcmcia_i, 18)\ - ENUM(pcmcia_ii, 19)\ - ENUM(pcmcia_iii, 20)\ - ENUM(cardbus, 21)\ - ENUM(access_bus, 22)\ - ENUM(scsi_ii, 23)\ - ENUM(scsi_wide, 24)\ - ENUM(pc_98, 25)\ - ENUM(pc_98_hireso, 26)\ - ENUM(pc_h98, 27)\ - ENUM(video, 28)\ - ENUM(audio, 29)\ - ENUM(modem, 30)\ - ENUM(network, 31)\ - ENUM(sata, 32)\ - ENUM(sas, 33)\ - ENUM(_8251_compatible, 160)\ - ENUM(_8251_fifo_compatible, 161) - -#define PortConnector_FIELDS\ - FIELD(0, const char*, internalDesignator, "")\ - FIELD(0, PortConnectorType, internalConnectorType, "")\ - FIELD(0, const char*, externalDesignator, "")\ - FIELD(0, PortConnectorType, externalConnectorType, "")\ - FIELD(0, PortType, portType, "") - - -//----------------------------------------------------------------------------- -// SystemSlot - -#define SystemSlotType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(isa, 3)\ - ENUM(mca, 4)\ - ENUM(eisa, 5)\ - ENUM(pci, 6)\ - ENUM(pcmcia, 7)\ - ENUM(vesa, 8)\ - ENUM(proprietary, 9)\ - ENUM(processor, 10)\ - ENUM(memory_card, 11)\ - ENUM(io_riser, 12)\ - ENUM(nubus, 13)\ - ENUM(pci_66, 14)\ - ENUM(agp, 15)\ - ENUM(agp_2x, 16)\ - ENUM(agp_4x, 17)\ - ENUM(pcix, 18)\ - ENUM(agp_8x, 19)\ - ENUM(pc_98_c20, 160)\ - ENUM(pc_98_c24, 161)\ - ENUM(pc_98_e, 162)\ - ENUM(pc_98_local_bus, 163)\ - ENUM(pc_98_card, 164)\ - ENUM(pcie, 165)\ - ENUM(pcie_x1, 166)\ - ENUM(pcie_x2, 167)\ - ENUM(pcie_x4, 168)\ - ENUM(pcie_x8, 169)\ - ENUM(pcie_x16, 170)\ - ENUM(pcie2, 171)\ - ENUM(pcie2_x1, 172)\ - ENUM(pcie2_x2, 173)\ - ENUM(pcie2_x4, 174)\ - ENUM(pcie2_x8, 175)\ - ENUM(pcie2_x16, 176)\ - ENUM(pcie3, 177)\ - ENUM(pcie3_x1, 178)\ - ENUM(pcie3_x2, 179)\ - ENUM(pcie3_x4, 180)\ - ENUM(pcie3_x8, 181)\ - ENUM(pcie3_x16, 182) - -#define SystemSlotBusWidth_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(_8, 3)\ - ENUM(_16, 4)\ - ENUM(_32, 5)\ - ENUM(_64, 6)\ - ENUM(_128, 7)\ - ENUM(x1, 8)\ - ENUM(x2, 9)\ - ENUM(x4, 10)\ - ENUM(x8, 11)\ - ENUM(x12, 12)\ - ENUM(x16, 13)\ - ENUM(x32, 14) - -#define SystemSlotUsage_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(available, 3)\ - ENUM(in_use, 4) - -#define SystemSlotLength_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(_short, 3)\ - ENUM(_long, 4) - -#define SystemSlotFlags1_ENUMERATORS\ - ENUM(unknown, 0x1)\ - ENUM(v5, 0x2)\ - ENUM(v3_3, 0x4)\ - ENUM(shared, 0x8)\ - ENUM(pc_card_16, 0x10)\ - ENUM(pc_cardbus, 0x20)\ - ENUM(pc_zoom_video, 0x40)\ - ENUM(pc_modem_ring_resume, 0x80) - -#define SystemSlotFlags2_ENUMERATORS\ - ENUM(pme, 0x1)\ - ENUM(hot_plug, 0x2)\ - ENUM(smbus, 0x4)\ - -#define SystemSlot_FIELDS\ - FIELD(0, const char*, designation, "")\ - FIELD(0, SystemSlotType, type, "")\ - FIELD(0, SystemSlotBusWidth, busWidth, "")\ - FIELD(0, SystemSlotUsage, usage, "")\ - FIELD(0, SystemSlotLength, length, "")\ - FIELD(0, u16, id, "")\ - FIELD(0, SystemSlotFlags1, flags1, "")\ - FIELD(0, SystemSlotFlags2, flags2, "")\ - FIELD(0, u16, segmentGroupNumber, "")\ - FIELD(0, u8, busNumber, "")\ - FIELD(F_INTERNAL, u8, functionAndDeviceNumber, "")\ - FIELD(F_DERIVED, u8, deviceNumber, "")\ - FIELD(F_DERIVED, u8, functionNumber, "") - - -//----------------------------------------------------------------------------- -// OnBoardDevices - -#define OnBoardDeviceType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(video, 3)\ - ENUM(scsi_controller, 4)\ - ENUM(ethernet, 5)\ - ENUM(token_ring, 6)\ - ENUM(sound, 7)\ - ENUM(pata_controller, 8)\ - ENUM(sata_controller, 9)\ - ENUM(sas_controller, 10) - -#define OnBoardDevices_FIELDS\ - FIELD(0, OnBoardDeviceType, type, "")\ - FIELD(0, const char*, description, "")\ - FIELD(F_DERIVED, bool, enabled, "")\ - /* NB: this structure could contain any number of type/description pairs, but Dell BIOS only provides 1 */ - - -//----------------------------------------------------------------------------- -// MemoryArray - -#define MemoryArrayLocation_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(motherboard, 3)\ - ENUM(isa_addon, 4)\ - ENUM(eisa_addon, 5)\ - ENUM(pci_addon, 6)\ - ENUM(mca_addon, 7)\ - ENUM(pcmcia_addon, 8)\ - ENUM(proprietary_addon, 9)\ - ENUM(nubus, 10)\ - ENUM(pc_98_c20, 160)\ - ENUM(pc_98_c24, 161)\ - ENUM(pc_98_e, 162)\ - ENUM(pc_98_local_bus, 163) - -#define MemoryArrayUse_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(system, 3)\ - ENUM(video, 4)\ - ENUM(flash, 5)\ - ENUM(nvram, 6)\ - ENUM(cache, 7) - -#define MemoryArray_FIELDS\ - FIELD(0, MemoryArrayLocation, location, "")\ - FIELD(0, MemoryArrayUse, use, "")\ - FIELD(0, ECC, ecc, "")\ - FIELD(F_INTERNAL, u32, maxCapacity32, "")\ - FIELD(0, Handle, hError, "")\ - FIELD(0, u16, numDevices, "")\ - FIELD(0, Size, maxCapacity, "") - - -//----------------------------------------------------------------------------- -// MemoryDevice - -#define MemoryDeviceFormFactor_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(SIMM, 3)\ - ENUM(SIP, 4)\ - ENUM(chip, 5)\ - ENUM(DIP, 6)\ - ENUM(ZIP, 7)\ - ENUM(proprietary_card, 8)\ - ENUM(DIMM, 9)\ - ENUM(TSOP, 10)\ - ENUM(row_of_chips, 11)\ - ENUM(RIMM, 12)\ - ENUM(SODIMM, 13)\ - ENUM(SRIMM, 14)\ - ENUM(FBDIMM, 15) - -#define MemoryDeviceType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(DRAM, 3)\ - ENUM(EDRAM, 4)\ - ENUM(VRAM, 5)\ - ENUM(SRAM, 6)\ - ENUM(RAM, 7)\ - ENUM(ROM, 8)\ - ENUM(FLASH, 9)\ - ENUM(EEPROM, 10)\ - ENUM(FEPROM, 11)\ - ENUM(EPROM, 12)\ - ENUM(CRRAM, 13)\ - ENUM(_3DRAM, 14)\ - ENUM(SDRAM, 15)\ - ENUM(SGRAM, 16)\ - ENUM(RDRAM, 17)\ - ENUM(DDR, 18)\ - ENUM(DDR2, 19)\ - ENUM(DDR2_FBDIMM, 20)\ - ENUM(DDR3, 24)\ - ENUM(FBD2, 25) - -#define MemoryDeviceTypeFlags_ENUMERATORS\ - ENUM(other, 0x0002)\ - ENUM(unknown, 0x0004)\ - ENUM(fast_paged, 0x0008)\ - ENUM(static_column, 0x0010)\ - ENUM(pseudo_static, 0x0020)\ - ENUM(rambus, 0x0040)\ - ENUM(synchronous, 0x0080)\ - ENUM(cmos, 0x0100)\ - ENUM(edo, 0x0200)\ - ENUM(window_dram, 0x0400)\ - ENUM(cache_dram, 0x0800)\ - ENUM(non_volatile, 0x1000)\ - ENUM(buffered, 0x2000)\ - ENUM(unbuffered, 0x4000) - -#define MemoryDevice_FIELDS\ - FIELD(0, Handle, hMemoryArray, "")\ - FIELD(0, Handle, hError, "")\ - FIELD(0, u16, totalWidth, " bits")\ - FIELD(0, u16, dataWidth, " bits")\ - FIELD(F_INTERNAL, u16, size16, "")\ - FIELD(0, MemoryDeviceFormFactor, formFactor, "")\ - FIELD(0, u8, deviceSet, "")\ - FIELD(0, const char*, locator, "")\ - FIELD(0, const char*, bank, "")\ - FIELD(0, MemoryDeviceType, type, "")\ - FIELD(0, MemoryDeviceTypeFlags, typeFlags, "")\ - FIELD(0, u16, speed, " MHz")\ - FIELD(0, const char*, manufacturer, "")\ - FIELD(0, const char*, serialNumber, "")\ - FIELD(0, const char*, assetTag, "")\ - FIELD(0, const char*, partNumber, "")\ - FIELD(F_INTERNAL, u8, attributes, "")\ - FIELD(F_INTERNAL, u32, size32, "")\ - FIELD(0, u16, configuredSpeed, " MHz")\ - FIELD(F_DERIVED, Size, size, "")\ - FIELD(F_DERIVED, u8, rank, "")\ - - -//----------------------------------------------------------------------------- -// MemoryArrayMappedAddress - -#define MemoryArrayMappedAddress_FIELDS\ - FIELD(F_INTERNAL, u32, startAddress32, "")\ - FIELD(F_INTERNAL, u32, endAddress32, "")\ - FIELD(0, Handle, hMemoryArray, "")\ - FIELD(0, u8, partitionWidth, "")\ - FIELD(F_HEX, u64, startAddress, "")\ - FIELD(F_HEX, u64, endAddress, "") - - -//----------------------------------------------------------------------------- -// MemoryDeviceMappedAddress - -#define MemoryDeviceMappedAddress_FIELDS\ - FIELD(F_INTERNAL, u32, startAddress32, "")\ - FIELD(F_INTERNAL, u32, endAddress32, "")\ - FIELD(0, Handle, hMemoryDevice, "")\ - FIELD(0, Handle, hMemoryArrayMappedAddress, "")\ - FIELD(0, u8, partitionRowPosition, "")\ - FIELD(0, u8, interleavePosition, "")\ - FIELD(0, u8, interleavedDataDepth, "")\ - FIELD(F_HEX, u64, startAddress, "")\ - FIELD(F_HEX, u64, endAddress, "") - - -//---------------------------------------------------------------------------- -// PortableBattery - -#define PortableBatteryChemistry_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(lead_acid, 3)\ - ENUM(nickel_cadmium, 4)\ - ENUM(nickel_metal_hydride, 5)\ - ENUM(lithium_ion, 6)\ - ENUM(zinc_air, 7)\ - ENUM(lithium_polymer, 8) - -#define PortableBattery_FIELDS\ - FIELD(0, const char*, location, "")\ - FIELD(0, const char*, manufacturer, "")\ - FIELD(0, const char*, date, "")\ - FIELD(0, const char*, serialNumber, "")\ - FIELD(0, const char*, deviceName, "")\ - FIELD(0, PortableBatteryChemistry, chemistry, "")\ - FIELD(0, u16, capacity, " mWh")\ - FIELD(0, u16, voltage, " mV")\ - FIELD(0, const char*, sbdsVersion, "")\ - FIELD(0, u8, maxError, "%")\ - FIELD(0, u16, sbdsSerialNumber, "")\ - FIELD(0, u16, sbdsDate, "")\ - FIELD(0, const char*, sbdsChemistry, "")\ - FIELD(0, u8, capacityMultiplier, "")\ - FIELD(0, u32, oemSpecific, "") - - -//---------------------------------------------------------------------------- -// VoltageProbe - -#define VoltageProbeLocation_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(processor, 3)\ - ENUM(disk, 4)\ - ENUM(peripheral_bay, 5)\ - ENUM(system_management_module, 6)\ - ENUM(motherboard, 7)\ - ENUM(memory_module, 8)\ - ENUM(processor_module, 9)\ - ENUM(power_unit, 10)\ - ENUM(add_in_card, 11) - -#define VoltageProbe_FIELDS\ - FIELD(0, const char*, description, "")\ - FIELD(F_INTERNAL, u8, locationAndStatus, "")\ - FIELD(0, i16, maxValue, " mV")\ - FIELD(0, i16, minValue, " mV")\ - FIELD(0, i16, resolution, " x 0.1 mV")\ - FIELD(0, i16, tolerance, " mV")\ - FIELD(0, i16, accuracy, " x 0.01%")\ - FIELD(0, u32, oemDefined, "")\ - FIELD(0, i16, nominalValue, " mv")\ - FIELD(F_DERIVED, VoltageProbeLocation, location, "")\ - FIELD(F_DERIVED, State, status, "") - - -//---------------------------------------------------------------------------- -// CoolingDevice - -#define CoolingDeviceType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(fan, 3)\ - ENUM(centrifugal_blower, 4)\ - ENUM(chip_fan, 5)\ - ENUM(cabinet_fan, 6)\ - ENUM(power_supply_fan, 7)\ - ENUM(heat_pipe, 8)\ - ENUM(integrated_refrigeration, 9)\ - ENUM(active_cooling, 16)\ - ENUM(passive_cooling, 17) - -#define CoolingDevice_FIELDS\ - FIELD(0, Handle, hTemperatureProbe, "")\ - FIELD(F_INTERNAL, u8, typeAndStatus, "")\ - FIELD(0, u8, group, "")\ - FIELD(0, u32, oemDefined, "")\ - FIELD(0, u16, nominalSpeed, " rpm")\ - FIELD(0, const char*, description, "")\ - FIELD(F_DERIVED, CoolingDeviceType, type, "")\ - FIELD(F_DERIVED, State, status, "") - - -//---------------------------------------------------------------------------- -// TemperatureProbe - -#define TemperatureProbeLocation_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(processor, 3)\ - ENUM(disk, 4)\ - ENUM(peripheral_bay, 5)\ - ENUM(system_management_module, 6)\ - ENUM(motherboard, 7)\ - ENUM(memory_module, 8)\ - ENUM(processor_module, 9)\ - ENUM(power_unit, 10)\ - ENUM(add_in_card, 11)\ - ENUM(front_panel_board, 12)\ - ENUM(back_panel_board, 13)\ - ENUM(power_system_board, 14)\ - ENUM(drive_backplane, 15) - -#define TemperatureProbe_FIELDS\ - FIELD(0, const char*, description, "")\ - FIELD(F_INTERNAL, u8, locationAndStatus, "")\ - FIELD(0, i16, maxValue, " dDegC")\ - FIELD(0, i16, minValue, " dDegC")\ - FIELD(0, i16, resolution, " mDegC")\ - FIELD(0, i16, tolerance, " dDegC")\ - FIELD(0, i16, accuracy, " x 0.01%")\ - FIELD(0, u32, oemDefined, "")\ - FIELD(0, i16, nominalValue, " dDegC")\ - FIELD(F_DERIVED, TemperatureProbeLocation, location, "")\ - FIELD(F_DERIVED, State, status, "") - - -//---------------------------------------------------------------------------- -// SystemBoot - -#define SystemBootStatus_ENUMERATORS\ - ENUM(no_error, 0)\ - ENUM(no_bootable_media, 1)\ - ENUM(os_load_failed, 2)\ - ENUM(hardware_failure_firmware, 3)\ - ENUM(hardware_failure_os, 4)\ - ENUM(user_requested_boot, 5)\ - ENUM(security_violation, 6)\ - ENUM(previously_requested_image, 7)\ - ENUM(watchdog_expired, 8) - -#define SystemBoot_FIELDS\ - FIELD(F_INTERNAL, u32, reserved32, "")\ - FIELD(F_INTERNAL, u16, reserved16, "")\ - FIELD(0, SystemBootStatus, status, "")\ - - -//---------------------------------------------------------------------------- -// ManagementDevice - -#define ManagementDeviceType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(LM75, 3)\ - ENUM(LM78, 4)\ - ENUM(LM79, 5)\ - ENUM(LM80, 6)\ - ENUM(LM81, 7)\ - ENUM(ADM9240, 8)\ - ENUM(DS1780, 9)\ - ENUM(M1617, 0xA)\ - ENUM(GL518SM, 0xB)\ - ENUM(W83781D, 0xC)\ - ENUM(HT82H791, 0xD)\ - -#define ManagementDeviceAddressType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(port, 3)\ - ENUM(memory, 4)\ - ENUM(smbus, 5) - -#define ManagementDevice_FIELDS\ - FIELD(0, const char*, description, "")\ - FIELD(0, ManagementDeviceType, type, "")\ - FIELD(0, u32, address, "")\ - FIELD(0, ManagementDeviceAddressType, addressType, "") - - -//---------------------------------------------------------------------------- -// ManagementDeviceComponent - -#define ManagementDeviceComponent_FIELDS\ - FIELD(0, const char*, description, "")\ - FIELD(0, Handle, hDevice, "")\ - FIELD(0, Handle, hComponent, "")\ - FIELD(0, Handle, hThreshold, "") - - -//---------------------------------------------------------------------------- -// ManagementDeviceThreshold - -#define ManagementDeviceThreshold_FIELDS\ - FIELD(0, i16, nonCriticalLo, "")\ - FIELD(0, i16, nonCriticalHi, "")\ - FIELD(0, i16, criticalLo, "")\ - FIELD(0, i16, criticalHi, "")\ - FIELD(0, i16, nonrecoverableLo, "")\ - FIELD(0, i16, nonrecoverableHi, "") - - -//---------------------------------------------------------------------------- -// SystemPowerSupply - -#define SystemPowerSupplyCharacteristics_ENUMERATORS\ - ENUM(hot_replaceable, 1)\ - ENUM(present, 2)\ - ENUM(unplugged, 4) - -#define SystemPowerSupplyType_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(linear, 3)\ - ENUM(switching, 4)\ - ENUM(battery, 5)\ - ENUM(ups, 6)\ - ENUM(converter, 7)\ - ENUM(regulator, 8) - -#define SystemPowerSupplyInputSwitching_ENUMERATORS\ - ENUM(other, 1)\ - ENUM(unknown, 2)\ - ENUM(manual, 3)\ - ENUM(auto_switch, 4)\ - ENUM(wide_range, 5)\ - ENUM(none, 6) - -#define SystemPowerSupply_FIELDS\ - FIELD(0, u8, group, "")\ - FIELD(0, const char*, location, "")\ - FIELD(0, const char*, deviceName, "")\ - FIELD(0, const char*, manufacturer, "")\ - FIELD(0, const char*, serialNumber, "")\ - FIELD(0, const char*, assetTag, "")\ - FIELD(0, const char*, partNumber, "")\ - FIELD(0, const char*, revisionLevel, "")\ - FIELD(0, i16, maxPower, " mW")\ - FIELD(0, SystemPowerSupplyCharacteristics, characteristics, "")\ - FIELD(0, Handle, hVoltageProbe, "")\ - FIELD(0, Handle, hCoolingDevice, "")\ - FIELD(0, Handle, hCurrentProbe, "")\ - FIELD(F_DERIVED, SystemPowerSupplyType, type, "")\ - FIELD(F_DERIVED, State, status, "")\ - FIELD(F_DERIVED, SystemPowerSupplyInputSwitching, inputSwitching, "")\ - - -//---------------------------------------------------------------------------- -// OnboardDevices2 - -#define OnboardDevices2_FIELDS\ - FIELD(0, const char*, referenceDesignation, "")\ - FIELD(0, OnBoardDeviceType, type, "")\ - FIELD(0, u8, instance, "")\ - FIELD(0, u16, groupNumber, "")\ - FIELD(0, u8, busNumber, "")\ - FIELD(F_INTERNAL, u8, functionAndDeviceNumber, "")\ - FIELD(F_DERIVED, bool, enabled, "")\ - FIELD(F_DERIVED, u8, deviceNumber, "")\ - FIELD(F_DERIVED, u8, functionNumber, "")\ - - -//----------------------------------------------------------------------------- - -struct Header -{ - u8 id; - u8 length; - Handle handle; -}; - -// define each enumeration: -#define ENUM(enumerator, value) enumerator = value, -// (a struct wrapper allows reusing common enumerator names such as `other'.) -#define ENUMERATION(name, type)\ - struct name\ - {\ - /* (determines how much data to read from SMBIOS) */\ - typedef type T;\ - name(): value((Enum)0) {}\ - name(size_t num): value((Enum)num) {}\ - /* (the existence of this member type indicates the field is an enum) */\ - enum Enum { name##_ENUMERATORS sentinel } value;\ - /* (allows generic Field comparison against numeric_limits) */\ - operator size_t() const { return value; }\ - }; -ENUMERATIONS -#undef ENUMERATION -#undef ENUM - -// declare each structure -#define FIELD(flags, type, name, units) type name; -#define STRUCTURE(name, id)\ - struct name\ - {\ - /* (allows searching for a structure with a given handle) */\ - Header header;\ - /* (defines a linked list of instances of this structure type) */\ - name* next;\ - name##_FIELDS\ - }; -STRUCTURES -#undef STRUCTURE -#undef FIELD - -// declare a struct holding pointers (freed at exit) to each structure -struct Structures -{ -#define STRUCTURE(name, id) name* name##_; - STRUCTURES -#undef STRUCTURE -}; - -#pragma pack(pop) - - -//----------------------------------------------------------------------------- - -/** - * @return a pointer to a static Structures (i.e. always valid), with its - * member pointers non-zero iff SMBIOS information is available and includes - * the corresponding structure. - * - * thread-safe; return value should be cached (if possible) to avoid an - * atomic comparison. - **/ -const Structures* GetStructures(); - -/** - * @return a string describing all structures (omitting fields with - * meaningless or dummy values). - **/ -std::string StringizeStructures(const Structures*); - -} // namespace SMBIOS - -#endif // #ifndef INCLUDED_SMBIOS diff --git a/source/ps/GameSetup/HWDetect.cpp b/source/ps/GameSetup/HWDetect.cpp index 00f6db7825..bfa7f9f09e 100644 --- a/source/ps/GameSetup/HWDetect.cpp +++ b/source/ps/GameSetup/HWDetect.cpp @@ -33,7 +33,6 @@ #include "lib/sysdep/numa.h" #include "lib/sysdep/os.h" #include "lib/sysdep/os_cpu.h" -#include "lib/sysdep/smbios.h" #include "lib/sysdep/sysdep.h" // sys_OpenFile #include "lib/timer.h" #include "lib/types.h" @@ -309,10 +308,6 @@ void WriteSystemInfo(Renderer::Backend::IDevice* device, const utsname& un) for (const std::string& extension : device->GetExtensions()) fprintf(f, "%s\n", extension.c_str()); - // System Management BIOS (even more text than OpenGL extensions) - std::string smbios = SMBIOS::StringizeStructures(SMBIOS::GetStructures()); - fprintf(f, "\nSMBIOS: \n%s\n", smbios.c_str()); - fclose(f); f = 0; diff --git a/source/tools/lint/cppcheck/suppressions-list.txt b/source/tools/lint/cppcheck/suppressions-list.txt index c035182973..b057508fc9 100644 --- a/source/tools/lint/cppcheck/suppressions-list.txt +++ b/source/tools/lint/cppcheck/suppressions-list.txt @@ -39,7 +39,6 @@ nullPointerArithmetic:source/lib/sysdep/os/win/wposix/wposix_internal.h nullPointerArithmetic:source/lib/sysdep/os/win/wposix/wpthread.cpp nullPointerOutOfMemory:source/lib/sysdep/os/osx/dir_watch.cpp -nullPointerOutOfMemory:source/lib/sysdep/smbios.cpp nullPointerOutOfMemory:source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp preprocessorErrorDirective:source/lib/sysdep/arch.h