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