Import Library Class from original MDE package. Also I added the EFI_PEI_CORE_ENTRY_P...
[mirror_edk2.git] / MdePkg / Include / Library / ReportStatusCodeLib.h
1 /** @file
2 Report Status Code Library public .h file
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __REPORT_STATUS_CODE_LIB_H__
16 #define __REPORT_STATUS_CODE_LIB_H__
17
18 //
19 // Declare bits for PcdReportStatusCodePropertyMask
20 //
21 #define REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED 0x00000001
22 #define REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED 0x00000002
23 #define REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED 0x00000004
24
25 //
26 // Extended Data structure definitions with EFI_STATUS_CODE_DATA headers removed
27 //
28
29 ///
30 /// Voltage Extended Error Data
31 ///
32 typedef struct {
33 EFI_EXP_BASE10_DATA Voltage;
34 EFI_EXP_BASE10_DATA Threshold;
35 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_VOLTAGE_ERROR_DATA;
36
37 ///
38 /// Microcode Update Extended Error Data
39 ///
40 typedef struct {
41 UINT32 Version;
42 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA;
43
44 ///
45 /// Asynchronous Timer Extended Error Data
46 ///
47 typedef struct {
48 EFI_EXP_BASE10_DATA TimerLimit;
49 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA;
50
51 ///
52 /// Host Processor Mismatch Extended Error Data
53 ///
54 typedef struct {
55 UINT32 Instance;
56 UINT16 Attributes;
57 } REPORT_STATUS_CODE_LIBRARY_HOST_PROCESSOR_MISMATCH_ERROR_DATA;
58
59 ///
60 /// Thermal Extended Error Data
61 ///
62 typedef struct {
63 EFI_EXP_BASE10_DATA Temperature;
64 EFI_EXP_BASE10_DATA Threshold;
65 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_THERMAL_ERROR_DATA;
66
67 ///
68 /// Processor Disabled Extended Error Data
69 ///
70 typedef struct {
71 UINT32 Cause;
72 BOOLEAN SoftwareDisabled;
73 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA;
74
75 ///
76 /// Embedded cache init extended data
77 ///
78 typedef struct {
79 UINT32 Level;
80 EFI_INIT_CACHE_TYPE Type;
81 } REPORT_STATUS_CODE_LIBRARY_CACHE_INIT_DATA;
82
83 ///
84 /// Memory Extended Error Data
85 ///
86 typedef struct {
87 EFI_MEMORY_ERROR_GRANULARITY Granularity;
88 EFI_MEMORY_ERROR_OPERATION Operation;
89 UINTN Syndrome;
90 EFI_PHYSICAL_ADDRESS Address;
91 UINTN Resolution;
92 } REPORT_STATUS_CODE_LIBRARY_MEMORY_EXTENDED_ERROR_DATA;
93
94 ///
95 /// DIMM number
96 ///
97 typedef struct {
98 UINT16 Array;
99 UINT16 Device;
100 } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_DIMM_NUMBER;
101
102 ///
103 /// Memory Module Mismatch Extended Error Data
104 ///
105 typedef struct {
106 EFI_STATUS_CODE_DIMM_NUMBER Instance;
107 } REPORT_STATUS_CODE_LIBRARY_MEMORY_MODULE_MISMATCH_ERROR_DATA;
108
109 ///
110 /// Memory Range Extended Data
111 ///
112 typedef struct {
113 EFI_PHYSICAL_ADDRESS Start;
114 EFI_PHYSICAL_ADDRESS Length;
115 } REPORT_STATUS_CODE_LIBRARY_MEMORY_RANGE_EXTENDED_DATA;
116
117 ///
118 /// Device handle Extended Data. Used for many
119 /// errors and progress codes to point to the device.
120 ///
121 typedef struct {
122 EFI_HANDLE Handle;
123 } REPORT_STATUS_CODE_LIBRARY_DEVICE_HANDLE_EXTENDED_DATA;
124
125 typedef struct {
126 UINT8 *DevicePath;
127 } REPORT_STATUS_CODE_LIBRARY_DEVICE_PATH_EXTENDED_DATA;
128
129 typedef struct {
130 EFI_HANDLE ControllerHandle;
131 EFI_HANDLE DriverBindingHandle;
132 UINT16 DevicePathSize;
133 UINT8 *RemainingDevicePath;
134 } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_START_EXTENDED_DATA;
135
136 ///
137 /// Resource Allocation Failure Extended Error Data
138 ///
139 typedef struct {
140 UINT32 Bar;
141 UINT16 DevicePathSize;
142 UINT16 ReqResSize;
143 UINT16 AllocResSize;
144 UINT8 *DevicePath;
145 UINT8 *ReqRes;
146 UINT8 *AllocRes;
147 } REPORT_STATUS_CODE_LIBRARY_RESOURCE_ALLOC_FAILURE_ERROR_DATA;
148
149 ///
150 /// Extended Error Data for Assert
151 ///
152 typedef struct {
153 UINT32 LineNumber;
154 UINT32 FileNameSize;
155 EFI_STATUS_CODE_STRING_DATA *FileName;
156 } REPORT_STATUS_CODE_LIBRARY_DEBUG_ASSERT_DATA;
157
158 ///
159 /// System Context Data EBC/IA32/IPF
160 ///
161 typedef struct {
162 EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT Context;
163 } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_EXCEP_EXTENDED_DATA;
164
165 ///
166 /// Legacy Oprom extended data
167 ///
168 typedef struct {
169 EFI_HANDLE DeviceHandle;
170 EFI_PHYSICAL_ADDRESS RomImageBase;
171 } REPORT_STATUS_CODE_LIBRARY_LEGACY_OPROM_EXTENDED_DATA;
172
173 //
174 // Extern for the modules Caller ID GUID
175 //
176 extern EFI_GUID gEfiCallerIdGuid;
177
178 /**
179 Converts a status code to an 8-bit POST code value.
180
181 Converts the status code specified by CodeType and Value to an 8-bit POST code
182 and returns the 8-bit POST code in PostCode. If CodeType is an
183 EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode
184 are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits
185 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.
186
187 If PostCode is NULL, then ASSERT().
188
189 @param CodeType The type of status code being converted.
190 @param Value The status code value being converted.
191 @param PostCode A pointer to the 8-bit POST code value to return.
192
193 @retval TRUE The status code specified by CodeType and Value was converted
194 to an 8-bit POST code and returned in PostCode.
195 @retval FALSE The status code specified by CodeType and Value could not be
196 converted to an 8-bit POST code value.
197
198 **/
199 BOOLEAN
200 EFIAPI
201 CodeTypeToPostCode (
202 IN EFI_STATUS_CODE_TYPE CodeType,
203 IN EFI_STATUS_CODE_VALUE Value,
204 OUT UINT8 *PostCode
205 );
206
207
208 /**
209 Extracts ASSERT() information from a status code structure.
210
211 Converts the status code specified by CodeType, Value, and Data to the ASSERT()
212 arguments specified by Filename, Description, and LineNumber. If CodeType is
213 an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
214 Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
215 Filename, Description, and LineNumber from the optional data area of the
216 status code buffer specified by Data. The optional data area of Data contains
217 a Null-terminated ASCII string for the FileName, followed by a Null-terminated
218 ASCII string for the Description, followed by a 32-bit LineNumber. If the
219 ASSERT() information could be extracted from Data, then return TRUE.
220 Otherwise, FALSE is returned.
221
222 If Data is NULL, then ASSERT().
223 If Filename is NULL, then ASSERT().
224 If Description is NULL, then ASSERT().
225 If LineNumber is NULL, then ASSERT().
226
227 @param CodeType The type of status code being converted.
228 @param Value The status code value being converted.
229 @param Data Pointer to status code data buffer.
230 @param Filename Pointer to the source file name that generated the ASSERT().
231 @param Description Pointer to the description of the ASSERT().
232 @param LineNumber Pointer to source line number that generated the ASSERT().
233
234 @retval TRUE The status code specified by CodeType, Value, and Data was
235 converted ASSERT() arguments specified by Filename, Description,
236 and LineNumber.
237 @retval FALSE The status code specified by CodeType, Value, and Data could
238 not be converted to ASSERT() arguments.
239
240 **/
241 BOOLEAN
242 EFIAPI
243 ReportStatusCodeExtractAssertInfo (
244 IN EFI_STATUS_CODE_TYPE CodeType,
245 IN EFI_STATUS_CODE_VALUE Value,
246 IN CONST EFI_STATUS_CODE_DATA *Data,
247 OUT CHAR8 **Filename,
248 OUT CHAR8 **Description,
249 OUT UINT32 *LineNumber
250 );
251
252
253 /**
254 Extracts DEBUG() information from a status code structure.
255
256 Converts the status code specified by Data to the DEBUG() arguments specified
257 by ErrorLevel, Marker, and Format. If type GUID in Data is
258 EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
259 Format from the optional data area of the status code buffer specified by Data.
260 The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
261 which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
262 the Format. If the DEBUG() information could be extracted from Data, then
263 return TRUE. Otherwise, FALSE is returned.
264
265 If Data is NULL, then ASSERT().
266 If ErrorLevel is NULL, then ASSERT().
267 If Marker is NULL, then ASSERT().
268 If Format is NULL, then ASSERT().
269
270 @param Data Pointer to status code data buffer.
271 @param ErrorLevel Pointer to error level mask for a debug message.
272 @param Marker Pointer to the variable argument list associated with Format.
273 @param Format Pointer to a Null-terminated ASCII format string of a
274 debug message.
275
276 @retval TRUE The status code specified by Data was converted DEBUG() arguments
277 specified by ErrorLevel, Marker, and Format.
278 @retval FALSE The status code specified by Data could not be converted to
279 DEBUG() arguments.
280
281 **/
282 BOOLEAN
283 EFIAPI
284 ReportStatusCodeExtractDebugInfo (
285 IN CONST EFI_STATUS_CODE_DATA *Data,
286 OUT UINT32 *ErrorLevel,
287 OUT VA_LIST *Marker,
288 OUT CHAR8 **Format
289 );
290
291
292 /**
293 Reports a status code.
294
295 Reports the status code specified by the parameters Type and Value. Status
296 code also require an instance, caller ID, and extended data. This function
297 passed in a zero instance, NULL extended data, and a caller ID of
298 gEfiCallerIdGuid, which is the GUID for the module.
299
300 ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode()
301 is called while processing another any other Report Status Code Library function,
302 then ReportStatusCode() must return immediately.
303
304 @param Type Status code type.
305 @param Value Status code value.
306
307 @retval EFI_SUCCESS The status code was reported.
308 @retval EFI_DEVICE_ERROR There status code could not be reported due to a
309 device error.
310 @retval EFI_UNSUPPORTED Report status code is not supported
311
312 **/
313 EFI_STATUS
314 EFIAPI
315 ReportStatusCode (
316 IN EFI_STATUS_CODE_TYPE Type,
317 IN EFI_STATUS_CODE_VALUE Value
318 );
319
320
321 /**
322 Reports a status code with a Device Path Protocol as the extended data.
323
324 Allocates and fills in the extended data section of a status code with the
325 Device Path Protocol specified by DevicePath. This function is responsible
326 for allocating a buffer large enough for the standard header and the device
327 path. The standard header is filled in with a GUID of
328 gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero
329 instance and a caller ID of gEfiCallerIdGuid.
330
331 ReportStatusCodeWithDevicePath()must actively prevent recursion. If
332 ReportStatusCodeWithDevicePath() is called while processing another any other
333 Report Status Code Library function, then ReportStatusCodeWithDevicePath()
334 must return EFI_DEVICE_ERROR immediately.
335
336 If DevicePath is NULL, then ASSERT().
337
338 @param Type Status code type.
339 @param Value Status code value.
340 @param DevicePath Pointer to the Device Path Protocol to be reported.
341
342 @retval EFI_SUCCESS The status code was reported with the extended
343 data specified by DevicePath.
344 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
345 extended data section.
346 @retval EFI_UNSUPPORTED Report status code is not supported
347
348 **/
349 EFI_STATUS
350 EFIAPI
351 ReportStatusCodeWithDevicePath (
352 IN EFI_STATUS_CODE_TYPE Type,
353 IN EFI_STATUS_CODE_VALUE Value,
354 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
355 );
356
357
358 /**
359 Reports a status code with an extended data buffer.
360
361 Allocates and fills in the extended data section of a status code with the
362 extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
363 is assumed to be one of the data structures specified in Related Definitions.
364 These data structure do not have the standard header, so this function is
365 responsible for allocating a buffer large enough for the standard header and
366 the extended data passed into this function. The standard header is filled
367 in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported
368 with a zero instance and a caller ID of gEfiCallerIdGuid.
369
370 ReportStatusCodeWithExtendedData()must actively prevent recursion. If
371 ReportStatusCodeWithExtendedData() is called while processing another any other
372 Report Status Code Library function, then ReportStatusCodeWithExtendedData()
373 must return EFI_DEVICE_ERROR immediately.
374
375 If ExtendedData is NULL, then ASSERT().
376 If ExtendedDataSize is 0, then ASSERT().
377
378 @param Type Status code type.
379 @param Value Status code value.
380 @param ExtendedData Pointer to the extended data buffer to be reported.
381 @param ExtendedDataSize The size, in bytes, of the extended data buffer to
382 be reported.
383
384 @retval EFI_SUCCESS The status code was reported with the extended
385 data specified by ExtendedData and ExtendedDataSize.
386 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
387 extended data section.
388 @retval EFI_UNSUPPORTED Report status code is not supported
389
390 **/
391 EFI_STATUS
392 EFIAPI
393 ReportStatusCodeWithExtendedData (
394 IN EFI_STATUS_CODE_TYPE Type,
395 IN EFI_STATUS_CODE_VALUE Value,
396 IN CONST VOID *ExtendedData,
397 IN UINTN ExtendedDataSize
398 );
399
400
401 /**
402 Reports a status code with full parameters.
403
404 The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
405 is 0, then an extended data buffer is not reported. If ExtendedData is not
406 NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
407 ExtendedData is assumed not have the standard status code header, so this function
408 is responsible for allocating a buffer large enough for the standard header and
409 the extended data passed into this function. The standard header is filled in
410 with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
411 GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
412 an instance specified by Instance and a caller ID specified by CallerId. If
413 CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
414
415 ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
416 is called while processing another any other Report Status Code Library function,
417 then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
418
419 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
420 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
421
422 @param Type Status code type.
423 @param Value Status code value.
424 @param Instance Status code instance number.
425 @param CallerId Pointer to a GUID that identifies the caller of this
426 function. If this parameter is NULL, then a caller
427 ID of gEfiCallerIdGuid is used.
428 @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
429 If this parameter is NULL, then a the status code
430 standard header is filled in with
431 gEfiStatusCodeSpecificDataGuid.
432 @param ExtendedData Pointer to the extended data buffer. This is an
433 optional parameter that may be NULL.
434 @param ExtendedDataSize The size, in bytes, of the extended data buffer.
435
436 @retval EFI_SUCCESS The status code was reported.
437 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
438 the extended data section if it was specified.
439 @retval EFI_UNSUPPORTED Report status code is not supported
440
441 **/
442 EFI_STATUS
443 EFIAPI
444 ReportStatusCodeEx (
445 IN EFI_STATUS_CODE_TYPE Type,
446 IN EFI_STATUS_CODE_VALUE Value,
447 IN UINT32 Instance,
448 IN CONST EFI_GUID *CallerId OPTIONAL,
449 IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
450 IN CONST VOID *ExtendedData OPTIONAL,
451 IN UINTN ExtendedDataSize
452 );
453
454
455 /**
456 Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
457
458 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
459 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
460
461 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
462 PcdReportStatusCodeProperyMask is set.
463 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
464 PcdReportStatusCodeProperyMask is clear.
465
466 **/
467 BOOLEAN
468 EFIAPI
469 ReportProgressCodeEnabled (
470 VOID
471 );
472
473
474 /**
475 Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
476
477 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
478 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
479
480 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
481 PcdReportStatusCodeProperyMask is set.
482 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
483 PcdReportStatusCodeProperyMask is clear.
484
485 **/
486 BOOLEAN
487 EFIAPI
488 ReportErrorCodeEnabled (
489 VOID
490 );
491
492
493 /**
494 Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
495
496 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
497 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
498
499 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
500 PcdReportStatusCodeProperyMask is set.
501 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
502 PcdReportStatusCodeProperyMask is clear.
503
504 **/
505 BOOLEAN
506 EFIAPI
507 ReportDebugCodeEnabled (
508 VOID
509 );
510
511
512 /**
513 Reports a status code with minimal parameters if the status code type is enabled.
514
515 If the status code type specified by Type is enabled in
516 PcdReportStatusCodeProperyMask, then call ReportStatusCode() passing in Type
517 and Value.
518
519 @param Type Status code type.
520 @param Value Status code value.
521
522 @retval EFI_SUCCESS The status code was reported.
523 @retval EFI_DEVICE_ERROR There status code could not be reported due to a device error.
524 @retval EFI_UNSUPPORTED Report status code is not supported
525
526 **/
527 #define REPORT_STATUS_CODE(Type,Value) \
528 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
529 ReportStatusCode(Type,Value) : \
530 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
531 ReportStatusCode(Type,Value) : \
532 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
533 ReportStatusCode(Type,Value) : \
534 EFI_UNSUPPORTED
535
536
537 /**
538 Reports a status code with a Device Path Protocol as the extended data if the
539 status code type is enabled.
540
541 If the status code type specified by Type is enabled in
542 PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithDevicePath()
543 passing in Type, Value, and DevicePath.
544
545 @param Type Status code type.
546 @param Value Status code value.
547 @param DevicePath Pointer to the Device Path Protocol to be reported.
548
549 @retval EFI_SUCCESS The status code was reported with the extended
550 data specified by DevicePath.
551 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
552 extended data section.
553 @retval EFI_UNSUPPORTED Report status code is not supported
554
555 **/
556 #define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type,Value,DevicePathParameter) \
557 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
558 ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
559 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
560 ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
561 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
562 ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
563 EFI_UNSUPPORTED
564
565
566 /**
567 Reports a status code with an extended data buffer if the status code type
568 is enabled.
569
570 If the status code type specified by Type is enabled in
571 PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithExtendedData()
572 passing in Type, Value, ExtendedData, and ExtendedDataSize.
573
574 @param Type Status code type.
575 @param Value Status code value.
576 @param ExtendedData Pointer to the extended data buffer to be reported.
577 @param ExtendedDataSize The size, in bytes, of the extended data buffer to
578 be reported.
579
580 @retval EFI_SUCCESS The status code was reported with the extended
581 data specified by ExtendedData and ExtendedDataSize.
582 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
583 extended data section.
584 @retval EFI_UNSUPPORTED Report status code is not supported
585
586 **/
587 #define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type,Value,ExtendedData,ExtendedDataSize) \
588 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
589 ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
590 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
591 ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
592 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
593 ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
594 EFI_UNSUPPORTED
595
596 /**
597 Reports a status code specifying all parameters if the status code type is enabled.
598
599 If the status code type specified by Type is enabled in
600 PcdReportStatusCodeProperyMask, then call ReportStatusCodeEx() passing in Type,
601 Value, Instance, CallerId, ExtendedDataGuid, ExtendedData, and ExtendedDataSize.
602
603 @param Type Status code type.
604 @param Value Status code value.
605 @param Instance Status code instance number.
606 @param CallerId Pointer to a GUID that identifies the caller of this
607 function. If this parameter is NULL, then a caller
608 ID of gEfiCallerIdGuid is used.
609 @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
610 If this parameter is NULL, then a the status code
611 standard header is filled in with
612 gEfiStatusCodeSpecificDataGuid.
613 @param ExtendedData Pointer to the extended data buffer. This is an
614 optional parameter that may be NULL.
615 @param ExtendedDataSize The size, in bytes, of the extended data buffer.
616
617 @retval EFI_SUCCESS The status code was reported.
618 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
619 extended data section if it was specified.
620 @retval EFI_UNSUPPORTED Report status code is not supported
621
622 **/
623 #define REPORT_STATUS_CODE_EX(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) \
624 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
625 ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
626 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
627 ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
628 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
629 ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
630 EFI_UNSUPPORTED
631
632 #endif