]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Smbios.h
MdePkg/ProcessorBind: add defines for page allocation granularity
[mirror_edk2.git] / MdePkg / Include / Protocol / Smbios.h
CommitLineData
6a0cd52d 1/** @file\r
2 SMBIOS Protocol as defined in PI1.2 Specification VOLUME 5 Standard.\r
3\r
4 SMBIOS protocol allows consumers to log SMBIOS data records, and enables the producer \r
5 to create the SMBIOS tables for a platform.\r
6\r
7 This protocol provides an interface to add, remove or discover SMBIOS records. The driver which\r
8 produces this protocol is responsible for creating the SMBIOS data tables and installing the pointer\r
9 to the tables in the EFI System Configuration Table.\r
10 The caller is responsible for only adding SMBIOS records that are valid for the SMBIOS\r
11 MajorVersion and MinorVersion. When an enumerated SMBIOS field's values are\r
12 controlled by the DMTF, new values can be used as soon as they are defined by the DMTF without\r
13 requiring an update to MajorVersion and MinorVersion.\r
14 The SMBIOS protocol can only be called a TPL < TPL_NOTIFY.\r
15\r
2002bf5d 16 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
9df063a0 17 This program and the accompanying materials \r
6a0cd52d 18 are licensed and made available under the terms and conditions of the BSD License \r
19 which accompanies this distribution. The full text of the license may be found at \r
20 http://opensource.org/licenses/bsd-license.php \r
21\r
22 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
23 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
24\r
25**/\r
26\r
27#ifndef __SMBIOS_PROTOCOL_H__\r
28#define __SMBIOS_PROTOCOL_H__\r
29\r
bb7051eb
MH
30#include <IndustryStandard/SmBios.h>\r
31\r
6a0cd52d 32#define EFI_SMBIOS_PROTOCOL_GUID \\r
33 { 0x3583ff6, 0xcb36, 0x4940, { 0x94, 0x7e, 0xb9, 0xb3, 0x9f, 0x4a, 0xfa, 0xf7 }}\r
6a0cd52d 34\r
bb7051eb
MH
35#define EFI_SMBIOS_TYPE_BIOS_INFORMATION SMBIOS_TYPE_BIOS_INFORMATION\r
36#define EFI_SMBIOS_TYPE_SYSTEM_INFORMATION SMBIOS_TYPE_SYSTEM_INFORMATION\r
37#define EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION SMBIOS_TYPE_BASEBOARD_INFORMATION\r
38#define EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE SMBIOS_TYPE_SYSTEM_ENCLOSURE\r
39#define EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION SMBIOS_TYPE_PROCESSOR_INFORMATION\r
40#define EFI_SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION\r
41#define EFI_SMBIOS_TYPE_MEMORY_MODULE_INFORMATON SMBIOS_TYPE_MEMORY_MODULE_INFORMATON\r
42#define EFI_SMBIOS_TYPE_CACHE_INFORMATION SMBIOS_TYPE_CACHE_INFORMATION\r
43#define EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION\r
44#define EFI_SMBIOS_TYPE_SYSTEM_SLOTS SMBIOS_TYPE_SYSTEM_SLOTS\r
45#define EFI_SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION\r
46#define EFI_SMBIOS_TYPE_OEM_STRINGS SMBIOS_TYPE_OEM_STRINGS\r
47#define EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS\r
48#define EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION\r
49#define EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS SMBIOS_TYPE_GROUP_ASSOCIATIONS\r
50#define EFI_SMBIOS_TYPE_SYSTEM_EVENT_LOG SMBIOS_TYPE_SYSTEM_EVENT_LOG\r
51#define EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY\r
52#define EFI_SMBIOS_TYPE_MEMORY_DEVICE SMBIOS_TYPE_MEMORY_DEVICE\r
53#define EFI_SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION\r
54#define EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS\r
55#define EFI_SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS\r
56#define EFI_SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE\r
57#define EFI_SMBIOS_TYPE_PORTABLE_BATTERY SMBIOS_TYPE_PORTABLE_BATTERY\r
58#define EFI_SMBIOS_TYPE_SYSTEM_RESET SMBIOS_TYPE_SYSTEM_RESET\r
59#define EFI_SMBIOS_TYPE_HARDWARE_SECURITY SMBIOS_TYPE_HARDWARE_SECURITY\r
60#define EFI_SMBIOS_TYPE_SYSTEM_POWER_CONTROLS SMBIOS_TYPE_SYSTEM_POWER_CONTROLS\r
61#define EFI_SMBIOS_TYPE_VOLTAGE_PROBE SMBIOS_TYPE_VOLTAGE_PROBE\r
62#define EFI_SMBIOS_TYPE_COOLING_DEVICE SMBIOS_TYPE_COOLING_DEVICE\r
63#define EFI_SMBIOS_TYPE_TEMPERATURE_PROBE SMBIOS_TYPE_TEMPERATURE_PROBE\r
64#define EFI_SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE\r
65#define EFI_SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS\r
66#define EFI_SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE\r
67#define EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION\r
68#define EFI_SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION\r
69#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE SMBIOS_TYPE_MANAGEMENT_DEVICE\r
70#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT\r
71#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA\r
72#define EFI_SMBIOS_TYPE_MEMORY_CHANNEL SMBIOS_TYPE_MEMORY_CHANNEL\r
73#define EFI_SMBIOS_TYPE_IPMI_DEVICE_INFORMATION SMBIOS_TYPE_IPMI_DEVICE_INFORMATION\r
74#define EFI_SMBIOS_TYPE_SYSTEM_POWER_SUPPLY SMBIOS_TYPE_SYSTEM_POWER_SUPPLY\r
75#define EFI_SMBIOS_TYPE_ADDITIONAL_INFORMATION SMBIOS_TYPE_ADDITIONAL_INFORMATION\r
76#define EFI_SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION\r
77#define EFI_SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE\r
78#define EFI_SMBIOS_TYPE_INACTIVE SMBIOS_TYPE_INACTIVE\r
79#define EFI_SMBIOS_TYPE_END_OF_TABLE SMBIOS_TYPE_END_OF_TABLE\r
80#define EFI_SMBIOS_OEM_BEGIN SMBIOS_OEM_BEGIN\r
81#define EFI_SMBIOS_OEM_END SMBIOS_OEM_END\r
6a0cd52d 82\r
bb7051eb
MH
83typedef SMBIOS_TABLE_STRING EFI_SMBIOS_STRING;\r
84typedef SMBIOS_TYPE EFI_SMBIOS_TYPE;\r
85typedef SMBIOS_HANDLE EFI_SMBIOS_HANDLE;\r
86typedef SMBIOS_STRUCTURE EFI_SMBIOS_TABLE_HEADER;\r
6a0cd52d 87 \r
88typedef struct _EFI_SMBIOS_PROTOCOL EFI_SMBIOS_PROTOCOL;\r
89\r
90/**\r
91 Add an SMBIOS record.\r
92 \r
93 This function allows any agent to add SMBIOS records. The caller is responsible for ensuring\r
94 Record is formatted in a way that matches the version of the SMBIOS specification as defined in\r
95 the MajorRevision and MinorRevision fields of the EFI_SMBIOS_PROTOCOL.\r
96 Record must follow the SMBIOS structure evolution and usage guidelines in the SMBIOS\r
97 specification. Record starts with the formatted area of the SMBIOS structure and the length is\r
98 defined by EFI_SMBIOS_TABLE_HEADER.Length. Each SMBIOS structure is terminated by a\r
99 double-null (0x0000), either directly following the formatted area (if no strings are present) or\r
100 directly following the last string. The number of optional strings is not defined by the formatted area,\r
101 but is fixed by the call to Add(). A string can be a place holder, but it must not be a NULL string as\r
102 two NULL strings look like the double-null that terminates the structure.\r
103 \r
104 @param[in] This The EFI_SMBIOS_PROTOCOL instance.\r
105 @param[in] ProducerHandle The handle of the controller or driver associated with the SMBIOS information. NULL means no handle.\r
eb2423c9
SZ
106 @param[in, out] SmbiosHandle On entry, the handle of the SMBIOS record to add. If FFFEh, then a unique handle\r
107 will be assigned to the SMBIOS record. If the SMBIOS handle is already in use,\r
6a0cd52d 108 EFI_ALREADY_STARTED is returned and the SMBIOS record is not updated.\r
109 @param[in] Record The data for the fixed portion of the SMBIOS record. The format of the record is\r
110 determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted\r
111 area is defined by EFI_SMBIOS_TABLE_HEADER.Length and either followed\r
112 by a double-null (0x0000) or a set of null terminated strings and a null.\r
113 \r
114 @retval EFI_SUCCESS Record was added.\r
115 @retval EFI_OUT_OF_RESOURCES Record was not added.\r
116 @retval EFI_ALREADY_STARTED The SmbiosHandle passed in was already in use.\r
117**/\r
118typedef\r
119EFI_STATUS\r
120(EFIAPI *EFI_SMBIOS_ADD)(\r
121 IN CONST EFI_SMBIOS_PROTOCOL *This,\r
3e22fec9 122 IN EFI_HANDLE ProducerHandle OPTIONAL,\r
6a0cd52d 123 IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle,\r
124 IN EFI_SMBIOS_TABLE_HEADER *Record\r
125);\r
126\r
127/**\r
128 Update the string associated with an existing SMBIOS record.\r
129 \r
130 This function allows the update of specific SMBIOS strings. The number of valid strings for any\r
131 SMBIOS record is defined by how many strings were present when Add() was called.\r
132 \r
133 @param[in] This The EFI_SMBIOS_PROTOCOL instance.\r
134 @param[in] SmbiosHandle SMBIOS Handle of structure that will have its string updated.\r
135 @param[in] StringNumber The non-zero string number of the string to update.\r
136 @param[in] String Update the StringNumber string with String.\r
137 \r
138 @retval EFI_SUCCESS SmbiosHandle had its StringNumber String updated.\r
139 @retval EFI_INVALID_PARAMETER SmbiosHandle does not exist.\r
eb2423c9 140 @retval EFI_UNSUPPORTED String was not added because it is longer than the SMBIOS Table supports.\r
6a0cd52d 141 @retval EFI_NOT_FOUND The StringNumber.is not valid for this SMBIOS record. \r
142**/\r
143typedef\r
144EFI_STATUS\r
145(EFIAPI *EFI_SMBIOS_UPDATE_STRING)(\r
146 IN CONST EFI_SMBIOS_PROTOCOL *This,\r
147 IN EFI_SMBIOS_HANDLE *SmbiosHandle,\r
148 IN UINTN *StringNumber,\r
149 IN CHAR8 *String\r
150);\r
151\r
152/**\r
153 Remove an SMBIOS record.\r
154 \r
155 This function removes an SMBIOS record using the handle specified by SmbiosHandle.\r
156 \r
157 @param[in] This The EFI_SMBIOS_PROTOCOL instance.\r
158 @param[in] SmbiosHandle The handle of the SMBIOS record to remove.\r
159 \r
160 @retval EFI_SUCCESS SMBIOS record was removed.\r
161 @retval EFI_INVALID_PARAMETER SmbiosHandle does not specify a valid SMBIOS record.\r
162**/\r
163typedef\r
164EFI_STATUS\r
165(EFIAPI *EFI_SMBIOS_REMOVE)(\r
166 IN CONST EFI_SMBIOS_PROTOCOL *This,\r
167 IN EFI_SMBIOS_HANDLE SmbiosHandle\r
168);\r
169\r
170/**\r
171 Allow the caller to discover all or some of the SMBIOS records.\r
172 \r
173 This function allows all of the SMBIOS records to be discovered. It's possible to find\r
174 only the SMBIOS records that match the optional Type argument.\r
175 \r
176 @param[in] This The EFI_SMBIOS_PROTOCOL instance.\r
177 @param[in, out] SmbiosHandle On entry, points to the previous handle of the SMBIOS record. On exit, points to the\r
eb2423c9
SZ
178 next SMBIOS record handle. If it is FFFEh on entry, then the first SMBIOS record\r
179 handle will be returned. If it returns FFFEh on exit, then there are no more SMBIOS records.\r
6a0cd52d 180 @param[in] Type On entry, it points to the type of the next SMBIOS record to return. If NULL, it\r
181 indicates that the next record of any type will be returned. Type is not\r
182 modified by the this function.\r
183 @param[out] Record On exit, points to a pointer to the the SMBIOS Record consisting of the formatted area\r
184 followed by the unformatted area. The unformatted area optionally contains text strings.\r
185 @param[out] ProducerHandle On exit, points to the ProducerHandle registered by Add(). If no\r
186 ProducerHandle was passed into Add() NULL is returned. If a NULL pointer is\r
187 passed in no data will be returned.\r
188 @retval EFI_SUCCESS SMBIOS record information was successfully returned in Record.\r
189 SmbiosHandle is the handle of the current SMBIOS record\r
190 @retval EFI_NOT_FOUND The SMBIOS record with SmbiosHandle was the last available record.\r
191**/\r
192typedef\r
193EFI_STATUS\r
194(EFIAPI *EFI_SMBIOS_GET_NEXT)(\r
195 IN CONST EFI_SMBIOS_PROTOCOL *This,\r
196 IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle,\r
3e22fec9 197 IN EFI_SMBIOS_TYPE *Type OPTIONAL,\r
6a0cd52d 198 OUT EFI_SMBIOS_TABLE_HEADER **Record,\r
3e22fec9 199 OUT EFI_HANDLE *ProducerHandle OPTIONAL\r
6a0cd52d 200);\r
201\r
202struct _EFI_SMBIOS_PROTOCOL {\r
203 EFI_SMBIOS_ADD Add;\r
204 EFI_SMBIOS_UPDATE_STRING UpdateString;\r
205 EFI_SMBIOS_REMOVE Remove;\r
206 EFI_SMBIOS_GET_NEXT GetNext;\r
207 UINT8 MajorVersion; ///< The major revision of the SMBIOS specification supported.\r
208 UINT8 MinorVersion; ///< The minor revision of the SMBIOS specification supported.\r
209};\r
210 \r
211extern EFI_GUID gEfiSmbiosProtocolGuid;\r
212 \r
213#endif // __SMBIOS_PROTOCOL_H__\r