]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/ReportStatusCodeLib.h
Initial import.
[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 #define REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED 0x00000008
25 #define REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED 0x00000010
26
27 //
28 // Extended Data structure definitions with EFI_STATUS_CODE_DATA headers removed
29 //
30
31 ///
32 /// Voltage Extended Error Data
33 ///
34 typedef struct {
35 EFI_EXP_BASE10_DATA Voltage;
36 EFI_EXP_BASE10_DATA Threshold;
37 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_VOLTAGE_ERROR_DATA;
38
39 ///
40 /// Microcode Update Extended Error Data
41 ///
42 typedef struct {
43 UINT32 Version;
44 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA;
45
46 ///
47 /// Asynchronous Timer Extended Error Data
48 ///
49 typedef struct {
50 EFI_EXP_BASE10_DATA TimerLimit;
51 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA;
52
53 ///
54 /// Host Processor Mismatch Extended Error Data
55 ///
56 typedef struct {
57 UINT32 Instance;
58 UINT16 Attributes;
59 } REPORT_STATUS_CODE_LIBRARY_HOST_PROCESSOR_MISMATCH_ERROR_DATA;
60
61 ///
62 /// Thermal Extended Error Data
63 ///
64 typedef struct {
65 EFI_EXP_BASE10_DATA Temperature;
66 EFI_EXP_BASE10_DATA Threshold;
67 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_THERMAL_ERROR_DATA;
68
69 ///
70 /// Processor Disabled Extended Error Data
71 ///
72 typedef struct {
73 UINT32 Cause;
74 BOOLEAN SoftwareDisabled;
75 } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA;
76
77 ///
78 /// Embedded cache init extended data
79 ///
80 typedef struct {
81 UINT32 Level;
82 EFI_INIT_CACHE_TYPE Type;
83 } REPORT_STATUS_CODE_LIBRARY_CACHE_INIT_DATA;
84
85 ///
86 /// Memory Extended Error Data
87 ///
88 typedef struct {
89 EFI_MEMORY_ERROR_GRANULARITY Granularity;
90 EFI_MEMORY_ERROR_OPERATION Operation;
91 UINTN Syndrome;
92 EFI_PHYSICAL_ADDRESS Address;
93 UINTN Resolution;
94 } REPORT_STATUS_CODE_LIBRARY_MEMORY_EXTENDED_ERROR_DATA;
95
96 ///
97 /// DIMM number
98 ///
99 typedef struct {
100 UINT16 Array;
101 UINT16 Device;
102 } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_DIMM_NUMBER;
103
104 ///
105 /// Memory Module Mismatch Extended Error Data
106 ///
107 typedef struct {
108 EFI_STATUS_CODE_DIMM_NUMBER Instance;
109 } REPORT_STATUS_CODE_LIBRARY_MEMORY_MODULE_MISMATCH_ERROR_DATA;
110
111 ///
112 /// Memory Range Extended Data
113 ///
114 typedef struct {
115 EFI_PHYSICAL_ADDRESS Start;
116 EFI_PHYSICAL_ADDRESS Length;
117 } REPORT_STATUS_CODE_LIBRARY_MEMORY_RANGE_EXTENDED_DATA;
118
119 ///
120 /// Device handle Extended Data. Used for many
121 /// errors and progress codes to point to the device.
122 ///
123 typedef struct {
124 EFI_HANDLE Handle;
125 } REPORT_STATUS_CODE_LIBRARY_DEVICE_HANDLE_EXTENDED_DATA;
126
127 typedef struct {
128 UINT8 *DevicePath;
129 } REPORT_STATUS_CODE_LIBRARY_DEVICE_PATH_EXTENDED_DATA;
130
131 typedef struct {
132 EFI_HANDLE ControllerHandle;
133 EFI_HANDLE DriverBindingHandle;
134 UINT16 DevicePathSize;
135 UINT8 *RemainingDevicePath;
136 } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_START_EXTENDED_DATA;
137
138 ///
139 /// Resource Allocation Failure Extended Error Data
140 ///
141 typedef struct {
142 UINT32 Bar;
143 UINT16 DevicePathSize;
144 UINT16 ReqResSize;
145 UINT16 AllocResSize;
146 UINT8 *DevicePath;
147 UINT8 *ReqRes;
148 UINT8 *AllocRes;
149 } REPORT_STATUS_CODE_LIBRARY_RESOURCE_ALLOC_FAILURE_ERROR_DATA;
150
151 ///
152 /// Extended Error Data for Assert
153 ///
154 typedef struct {
155 UINT32 LineNumber;
156 UINT32 FileNameSize;
157 EFI_STATUS_CODE_STRING_DATA *FileName;
158 } REPORT_STATUS_CODE_LIBRARY_DEBUG_ASSERT_DATA;
159
160 ///
161 /// System Context Data EBC/IA32/IPF
162 ///
163 typedef struct {
164 EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT Context;
165 } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_EXCEP_EXTENDED_DATA;
166
167 ///
168 /// Legacy Oprom extended data
169 ///
170 typedef struct {
171 EFI_HANDLE DeviceHandle;
172 EFI_PHYSICAL_ADDRESS RomImageBase;
173 } REPORT_STATUS_CODE_LIBRARY_LEGACY_OPROM_EXTENDED_DATA;
174
175 //
176 // Extern for the modules Caller ID GUID
177 //
178 extern EFI_GUID gEfiCallerIdGuid;
179
180 /**
181 Converts a status code to an 8-bit POST code value.
182
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.
188
189 If PostCode is NULL, then ASSERT().
190
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.
194
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.
199
200 **/
201 BOOLEAN
202 EFIAPI
203 CodeTypeToPostCode (
204 IN EFI_STATUS_CODE_TYPE CodeType,
205 IN EFI_STATUS_CODE_VALUE Value,
206 OUT UINT8 *PostCode
207 );
208
209
210 /**
211 Extracts ASSERT() information from a status code structure.
212
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.
223
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().
228
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().
235
236 @retval TRUE The status code specified by CodeType, Value, and Data was
237 converted ASSERT() arguments specified by Filename, Description,
238 and LineNumber.
239 @retval FALSE The status code specified by CodeType, Value, and Data could
240 not be converted to ASSERT() arguments.
241
242 **/
243 BOOLEAN
244 EFIAPI
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
252 );
253
254
255 /**
256 Extracts DEBUG() information from a status code structure.
257
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.
266
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().
271
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
276 debug message.
277
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
281 DEBUG() arguments.
282
283 **/
284 BOOLEAN
285 EFIAPI
286 ReportStatusCodeExtractDebugInfo (
287 IN EFI_STATUS_CODE_DATA *Data,
288 OUT UINT32 *ErrorLevel,
289 OUT VA_LIST *Marker,
290 OUT CHAR8 **Format
291 );
292
293
294 /**
295 Reports a status code.
296
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.
301
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.
305
306 @param Type Status code type.
307 @param Value Status code value.
308
309 @retval EFI_SUCCESS The status code was reported.
310 @retval EFI_DEVICE_ERROR There status code could not be reported due to a
311 device error.
312 @retval EFI_UNSUPPORTED Report status code is not supported
313
314 **/
315 EFI_STATUS
316 EFIAPI
317 ReportStatusCode (
318 IN EFI_STATUS_CODE_TYPE Type,
319 IN EFI_STATUS_CODE_VALUE Value
320 );
321
322
323 /**
324 Reports a status code with a Device Path Protocol as the extended data.
325
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.
332
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.
337
338 If DevicePath is NULL, then ASSERT().
339
340 @param Type Status code type.
341 @param Value Status code value.
342 @param DevicePath Pointer to the Device Path Protocol to be reported.
343
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
349
350 **/
351 EFI_STATUS
352 EFIAPI
353 ReportStatusCodeWithDevicePath (
354 IN EFI_STATUS_CODE_TYPE Type,
355 IN EFI_STATUS_CODE_VALUE Value,
356 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
357 );
358
359
360 /**
361 Reports a status code with an extended data buffer.
362
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.
371
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.
376
377 If ExtendedData is NULL, then ASSERT().
378 If ExtendedDataSize is 0, then ASSERT().
379
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
384 be reported.
385
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
391
392 **/
393 EFI_STATUS
394 EFIAPI
395 ReportStatusCodeWithExtendedData (
396 IN EFI_STATUS_CODE_TYPE Type,
397 IN EFI_STATUS_CODE_VALUE Value,
398 IN VOID *ExtendedData,
399 IN UINTN ExtendedDataSize
400 );
401
402
403 /**
404 Reports a status code with full parameters.
405
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.
416
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.
420
421 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
422 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
423
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.
437
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
442
443 **/
444 EFI_STATUS
445 EFIAPI
446 ReportStatusCodeEx (
447 IN EFI_STATUS_CODE_TYPE Type,
448 IN EFI_STATUS_CODE_VALUE Value,
449 IN UINT32 Instance,
450 IN EFI_GUID *CallerId OPTIONAL,
451 IN EFI_GUID *ExtendedDataGuid OPTIONAL,
452 IN VOID *ExtendedData OPTIONAL,
453 IN UINTN ExtendedDataSize
454 );
455
456
457 /**
458 Sends an 32-bit value to a POST card.
459
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.
465
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.
469
470 @param Value The 32-bit value to write to the POST card.
471
472 @return Value
473
474 **/
475 UINT32
476 EFIAPI
477 PostCode (
478 IN UINT32 Value
479 );
480
481
482 /**
483 Sends an 32-bit value to a POST and associated ASCII string.
484
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.
492
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
496 immediately.
497
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
501 be NULL.
502
503 @return Value
504
505 **/
506 UINT32
507 EFIAPI
508 PostCodeWithDescription (
509 IN UINT32 Value,
510 IN CONST CHAR8 *Description OPTIONAL
511 );
512
513
514 /**
515 Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
516
517 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
518 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
519
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.
524
525 **/
526 BOOLEAN
527 EFIAPI
528 ReportProgressCodeEnabled (
529 VOID
530 );
531
532
533 /**
534 Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
535
536 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
537 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
538
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.
543
544 **/
545 BOOLEAN
546 EFIAPI
547 ReportErrorCodeEnabled (
548 VOID
549 );
550
551
552 /**
553 Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
554
555 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
556 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
557
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.
562
563 **/
564 BOOLEAN
565 EFIAPI
566 ReportDebugCodeEnabled (
567 VOID
568 );
569
570
571 /**
572 Returns TRUE if POST Codes are enabled.
573
574 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED
575 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
576
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.
581
582 **/
583 BOOLEAN
584 EFIAPI
585 ReportPostCodeEnabled (
586 VOID
587 );
588
589
590 /**
591 Returns TRUE if POST code descriptions are enabled.
592
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.
596
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.
601
602 **/
603 BOOLEAN
604 EFIAPI
605 ReportPostCodeDescriptionEnabled (
606 VOID
607 );
608
609
610 /**
611 Reports a status code with minimal parameters if the status code type is enabled.
612
613 If the status code type specified by Type is enabled in
614 PcdReportStatusCodeProperyMask, then call ReportStatusCode() passing in Type
615 and Value.
616
617 @param Type Status code type.
618 @param Value Status code value.
619
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
623
624 **/
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) : \
632 EFI_UNSUPPORTED
633
634
635 /**
636 Reports a status code with a Device Path Protocol as the extended data if the
637 status code type is enabled.
638
639 If the status code type specified by Type is enabled in
640 PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithDevicePath()
641 passing in Type, Value, and DevicePath.
642
643 @param Type Status code type.
644 @param Value Status code value.
645 @param DevicePath Pointer to the Device Path Protocol to be reported.
646
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
652
653 **/
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) : \
661 EFI_UNSUPPORTED
662
663
664 /**
665 Reports a status code with an extended data buffer if the status code type
666 is enabled.
667
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.
671
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
676 be reported.
677
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
683
684 **/
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) : \
692 EFI_UNSUPPORTED
693
694 /**
695 Reports a status code specifying all parameters if the status code type is enabled.
696
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.
700
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.
714
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
719
720 **/
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) : \
728 EFI_UNSUPPORTED
729
730 /**
731 Sends an 32-bit value to a POST card.
732
733 If POST codes are enabled in PcdReportStatusCodeProperyMask, then call PostCode()
734 passing in Value. Value is returned.
735
736 @param Value The 32-bit value to write to the POST card.
737
738 @return Value
739
740 **/
741 #define POST_CODE(Value) ReportPostCodeEnabled() ? PostCode(Value) : Value
742
743 /**
744 Sends an 32-bit value to a POST and associated ASCII string.
745
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.
750
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
753 POST code value.
754
755 **/
756 #define POST_CODE_WITH_DESCRIPTION(Value,Description) \
757 ReportPostCodeEnabled() ? \
758 (ReportPostCodeDescriptionEnabled() ? \
759 PostCodeWithDescription(Value,Description) : \
760 PostCode(Value)) : \
761 Value
762
763 #endif