]>
Commit | Line | Data |
---|---|---|
fb3df220 | 1 | /** @file\r |
50a64e5b | 2 | Provides services to log status code records.\r |
fb3df220 | 3 | \r |
9095d37b LG |
4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials are licensed and made available under\r | |
6 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
af2dc6a7 | 7 | The full text of the license may be found at\r |
8 | http://opensource.org/licenses/bsd-license.php.\r | |
fb3df220 | 9 | \r |
50a64e5b | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
fb3df220 | 12 | \r |
13 | **/\r | |
14 | \r | |
15 | #ifndef __REPORT_STATUS_CODE_LIB_H__\r | |
16 | #define __REPORT_STATUS_CODE_LIB_H__\r | |
17 | \r | |
2af44cf0 | 18 | #include <Uefi/UefiBaseType.h>\r |
d7dfd027 | 19 | #include <Pi/PiStatusCode.h>\r |
c7d265a9 | 20 | #include <Protocol/DevicePath.h>\r |
21 | \r | |
fb3df220 | 22 | //\r |
23 | // Declare bits for PcdReportStatusCodePropertyMask\r | |
24 | //\r | |
25 | #define REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED 0x00000001\r | |
26 | #define REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED 0x00000002\r | |
27 | #define REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED 0x00000004\r | |
28 | \r | |
fb3df220 | 29 | /**\r |
30 | Converts a status code to an 8-bit POST code value.\r | |
31 | \r | |
9095d37b LG |
32 | Converts the status code specified by CodeType and Value to an 8-bit POST code\r |
33 | and returns the 8-bit POST code in PostCode. If CodeType is an\r | |
34 | EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode\r | |
35 | are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits\r | |
36 | 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.\r | |
fb3df220 | 37 | \r |
38 | If PostCode is NULL, then ASSERT().\r | |
39 | \r | |
40 | @param CodeType The type of status code being converted.\r | |
41 | @param Value The status code value being converted.\r | |
9095d37b | 42 | @param PostCode A pointer to the 8-bit POST code value to return.\r |
fb3df220 | 43 | \r |
9095d37b | 44 | @retval TRUE The status code specified by CodeType and Value was converted\r |
af2dc6a7 | 45 | to an 8-bit POST code and returned in PostCode.\r |
9095d37b | 46 | @retval FALSE The status code specified by CodeType and Value could not be\r |
fb3df220 | 47 | converted to an 8-bit POST code value.\r |
48 | \r | |
49 | **/\r | |
50 | BOOLEAN\r | |
51 | EFIAPI\r | |
52 | CodeTypeToPostCode (\r | |
53 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
54 | IN EFI_STATUS_CODE_VALUE Value,\r | |
55 | OUT UINT8 *PostCode\r | |
56 | );\r | |
57 | \r | |
58 | \r | |
59 | /**\r | |
60 | Extracts ASSERT() information from a status code structure.\r | |
61 | \r | |
62 | Converts the status code specified by CodeType, Value, and Data to the ASSERT()\r | |
9095d37b LG |
63 | arguments specified by Filename, Description, and LineNumber. If CodeType is\r |
64 | an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and\r | |
65 | Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract\r | |
66 | Filename, Description, and LineNumber from the optional data area of the\r | |
67 | status code buffer specified by Data. The optional data area of Data contains\r | |
68 | a Null-terminated ASCII string for the FileName, followed by a Null-terminated\r | |
69 | ASCII string for the Description, followed by a 32-bit LineNumber. If the\r | |
70 | ASSERT() information could be extracted from Data, then return TRUE.\r | |
71 | Otherwise, FALSE is returned.\r | |
fb3df220 | 72 | \r |
73 | If Data is NULL, then ASSERT().\r | |
74 | If Filename is NULL, then ASSERT().\r | |
75 | If Description is NULL, then ASSERT().\r | |
76 | If LineNumber is NULL, then ASSERT().\r | |
77 | \r | |
78 | @param CodeType The type of status code being converted.\r | |
79 | @param Value The status code value being converted.\r | |
9095d37b | 80 | @param Data The pointer to status code data buffer.\r |
af2dc6a7 | 81 | @param Filename The pointer to the source file name that generated the ASSERT().\r |
82 | @param Description The pointer to the description of the ASSERT().\r | |
83 | @param LineNumber The pointer to source line number that generated the ASSERT().\r | |
fb3df220 | 84 | \r |
9095d37b LG |
85 | @retval TRUE The status code specified by CodeType, Value, and Data was\r |
86 | converted ASSERT() arguments specified by Filename, Description,\r | |
fb3df220 | 87 | and LineNumber.\r |
9095d37b | 88 | @retval FALSE The status code specified by CodeType, Value, and Data could\r |
fb3df220 | 89 | not be converted to ASSERT() arguments.\r |
90 | \r | |
91 | **/\r | |
92 | BOOLEAN\r | |
93 | EFIAPI\r | |
94 | ReportStatusCodeExtractAssertInfo (\r | |
95 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
9095d37b LG |
96 | IN EFI_STATUS_CODE_VALUE Value,\r |
97 | IN CONST EFI_STATUS_CODE_DATA *Data,\r | |
fb3df220 | 98 | OUT CHAR8 **Filename,\r |
99 | OUT CHAR8 **Description,\r | |
100 | OUT UINT32 *LineNumber\r | |
101 | );\r | |
102 | \r | |
103 | \r | |
104 | /**\r | |
105 | Extracts DEBUG() information from a status code structure.\r | |
106 | \r | |
9095d37b LG |
107 | Converts the status code specified by Data to the DEBUG() arguments specified\r |
108 | by ErrorLevel, Marker, and Format. If type GUID in Data is\r | |
109 | EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and\r | |
110 | Format from the optional data area of the status code buffer specified by Data.\r | |
111 | The optional data area of Data contains a 32-bit ErrorLevel followed by Marker\r | |
112 | which is 12 UINTN parameters, followed by a Null-terminated ASCII string for\r | |
113 | the Format. If the DEBUG() information could be extracted from Data, then\r | |
fb3df220 | 114 | return TRUE. Otherwise, FALSE is returned.\r |
115 | \r | |
116 | If Data is NULL, then ASSERT().\r | |
117 | If ErrorLevel is NULL, then ASSERT().\r | |
118 | If Marker is NULL, then ASSERT().\r | |
119 | If Format is NULL, then ASSERT().\r | |
120 | \r | |
9095d37b | 121 | @param Data The pointer to status code data buffer.\r |
af2dc6a7 | 122 | @param ErrorLevel The pointer to error level mask for a debug message.\r |
123 | @param Marker The pointer to the variable argument list associated with Format.\r | |
9095d37b | 124 | @param Format The pointer to a Null-terminated ASCII format string of a\r |
fb3df220 | 125 | debug message.\r |
126 | \r | |
9095d37b | 127 | @retval TRUE The status code specified by Data was converted DEBUG() arguments\r |
fb3df220 | 128 | specified by ErrorLevel, Marker, and Format.\r |
9095d37b | 129 | @retval FALSE The status code specified by Data could not be converted to\r |
fb3df220 | 130 | DEBUG() arguments.\r |
131 | \r | |
132 | **/\r | |
133 | BOOLEAN\r | |
134 | EFIAPI\r | |
135 | ReportStatusCodeExtractDebugInfo (\r | |
9095d37b | 136 | IN CONST EFI_STATUS_CODE_DATA *Data,\r |
fb3df220 | 137 | OUT UINT32 *ErrorLevel,\r |
2075236e | 138 | OUT BASE_LIST *Marker,\r |
fb3df220 | 139 | OUT CHAR8 **Format\r |
140 | );\r | |
141 | \r | |
142 | \r | |
143 | /**\r | |
144 | Reports a status code.\r | |
145 | \r | |
9095d37b LG |
146 | Reports the status code specified by the parameters Type and Value. Status\r |
147 | code also require an instance, caller ID, and extended data. This function\r | |
148 | passed in a zero instance, NULL extended data, and a caller ID of\r | |
149 | gEfiCallerIdGuid, which is the GUID for the module.\r | |
150 | \r | |
151 | ReportStatusCode()must actively prevent recursion. If ReportStatusCode()\r | |
fb3df220 | 152 | is called while processing another any other Report Status Code Library function,\r |
153 | then ReportStatusCode() must return immediately.\r | |
154 | \r | |
9095d37b | 155 | @param Type Status code type.\r |
fb3df220 | 156 | @param Value Status code value.\r |
157 | \r | |
158 | @retval EFI_SUCCESS The status code was reported.\r | |
9095d37b | 159 | @retval EFI_DEVICE_ERROR There status code could not be reported due to a\r |
fb3df220 | 160 | device error.\r |
af2dc6a7 | 161 | @retval EFI_UNSUPPORTED The report status code is not supported.\r |
fb3df220 | 162 | \r |
163 | **/\r | |
164 | EFI_STATUS\r | |
165 | EFIAPI\r | |
166 | ReportStatusCode (\r | |
167 | IN EFI_STATUS_CODE_TYPE Type,\r | |
168 | IN EFI_STATUS_CODE_VALUE Value\r | |
169 | );\r | |
170 | \r | |
171 | \r | |
172 | /**\r | |
173 | Reports a status code with a Device Path Protocol as the extended data.\r | |
174 | \r | |
9095d37b LG |
175 | Allocates and fills in the extended data section of a status code with the\r |
176 | Device Path Protocol specified by DevicePath. This function is responsible\r | |
177 | for allocating a buffer large enough for the standard header and the device\r | |
1f25dacf LG |
178 | path. The standard header is filled in with an implementation dependent GUID.\r |
179 | The status code is reported with a zero instance and a caller ID of gEfiCallerIdGuid.\r | |
fb3df220 | 180 | \r |
9095d37b LG |
181 | ReportStatusCodeWithDevicePath()must actively prevent recursion. If\r |
182 | ReportStatusCodeWithDevicePath() is called while processing another any other\r | |
183 | Report Status Code Library function, then ReportStatusCodeWithDevicePath()\r | |
fb3df220 | 184 | must return EFI_DEVICE_ERROR immediately.\r |
185 | \r | |
186 | If DevicePath is NULL, then ASSERT().\r | |
187 | \r | |
9095d37b | 188 | @param Type The status code type.\r |
af2dc6a7 | 189 | @param Value The status code value.\r |
190 | @param DevicePath The pointer to the Device Path Protocol to be reported.\r | |
fb3df220 | 191 | \r |
9095d37b | 192 | @retval EFI_SUCCESS The status code was reported with the extended\r |
fb3df220 | 193 | data specified by DevicePath.\r |
9095d37b | 194 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the\r |
fb3df220 | 195 | extended data section.\r |
af2dc6a7 | 196 | @retval EFI_UNSUPPORTED The report status code is not supported.\r |
6d6a1098 | 197 | @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function\r |
198 | is already in progress.\r | |
fb3df220 | 199 | \r |
200 | **/\r | |
201 | EFI_STATUS\r | |
202 | EFIAPI\r | |
203 | ReportStatusCodeWithDevicePath (\r | |
204 | IN EFI_STATUS_CODE_TYPE Type,\r | |
205 | IN EFI_STATUS_CODE_VALUE Value,\r | |
206 | IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
207 | );\r | |
208 | \r | |
209 | \r | |
210 | /**\r | |
211 | Reports a status code with an extended data buffer.\r | |
212 | \r | |
9095d37b LG |
213 | Allocates and fills in the extended data section of a status code with the\r |
214 | extended data specified by ExtendedData and ExtendedDataSize. ExtendedData\r | |
215 | is assumed to be one of the data structures specified in Related Definitions.\r | |
216 | These data structure do not have the standard header, so this function is\r | |
217 | responsible for allocating a buffer large enough for the standard header and\r | |
218 | the extended data passed into this function. The standard header is filled\r | |
219 | in with an implementation dependent GUID. The status code is reported\r | |
fb3df220 | 220 | with a zero instance and a caller ID of gEfiCallerIdGuid.\r |
221 | \r | |
9095d37b LG |
222 | ReportStatusCodeWithExtendedData()must actively prevent recursion. If\r |
223 | ReportStatusCodeWithExtendedData() is called while processing another any other\r | |
224 | Report Status Code Library function, then ReportStatusCodeWithExtendedData()\r | |
fb3df220 | 225 | must return EFI_DEVICE_ERROR immediately.\r |
226 | \r | |
227 | If ExtendedData is NULL, then ASSERT().\r | |
228 | If ExtendedDataSize is 0, then ASSERT().\r | |
229 | \r | |
9095d37b | 230 | @param Type The status code type.\r |
af2dc6a7 | 231 | @param Value The status code value.\r |
232 | @param ExtendedData The pointer to the extended data buffer to be reported.\r | |
9095d37b | 233 | @param ExtendedDataSize The size, in bytes, of the extended data buffer to\r |
fb3df220 | 234 | be reported.\r |
235 | \r | |
9095d37b | 236 | @retval EFI_SUCCESS The status code was reported with the extended\r |
fb3df220 | 237 | data specified by ExtendedData and ExtendedDataSize.\r |
9095d37b | 238 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the\r |
fb3df220 | 239 | extended data section.\r |
af2dc6a7 | 240 | @retval EFI_UNSUPPORTED The report status code is not supported.\r |
6d6a1098 | 241 | @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function\r |
242 | is already in progress.\r | |
fb3df220 | 243 | \r |
244 | **/\r | |
245 | EFI_STATUS\r | |
246 | EFIAPI\r | |
247 | ReportStatusCodeWithExtendedData (\r | |
248 | IN EFI_STATUS_CODE_TYPE Type,\r | |
249 | IN EFI_STATUS_CODE_VALUE Value,\r | |
250 | IN CONST VOID *ExtendedData,\r | |
251 | IN UINTN ExtendedDataSize\r | |
252 | );\r | |
253 | \r | |
254 | \r | |
255 | /**\r | |
256 | Reports a status code with full parameters.\r | |
257 | \r | |
9095d37b LG |
258 | The function reports a status code. If ExtendedData is NULL and ExtendedDataSize\r |
259 | is 0, then an extended data buffer is not reported. If ExtendedData is not\r | |
260 | NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.\r | |
261 | ExtendedData is assumed not have the standard status code header, so this function\r | |
262 | is responsible for allocating a buffer large enough for the standard header and\r | |
263 | the extended data passed into this function. The standard header is filled in\r | |
264 | with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a\r | |
265 | GUID of gEfiStatusCodeSpecificDataGuid is used. The status code is reported with\r | |
266 | an instance specified by Instance and a caller ID specified by CallerId. If\r | |
fb3df220 | 267 | CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.\r |
268 | \r | |
9095d37b LG |
269 | ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()\r |
270 | is called while processing another any other Report Status Code Library function,\r | |
fb3df220 | 271 | then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.\r |
272 | \r | |
273 | If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().\r | |
274 | If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().\r | |
275 | \r | |
9095d37b | 276 | @param Type The status code type.\r |
af2dc6a7 | 277 | @param Value The status code value.\r |
278 | @param Instance The status code instance number.\r | |
9095d37b LG |
279 | @param CallerId The pointer to a GUID that identifies the caller of this\r |
280 | function. If this parameter is NULL, then a caller\r | |
fb3df220 | 281 | ID of gEfiCallerIdGuid is used.\r |
9095d37b LG |
282 | @param ExtendedDataGuid The pointer to the GUID for the extended data buffer.\r |
283 | If this parameter is NULL, then a the status code\r | |
1f25dacf | 284 | standard header is filled in with an implementation dependent GUID.\r |
9095d37b | 285 | @param ExtendedData The pointer to the extended data buffer. This is an\r |
fb3df220 | 286 | optional parameter that may be NULL.\r |
287 | @param ExtendedDataSize The size, in bytes, of the extended data buffer.\r | |
288 | \r | |
289 | @retval EFI_SUCCESS The status code was reported.\r | |
9095d37b | 290 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate\r |
fb3df220 | 291 | the extended data section if it was specified.\r |
af2dc6a7 | 292 | @retval EFI_UNSUPPORTED The report status code is not supported.\r |
6d6a1098 | 293 | @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function\r |
294 | is already in progress.\r | |
fb3df220 | 295 | \r |
296 | **/\r | |
297 | EFI_STATUS\r | |
298 | EFIAPI\r | |
299 | ReportStatusCodeEx (\r | |
300 | IN EFI_STATUS_CODE_TYPE Type,\r | |
301 | IN EFI_STATUS_CODE_VALUE Value,\r | |
302 | IN UINT32 Instance,\r | |
303 | IN CONST EFI_GUID *CallerId OPTIONAL,\r | |
304 | IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,\r | |
305 | IN CONST VOID *ExtendedData OPTIONAL,\r | |
306 | IN UINTN ExtendedDataSize\r | |
307 | );\r | |
308 | \r | |
309 | \r | |
310 | /**\r | |
311 | Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled\r | |
312 | \r | |
9095d37b | 313 | This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED\r |
fb3df220 | 314 | bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r |
315 | \r | |
9095d37b | 316 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of\r |
fb3df220 | 317 | PcdReportStatusCodeProperyMask is set.\r |
9095d37b | 318 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of\r |
fb3df220 | 319 | PcdReportStatusCodeProperyMask is clear.\r |
320 | \r | |
321 | **/\r | |
322 | BOOLEAN\r | |
323 | EFIAPI\r | |
324 | ReportProgressCodeEnabled (\r | |
325 | VOID\r | |
326 | );\r | |
327 | \r | |
328 | \r | |
329 | /**\r | |
330 | Returns TRUE if status codes of type EFI_ERROR_CODE are enabled\r | |
331 | \r | |
9095d37b | 332 | This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED\r |
af2dc6a7 | 333 | bit of PcdReportStatusCodeProperyMask is set. Otherwise, FALSE is returned.\r |
fb3df220 | 334 | \r |
9095d37b | 335 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of\r |
fb3df220 | 336 | PcdReportStatusCodeProperyMask is set.\r |
9095d37b | 337 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of\r |
fb3df220 | 338 | PcdReportStatusCodeProperyMask is clear.\r |
339 | \r | |
340 | **/\r | |
341 | BOOLEAN\r | |
342 | EFIAPI\r | |
343 | ReportErrorCodeEnabled (\r | |
344 | VOID\r | |
345 | );\r | |
346 | \r | |
347 | \r | |
348 | /**\r | |
349 | Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled\r | |
350 | \r | |
9095d37b | 351 | This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED\r |
fb3df220 | 352 | bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r |
353 | \r | |
9095d37b | 354 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of\r |
fb3df220 | 355 | PcdReportStatusCodeProperyMask is set.\r |
9095d37b | 356 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of\r |
fb3df220 | 357 | PcdReportStatusCodeProperyMask is clear.\r |
358 | \r | |
359 | **/\r | |
360 | BOOLEAN\r | |
361 | EFIAPI\r | |
362 | ReportDebugCodeEnabled (\r | |
363 | VOID\r | |
364 | );\r | |
365 | \r | |
366 | \r | |
367 | /**\r | |
368 | Reports a status code with minimal parameters if the status code type is enabled.\r | |
369 | \r | |
9095d37b LG |
370 | If the status code type specified by Type is enabled in\r |
371 | PcdReportStatusCodeProperyMask, then call ReportStatusCode() passing in Type\r | |
fb3df220 | 372 | and Value.\r |
373 | \r | |
9095d37b | 374 | @param Type The status code type.\r |
af2dc6a7 | 375 | @param Value The status code value.\r |
fb3df220 | 376 | \r |
377 | @retval EFI_SUCCESS The status code was reported.\r | |
378 | @retval EFI_DEVICE_ERROR There status code could not be reported due to a device error.\r | |
af2dc6a7 | 379 | @retval EFI_UNSUPPORTED Report status code is not supported.\r |
fb3df220 | 380 | \r |
381 | **/\r | |
382 | #define REPORT_STATUS_CODE(Type,Value) \\r | |
383 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
384 | ReportStatusCode(Type,Value) : \\r | |
385 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
386 | ReportStatusCode(Type,Value) : \\r | |
387 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
388 | ReportStatusCode(Type,Value) : \\r | |
389 | EFI_UNSUPPORTED\r | |
390 | \r | |
391 | \r | |
392 | /**\r | |
9095d37b | 393 | Reports a status code with a Device Path Protocol as the extended data if the\r |
fb3df220 | 394 | status code type is enabled.\r |
395 | \r | |
9095d37b LG |
396 | If the status code type specified by Type is enabled in\r |
397 | PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithDevicePath()\r | |
fb3df220 | 398 | passing in Type, Value, and DevicePath.\r |
399 | \r | |
9095d37b | 400 | @param Type The status code type.\r |
af2dc6a7 | 401 | @param Value The status code value.\r |
fb3df220 | 402 | @param DevicePath Pointer to the Device Path Protocol to be reported.\r |
403 | \r | |
9095d37b | 404 | @retval EFI_SUCCESS The status code was reported with the extended\r |
fb3df220 | 405 | data specified by DevicePath.\r |
9095d37b | 406 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the\r |
fb3df220 | 407 | extended data section.\r |
af2dc6a7 | 408 | @retval EFI_UNSUPPORTED The report status code is not supported.\r |
6d6a1098 | 409 | @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function\r |
410 | is already in progress.\r | |
fb3df220 | 411 | \r |
412 | **/\r | |
413 | #define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type,Value,DevicePathParameter) \\r | |
414 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
415 | ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \\r | |
416 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
417 | ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \\r | |
418 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
419 | ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \\r | |
420 | EFI_UNSUPPORTED\r | |
421 | \r | |
422 | \r | |
423 | /**\r | |
9095d37b | 424 | Reports a status code with an extended data buffer if the status code type\r |
fb3df220 | 425 | is enabled.\r |
426 | \r | |
9095d37b LG |
427 | If the status code type specified by Type is enabled in\r |
428 | PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithExtendedData()\r | |
fb3df220 | 429 | passing in Type, Value, ExtendedData, and ExtendedDataSize.\r |
430 | \r | |
9095d37b | 431 | @param Type The status code type.\r |
af2dc6a7 | 432 | @param Value The status code value.\r |
433 | @param ExtendedData The pointer to the extended data buffer to be reported.\r | |
fb3df220 | 434 | @param ExtendedDataSize The size, in bytes, of the extended data buffer to\r |
435 | be reported.\r | |
436 | \r | |
9095d37b | 437 | @retval EFI_SUCCESS The status code was reported with the extended\r |
fb3df220 | 438 | data specified by ExtendedData and ExtendedDataSize.\r |
9095d37b | 439 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the\r |
fb3df220 | 440 | extended data section.\r |
af2dc6a7 | 441 | @retval EFI_UNSUPPORTED The report status code is not supported.\r |
6d6a1098 | 442 | @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function\r |
443 | is already in progress.\r | |
fb3df220 | 444 | \r |
445 | **/\r | |
446 | #define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type,Value,ExtendedData,ExtendedDataSize) \\r | |
447 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
448 | ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \\r | |
449 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
450 | ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \\r | |
451 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
452 | ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \\r | |
453 | EFI_UNSUPPORTED\r | |
454 | \r | |
455 | /**\r | |
456 | Reports a status code specifying all parameters if the status code type is enabled.\r | |
457 | \r | |
9095d37b LG |
458 | If the status code type specified by Type is enabled in\r |
459 | PcdReportStatusCodeProperyMask, then call ReportStatusCodeEx() passing in Type,\r | |
fb3df220 | 460 | Value, Instance, CallerId, ExtendedDataGuid, ExtendedData, and ExtendedDataSize.\r |
461 | \r | |
9095d37b | 462 | @param Type The status code type.\r |
af2dc6a7 | 463 | @param Value The status code value.\r |
464 | @param Instance The status code instance number.\r | |
9095d37b LG |
465 | @param CallerId The pointer to a GUID that identifies the caller of this\r |
466 | function. If this parameter is NULL, then a caller\r | |
fb3df220 | 467 | ID of gEfiCallerIdGuid is used.\r |
9095d37b LG |
468 | @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.\r |
469 | If this parameter is NULL, then a the status code\r | |
1f25dacf | 470 | standard header is filled in with an implementation dependent GUID.\r |
9095d37b | 471 | @param ExtendedData Pointer to the extended data buffer. This is an\r |
fb3df220 | 472 | optional parameter that may be NULL.\r |
473 | @param ExtendedDataSize The size, in bytes, of the extended data buffer.\r | |
474 | \r | |
475 | @retval EFI_SUCCESS The status code was reported.\r | |
9095d37b | 476 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the\r |
fb3df220 | 477 | extended data section if it was specified.\r |
af2dc6a7 | 478 | @retval EFI_UNSUPPORTED The report status code is not supported.\r |
6d6a1098 | 479 | @retval EFI_DEVICE_ERROR A call to a Report Status Code Library function\r |
480 | is already in progress.\r | |
fb3df220 | 481 | \r |
482 | **/\r | |
483 | #define REPORT_STATUS_CODE_EX(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) \\r | |
484 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
485 | ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \\r | |
486 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
487 | ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \\r | |
488 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
489 | ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \\r | |
490 | EFI_UNSUPPORTED\r | |
491 | \r | |
492 | #endif\r |