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