libsmbios.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. typedef struct {
  32. UINT8 AnchorString[5];
  33. UINT8 EntryPointStructureChecksum;
  34. UINT8 EntryPointLength;
  35. UINT8 MajorVersion;
  36. UINT8 MinorVersion;
  37. UINT8 DocRev;
  38. UINT8 EntryPointRevision;
  39. UINT8 Reserved;
  40. UINT32 TableMaximumSize;
  41. UINT64 TableAddress;
  42. } SMBIOS3_STRUCTURE_TABLE;
  43. //
  44. // Please note that SMBIOS structures can be odd byte aligned since the
  45. // unformated section of each record is a set of arbitrary size strings.
  46. //
  47. typedef struct {
  48. UINT8 Type;
  49. UINT8 Length;
  50. UINT8 Handle[2];
  51. } SMBIOS_HEADER;
  52. typedef UINT8 SMBIOS_STRING;
  53. typedef struct {
  54. SMBIOS_HEADER Hdr;
  55. SMBIOS_STRING Vendor;
  56. SMBIOS_STRING BiosVersion;
  57. UINT8 BiosSegment[2];
  58. SMBIOS_STRING BiosReleaseDate;
  59. UINT8 BiosSize;
  60. UINT8 BiosCharacteristics[8];
  61. } SMBIOS_TYPE0;
  62. typedef struct {
  63. SMBIOS_HEADER Hdr;
  64. SMBIOS_STRING Manufacturer;
  65. SMBIOS_STRING ProductName;
  66. SMBIOS_STRING Version;
  67. SMBIOS_STRING SerialNumber;
  68. //
  69. // always byte copy this data to prevent alignment faults!
  70. //
  71. EFI_GUID Uuid;
  72. UINT8 WakeUpType;
  73. } SMBIOS_TYPE1;
  74. typedef struct {
  75. SMBIOS_HEADER Hdr;
  76. SMBIOS_STRING Manufacturer;
  77. SMBIOS_STRING ProductName;
  78. SMBIOS_STRING Version;
  79. SMBIOS_STRING SerialNumber;
  80. } SMBIOS_TYPE2;
  81. typedef struct {
  82. SMBIOS_HEADER Hdr;
  83. SMBIOS_STRING Manufacturer;
  84. UINT8 Type;
  85. SMBIOS_STRING Version;
  86. SMBIOS_STRING SerialNumber;
  87. SMBIOS_STRING AssetTag;
  88. UINT8 BootupState;
  89. UINT8 PowerSupplyState;
  90. UINT8 ThermalState;
  91. UINT8 SecurityStatus;
  92. UINT8 OemDefined[4];
  93. } SMBIOS_TYPE3;
  94. typedef struct {
  95. SMBIOS_HEADER Hdr;
  96. UINT8 Socket;
  97. UINT8 ProcessorType;
  98. UINT8 ProcessorFamily;
  99. SMBIOS_STRING ProcessorManufacture;
  100. UINT8 ProcessorId[8];
  101. SMBIOS_STRING ProcessorVersion;
  102. UINT8 Voltage;
  103. UINT8 ExternalClock[2];
  104. UINT8 MaxSpeed[2];
  105. UINT8 CurrentSpeed[2];
  106. UINT8 Status;
  107. UINT8 ProcessorUpgrade;
  108. UINT8 L1CacheHandle[2];
  109. UINT8 L2CacheHandle[2];
  110. UINT8 L3CacheHandle[2];
  111. } SMBIOS_TYPE4;
  112. typedef union {
  113. SMBIOS_HEADER *Hdr;
  114. SMBIOS_TYPE0 *Type0;
  115. SMBIOS_TYPE1 *Type1;
  116. SMBIOS_TYPE2 *Type2;
  117. SMBIOS_TYPE3 *Type3;
  118. SMBIOS_TYPE4 *Type4;
  119. UINT8 *Raw;
  120. } SMBIOS_STRUCTURE_POINTER;
  121. #pragma pack()
  122. #endif