libsmbios.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #ifndef _LIB_SMBIOS_H
  2. #define _LIB_SMBIOS_H
  3. /*++
  4. Copyright (c) 2000 Intel Corporation
  5. Module Name:
  6. LibSmbios.h
  7. Abstract:
  8. Lib include for SMBIOS services. Used to get system serial number and GUID
  9. Revision History
  10. --*/
  11. //
  12. // Define SMBIOS tables.
  13. //
  14. #pragma pack(1)
  15. typedef struct {
  16. UINT8 AnchorString[4];
  17. UINT8 EntryPointStructureChecksum;
  18. UINT8 EntryPointLength;
  19. UINT8 MajorVersion;
  20. UINT8 MinorVersion;
  21. UINT16 MaxStructureSize;
  22. UINT8 EntryPointRevision;
  23. UINT8 FormattedArea[5];
  24. UINT8 IntermediateAnchorString[5];
  25. UINT8 IntermediateChecksum;
  26. UINT16 TableLength;
  27. UINT32 TableAddress;
  28. UINT16 NumberOfSmbiosStructures;
  29. UINT8 SmbiosBcdRevision;
  30. } SMBIOS_STRUCTURE_TABLE;
  31. //
  32. // Please note that SMBIOS structures can be odd byte aligned since the
  33. // unformated section of each record is a set of arbitrary size strings.
  34. //
  35. typedef struct {
  36. UINT8 Type;
  37. UINT8 Length;
  38. UINT8 Handle[2];
  39. } SMBIOS_HEADER;
  40. typedef UINT8 SMBIOS_STRING;
  41. typedef struct {
  42. SMBIOS_HEADER Hdr;
  43. SMBIOS_STRING Vendor;
  44. SMBIOS_STRING BiosVersion;
  45. UINT8 BiosSegment[2];
  46. SMBIOS_STRING BiosReleaseDate;
  47. UINT8 BiosSize;
  48. UINT8 BiosCharacteristics[8];
  49. } SMBIOS_TYPE0;
  50. typedef struct {
  51. SMBIOS_HEADER Hdr;
  52. SMBIOS_STRING Manufacturer;
  53. SMBIOS_STRING ProductName;
  54. SMBIOS_STRING Version;
  55. SMBIOS_STRING SerialNumber;
  56. //
  57. // always byte copy this data to prevent alignment faults!
  58. //
  59. EFI_GUID Uuid;
  60. UINT8 WakeUpType;
  61. } SMBIOS_TYPE1;
  62. typedef struct {
  63. SMBIOS_HEADER Hdr;
  64. SMBIOS_STRING Manufacturer;
  65. SMBIOS_STRING ProductName;
  66. SMBIOS_STRING Version;
  67. SMBIOS_STRING SerialNumber;
  68. } SMBIOS_TYPE2;
  69. typedef struct {
  70. SMBIOS_HEADER Hdr;
  71. SMBIOS_STRING Manufacturer;
  72. UINT8 Type;
  73. SMBIOS_STRING Version;
  74. SMBIOS_STRING SerialNumber;
  75. SMBIOS_STRING AssetTag;
  76. UINT8 BootupState;
  77. UINT8 PowerSupplyState;
  78. UINT8 ThermalState;
  79. UINT8 SecurityStatus;
  80. UINT8 OemDefined[4];
  81. } SMBIOS_TYPE3;
  82. typedef struct {
  83. SMBIOS_HEADER Hdr;
  84. UINT8 Socket;
  85. UINT8 ProcessorType;
  86. UINT8 ProcessorFamily;
  87. SMBIOS_STRING ProcessorManufacture;
  88. UINT8 ProcessorId[8];
  89. SMBIOS_STRING ProcessorVersion;
  90. UINT8 Voltage;
  91. UINT8 ExternalClock[2];
  92. UINT8 MaxSpeed[2];
  93. UINT8 CurrentSpeed[2];
  94. UINT8 Status;
  95. UINT8 ProcessorUpgrade;
  96. UINT8 L1CacheHandle[2];
  97. UINT8 L2CacheHandle[2];
  98. UINT8 L3CacheHandle[2];
  99. } SMBIOS_TYPE4;
  100. typedef union {
  101. SMBIOS_HEADER *Hdr;
  102. SMBIOS_TYPE0 *Type0;
  103. SMBIOS_TYPE1 *Type1;
  104. SMBIOS_TYPE2 *Type2;
  105. SMBIOS_TYPE3 *Type3;
  106. SMBIOS_TYPE4 *Type4;
  107. UINT8 *Raw;
  108. } SMBIOS_STRUCTURE_POINTER;
  109. #pragma pack()
  110. #endif