2 Report Status Code Library public .h file
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
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.
15 #ifndef __REPORT_STATUS_CODE_LIB_H__
16 #define __REPORT_STATUS_CODE_LIB_H__
19 // Declare bits for PcdReportStatusCodePropertyMask
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 #define REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED 0x00000008
25 #define REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED 0x00000010
28 // Extended Data structure definitions with EFI_STATUS_CODE_DATA headers removed
32 /// Voltage Extended Error Data
35 EFI_EXP_BASE10_DATA Voltage
;
36 EFI_EXP_BASE10_DATA Threshold
;
37 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_VOLTAGE_ERROR_DATA
;
40 /// Microcode Update Extended Error Data
44 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA
;
47 /// Asynchronous Timer Extended Error Data
50 EFI_EXP_BASE10_DATA TimerLimit
;
51 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA
;
54 /// Host Processor Mismatch Extended Error Data
59 } REPORT_STATUS_CODE_LIBRARY_HOST_PROCESSOR_MISMATCH_ERROR_DATA
;
62 /// Thermal Extended Error Data
65 EFI_EXP_BASE10_DATA Temperature
;
66 EFI_EXP_BASE10_DATA Threshold
;
67 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_THERMAL_ERROR_DATA
;
70 /// Processor Disabled Extended Error Data
74 BOOLEAN SoftwareDisabled
;
75 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA
;
78 /// Embedded cache init extended data
82 EFI_INIT_CACHE_TYPE Type
;
83 } REPORT_STATUS_CODE_LIBRARY_CACHE_INIT_DATA
;
86 /// Memory Extended Error Data
89 EFI_MEMORY_ERROR_GRANULARITY Granularity
;
90 EFI_MEMORY_ERROR_OPERATION Operation
;
92 EFI_PHYSICAL_ADDRESS Address
;
94 } REPORT_STATUS_CODE_LIBRARY_MEMORY_EXTENDED_ERROR_DATA
;
102 } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_DIMM_NUMBER
;
105 /// Memory Module Mismatch Extended Error Data
108 EFI_STATUS_CODE_DIMM_NUMBER Instance
;
109 } REPORT_STATUS_CODE_LIBRARY_MEMORY_MODULE_MISMATCH_ERROR_DATA
;
112 /// Memory Range Extended Data
115 EFI_PHYSICAL_ADDRESS Start
;
116 EFI_PHYSICAL_ADDRESS Length
;
117 } REPORT_STATUS_CODE_LIBRARY_MEMORY_RANGE_EXTENDED_DATA
;
120 /// Device handle Extended Data. Used for many
121 /// errors and progress codes to point to the device.
125 } REPORT_STATUS_CODE_LIBRARY_DEVICE_HANDLE_EXTENDED_DATA
;
129 } REPORT_STATUS_CODE_LIBRARY_DEVICE_PATH_EXTENDED_DATA
;
132 EFI_HANDLE ControllerHandle
;
133 EFI_HANDLE DriverBindingHandle
;
134 UINT16 DevicePathSize
;
135 UINT8
*RemainingDevicePath
;
136 } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_START_EXTENDED_DATA
;
139 /// Resource Allocation Failure Extended Error Data
143 UINT16 DevicePathSize
;
149 } REPORT_STATUS_CODE_LIBRARY_RESOURCE_ALLOC_FAILURE_ERROR_DATA
;
152 /// Extended Error Data for Assert
157 EFI_STATUS_CODE_STRING_DATA
*FileName
;
158 } REPORT_STATUS_CODE_LIBRARY_DEBUG_ASSERT_DATA
;
161 /// System Context Data EBC/IA32/IPF
164 EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT Context
;
165 } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_EXCEP_EXTENDED_DATA
;
168 /// Legacy Oprom extended data
171 EFI_HANDLE DeviceHandle
;
172 EFI_PHYSICAL_ADDRESS RomImageBase
;
173 } REPORT_STATUS_CODE_LIBRARY_LEGACY_OPROM_EXTENDED_DATA
;
176 // Extern for the modules Caller ID GUID
178 extern EFI_GUID gEfiCallerIdGuid
;
181 Converts a status code to an 8-bit POST code value.
183 Converts the status code specified by CodeType and Value to an 8-bit POST code
184 and returns the 8-bit POST code in PostCode. If CodeType is an
185 EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode
186 are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits
187 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.
189 If PostCode is NULL, then ASSERT().
191 @param CodeType The type of status code being converted.
192 @param Value The status code value being converted.
193 @param PostCode A pointer to the 8-bit POST code value to return.
195 @retval TRUE The status code specified by CodeType and Value was converted
196 to an 8-bit POST code and returned in PostCode.
197 @retval FALSE The status code specified by CodeType and Value could not be
198 converted to an 8-bit POST code value.
204 IN EFI_STATUS_CODE_TYPE CodeType
,
205 IN EFI_STATUS_CODE_VALUE Value
,
211 Extracts ASSERT() information from a status code structure.
213 Converts the status code specified by CodeType, Value, and Data to the ASSERT()
214 arguments specified by Filename, Description, and LineNumber. If CodeType is
215 an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
216 Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
217 Filename, Description, and LineNumber from the optional data area of the
218 status code buffer specified by Data. The optional data area of Data contains
219 a Null-terminated ASCII string for the FileName, followed by a Null-terminated
220 ASCII string for the Description, followed by a 32-bit LineNumber. If the
221 ASSERT() information could be extracted from Data, then return TRUE.
222 Otherwise, FALSE is returned.
224 If Data is NULL, then ASSERT().
225 If Filename is NULL, then ASSERT().
226 If Description is NULL, then ASSERT().
227 If LineNumber is NULL, then ASSERT().
229 @param CodeType The type of status code being converted.
230 @param Value The status code value being converted.
231 @param Data Pointer to status code data buffer.
232 @param Filename Pointer to the source file name that generated the ASSERT().
233 @param Description Pointer to the description of the ASSERT().
234 @param LineNumber Pointer to source line number that generated the ASSERT().
236 @retval TRUE The status code specified by CodeType, Value, and Data was
237 converted ASSERT() arguments specified by Filename, Description,
239 @retval FALSE The status code specified by CodeType, Value, and Data could
240 not be converted to ASSERT() arguments.
245 ReportStatusCodeExtractAssertInfo (
246 IN EFI_STATUS_CODE_TYPE CodeType
,
247 IN EFI_STATUS_CODE_VALUE Value
,
248 IN EFI_STATUS_CODE_DATA
*Data
,
249 OUT CHAR8
**Filename
,
250 OUT CHAR8
**Description
,
251 OUT UINT32
*LineNumber
256 Extracts DEBUG() information from a status code structure.
258 Converts the status code specified by Data to the DEBUG() arguments specified
259 by ErrorLevel, Marker, and Format. If type GUID in Data is
260 EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
261 Format from the optional data area of the status code buffer specified by Data.
262 The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
263 which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
264 the Format. If the DEBUG() information could be extracted from Data, then
265 return TRUE. Otherwise, FALSE is returned.
267 If Data is NULL, then ASSERT().
268 If ErrorLevel is NULL, then ASSERT().
269 If Marker is NULL, then ASSERT().
270 If Format is NULL, then ASSERT().
272 @param Data Pointer to status code data buffer.
273 @param ErrorLevel Pointer to error level mask for a debug message.
274 @param Marker Pointer to the variable argument list associated with Format.
275 @param Format Pointer to a Null-terminated ASCII format string of a
278 @retval TRUE The status code specified by Data was converted DEBUG() arguments
279 specified by ErrorLevel, Marker, and Format.
280 @retval FALSE The status code specified by Data could not be converted to
286 ReportStatusCodeExtractDebugInfo (
287 IN EFI_STATUS_CODE_DATA
*Data
,
288 OUT UINT32
*ErrorLevel
,
295 Reports a status code.
297 Reports the status code specified by the parameters Type and Value. Status
298 code also require an instance, caller ID, and extended data. This function
299 passed in a zero instance, NULL extended data, and a caller ID of
300 gEfiCallerIdGuid, which is the GUID for the module.
302 ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode()
303 is called while processing another any other Report Status Code Library function,
304 then ReportStatusCode() must return immediately.
306 @param Type Status code type.
307 @param Value Status code value.
309 @retval EFI_SUCCESS The status code was reported.
310 @retval EFI_DEVICE_ERROR There status code could not be reported due to a
312 @retval EFI_UNSUPPORTED Report status code is not supported
318 IN EFI_STATUS_CODE_TYPE Type
,
319 IN EFI_STATUS_CODE_VALUE Value
324 Reports a status code with a Device Path Protocol as the extended data.
326 Allocates and fills in the extended data section of a status code with the
327 Device Path Protocol specified by DevicePath. This function is responsible
328 for allocating a buffer large enough for the standard header and the device
329 path. The standard header is filled in with a GUID of
330 gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero
331 instance and a caller ID of gEfiCallerIdGuid.
333 ReportStatusCodeWithDevicePath()must actively prevent recursion. If
334 ReportStatusCodeWithDevicePath() is called while processing another any other
335 Report Status Code Library function, then ReportStatusCodeWithDevicePath()
336 must return EFI_DEVICE_ERROR immediately.
338 If DevicePath is NULL, then ASSERT().
340 @param Type Status code type.
341 @param Value Status code value.
342 @param DevicePath Pointer to the Device Path Protocol to be reported.
344 @retval EFI_SUCCESS The status code was reported with the extended
345 data specified by DevicePath.
346 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
347 extended data section.
348 @retval EFI_UNSUPPORTED Report status code is not supported
353 ReportStatusCodeWithDevicePath (
354 IN EFI_STATUS_CODE_TYPE Type
,
355 IN EFI_STATUS_CODE_VALUE Value
,
356 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
361 Reports a status code with an extended data buffer.
363 Allocates and fills in the extended data section of a status code with the
364 extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
365 is assumed to be one of the data structures specified in Related Definitions.
366 These data structure do not have the standard header, so this function is
367 responsible for allocating a buffer large enough for the standard header and
368 the extended data passed into this function. The standard header is filled
369 in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported
370 with a zero instance and a caller ID of gEfiCallerIdGuid.
372 ReportStatusCodeWithExtendedData()must actively prevent recursion. If
373 ReportStatusCodeWithExtendedData() is called while processing another any other
374 Report Status Code Library function, then ReportStatusCodeWithExtendedData()
375 must return EFI_DEVICE_ERROR immediately.
377 If ExtendedData is NULL, then ASSERT().
378 If ExtendedDataSize is 0, then ASSERT().
380 @param Type Status code type.
381 @param Value Status code value.
382 @param ExtendedData Pointer to the extended data buffer to be reported.
383 @param ExtendedDataSize The size, in bytes, of the extended data buffer to
386 @retval EFI_SUCCESS The status code was reported with the extended
387 data specified by ExtendedData and ExtendedDataSize.
388 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
389 extended data section.
390 @retval EFI_UNSUPPORTED Report status code is not supported
395 ReportStatusCodeWithExtendedData (
396 IN EFI_STATUS_CODE_TYPE Type
,
397 IN EFI_STATUS_CODE_VALUE Value
,
398 IN VOID
*ExtendedData
,
399 IN UINTN ExtendedDataSize
404 Reports a status code with full parameters.
406 The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
407 is 0, then an extended data buffer is not reported. If ExtendedData is not
408 NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
409 ExtendedData is assumed not have the standard status code header, so this function
410 is responsible for allocating a buffer large enough for the standard header and
411 the extended data passed into this function. The standard header is filled in
412 with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
413 GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
414 an instance specified by Instance and a caller ID specified by CallerId. If
415 CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
417 ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
418 is called while processing another any other Report Status Code Library function,
419 then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
421 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
422 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
424 @param Type Status code type.
425 @param Value Status code value.
426 @param Instance Status code instance number.
427 @param CallerId Pointer to a GUID that identifies the caller of this
428 function. If this parameter is NULL, then a caller
429 ID of gEfiCallerIdGuid is used.
430 @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
431 If this parameter is NULL, then a the status code
432 standard header is filled in with
433 gEfiStatusCodeSpecificDataGuid.
434 @param ExtendedData Pointer to the extended data buffer. This is an
435 optional parameter that may be NULL.
436 @param ExtendedDataSize The size, in bytes, of the extended data buffer.
438 @retval EFI_SUCCESS The status code was reported.
439 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
440 the extended data section if it was specified.
441 @retval EFI_UNSUPPORTED Report status code is not supported
447 IN EFI_STATUS_CODE_TYPE Type
,
448 IN EFI_STATUS_CODE_VALUE Value
,
450 IN EFI_GUID
*CallerId OPTIONAL
,
451 IN EFI_GUID
*ExtendedDataGuid OPTIONAL
,
452 IN VOID
*ExtendedData OPTIONAL
,
453 IN UINTN ExtendedDataSize
458 Sends an 32-bit value to a POST card.
460 Sends the 32-bit value specified by Value to a POST card, and returns Value.
461 Some implementations of this library function may perform I/O operations
462 directly to a POST card device. Other implementations may send Value to
463 ReportStatusCode(), and the status code reporting mechanism will eventually
464 display the 32-bit value on the status reporting device.
466 PostCode() must actively prevent recursion. If PostCode() is called while
467 processing another any other Report Status Code Library function, then
468 PostCode() must return Value immediately.
470 @param Value The 32-bit value to write to the POST card.
483 Sends an 32-bit value to a POST and associated ASCII string.
485 Sends the 32-bit value specified by Value to a POST card, and returns Value.
486 If Description is not NULL, then the ASCII string specified by Description is
487 also passed to the handler that displays the POST card value. Some
488 implementations of this library function may perform I/O operations directly
489 to a POST card device. Other implementations may send Value to ReportStatusCode(),
490 and the status code reporting mechanism will eventually display the 32-bit
491 value on the status reporting device.
493 PostCodeWithDescription()must actively prevent recursion. If
494 PostCodeWithDescription() is called while processing another any other Report
495 Status Code Library function, then PostCodeWithDescription() must return Value
498 @param Value The 32-bit value to write to the POST card.
499 @param Description Pointer to an ASCII string that is a description of the
500 POST code value. This is an optional parameter that may
508 PostCodeWithDescription (
510 IN CONST CHAR8
*Description OPTIONAL
515 Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
517 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
518 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
520 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
521 PcdReportStatusCodeProperyMask is set.
522 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
523 PcdReportStatusCodeProperyMask is clear.
528 ReportProgressCodeEnabled (
534 Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
536 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
537 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
539 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
540 PcdReportStatusCodeProperyMask is set.
541 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
542 PcdReportStatusCodeProperyMask is clear.
547 ReportErrorCodeEnabled (
553 Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
555 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
556 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
558 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
559 PcdReportStatusCodeProperyMask is set.
560 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
561 PcdReportStatusCodeProperyMask is clear.
566 ReportDebugCodeEnabled (
572 Returns TRUE if POST Codes are enabled.
574 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED
575 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
577 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED bit of
578 PcdReportStatusCodeProperyMask is set.
579 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED bit of
580 PcdReportStatusCodeProperyMask is clear.
585 ReportPostCodeEnabled (
591 Returns TRUE if POST code descriptions are enabled.
593 This function returns TRUE if the
594 REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTIONS_ENABLED bit of
595 PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
597 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTIONS_ENABLED
598 bit of PcdReportStatusCodeProperyMask is set.
599 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTIONS_ENABLED
600 bit of PcdReportStatusCodeProperyMask is clear.
605 ReportPostCodeDescriptionEnabled (
611 Reports a status code with minimal parameters if the status code type is enabled.
613 If the status code type specified by Type is enabled in
614 PcdReportStatusCodeProperyMask, then call ReportStatusCode() passing in Type
617 @param Type Status code type.
618 @param Value Status code value.
620 @retval EFI_SUCCESS The status code was reported.
621 @retval EFI_DEVICE_ERROR There status code could not be reported due to a device error.
622 @retval EFI_UNSUPPORTED Report status code is not supported
625 #define REPORT_STATUS_CODE(Type,Value) \
626 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
627 ReportStatusCode(Type,Value) : \
628 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
629 ReportStatusCode(Type,Value) : \
630 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
631 ReportStatusCode(Type,Value) : \
636 Reports a status code with a Device Path Protocol as the extended data if the
637 status code type is enabled.
639 If the status code type specified by Type is enabled in
640 PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithDevicePath()
641 passing in Type, Value, and DevicePath.
643 @param Type Status code type.
644 @param Value Status code value.
645 @param DevicePath Pointer to the Device Path Protocol to be reported.
647 @retval EFI_SUCCESS The status code was reported with the extended
648 data specified by DevicePath.
649 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
650 extended data section.
651 @retval EFI_UNSUPPORTED Report status code is not supported
654 #define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type,Value,DevicePathParameter) \
655 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
656 ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
657 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
658 ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
659 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
660 ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
665 Reports a status code with an extended data buffer if the status code type
668 If the status code type specified by Type is enabled in
669 PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithExtendedData()
670 passing in Type, Value, ExtendedData, and ExtendedDataSize.
672 @param Type Status code type.
673 @param Value Status code value.
674 @param ExtendedData Pointer to the extended data buffer to be reported.
675 @param ExtendedDataSize The size, in bytes, of the extended data buffer to
678 @retval EFI_SUCCESS The status code was reported with the extended
679 data specified by ExtendedData and ExtendedDataSize.
680 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
681 extended data section.
682 @retval EFI_UNSUPPORTED Report status code is not supported
685 #define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type,Value,ExtendedData,ExtendedDataSize) \
686 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
687 ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
688 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
689 ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
690 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
691 ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
695 Reports a status code specifying all parameters if the status code type is enabled.
697 If the status code type specified by Type is enabled in
698 PcdReportStatusCodeProperyMask, then call ReportStatusCodeEx() passing in Type,
699 Value, Instance, CallerId, ExtendedDataGuid, ExtendedData, and ExtendedDataSize.
701 @param Type Status code type.
702 @param Value Status code value.
703 @param Instance Status code instance number.
704 @param CallerId Pointer to a GUID that identifies the caller of this
705 function. If this parameter is NULL, then a caller
706 ID of gEfiCallerIdGuid is used.
707 @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
708 If this parameter is NULL, then a the status code
709 standard header is filled in with
710 gEfiStatusCodeSpecificDataGuid.
711 @param ExtendedData Pointer to the extended data buffer. This is an
712 optional parameter that may be NULL.
713 @param ExtendedDataSize The size, in bytes, of the extended data buffer.
715 @retval EFI_SUCCESS The status code was reported.
716 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
717 extended data section if it was specified.
718 @retval EFI_UNSUPPORTED Report status code is not supported
721 #define REPORT_STATUS_CODE_EX(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) \
722 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
723 ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
724 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
725 ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
726 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
727 ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
731 Sends an 32-bit value to a POST card.
733 If POST codes are enabled in PcdReportStatusCodeProperyMask, then call PostCode()
734 passing in Value. Value is returned.
736 @param Value The 32-bit value to write to the POST card.
741 #define POST_CODE(Value) ReportPostCodeEnabled() ? PostCode(Value) : Value
744 Sends an 32-bit value to a POST and associated ASCII string.
746 If POST codes and POST code descriptions are enabled in
747 PcdReportStatusCodeProperyMask, then call PostCodeWithDescription() passing in
748 Value and Description. If only POST codes are enabled, then call PostCode()
749 passing in Value. Value is returned.
751 @param Value The 32-bit value to write to the POST card.
752 @param Description Pointer to an ASCII string that is a description of the
756 #define POST_CODE_WITH_DESCRIPTION(Value,Description) \
757 ReportPostCodeEnabled() ? \
758 (ReportPostCodeDescriptionEnabled() ? \
759 PostCodeWithDescription(Value,Description) : \