TianoCore EDK2 master
ReportStatusCodeLib.h
Go to the documentation of this file.
1
9#ifndef __REPORT_STATUS_CODE_LIB_H__
10#define __REPORT_STATUS_CODE_LIB_H__
11
12#include <Uefi/UefiBaseType.h>
13#include <Pi/PiStatusCode.h>
14#include <Protocol/DevicePath.h>
15
16//
17// Declare bits for PcdReportStatusCodePropertyMask
18//
19#define REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED 0x00000001
20#define REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED 0x00000002
21#define REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED 0x00000004
22
44BOOLEAN
45EFIAPI
47 IN EFI_STATUS_CODE_TYPE CodeType,
49 OUT UINT8 *PostCode
50 );
51
85BOOLEAN
86EFIAPI
88 IN EFI_STATUS_CODE_TYPE CodeType,
91 OUT CHAR8 **Filename,
92 OUT CHAR8 **Description,
93 OUT UINT32 *LineNumber
94 );
95
125BOOLEAN
126EFIAPI
129 OUT UINT32 *ErrorLevel,
130 OUT BASE_LIST *Marker,
131 OUT CHAR8 **Format
132 );
133
156EFIAPI
160 );
161
192EFIAPI
197 );
198
235EFIAPI
239 IN CONST VOID *ExtendedData,
240 IN UINTN ExtendedDataSize
241 );
242
286EFIAPI
290 IN UINT32 Instance,
291 IN CONST EFI_GUID *CallerId OPTIONAL,
292 IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
293 IN CONST VOID *ExtendedData OPTIONAL,
294 IN UINTN ExtendedDataSize
295 );
296
309BOOLEAN
310EFIAPI
312 VOID
313 );
314
327BOOLEAN
328EFIAPI
330 VOID
331 );
332
345BOOLEAN
346EFIAPI
348 VOID
349 );
350
366#define REPORT_STATUS_CODE(Type, Value) \
367 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
368 ReportStatusCode(Type,Value) : \
369 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
370 ReportStatusCode(Type,Value) : \
371 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
372 ReportStatusCode(Type,Value) : \
373 EFI_UNSUPPORTED
374
396#define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type, Value, DevicePathParameter) \
397 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
398 ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
399 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
400 ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
401 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
402 ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
403 EFI_UNSUPPORTED
404
428#define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type, Value, ExtendedData, ExtendedDataSize) \
429 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
430 ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
431 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
432 ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
433 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
434 ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
435 EFI_UNSUPPORTED
436
465#define REPORT_STATUS_CODE_EX(Type, Value, Instance, CallerId, ExtendedDataGuid, ExtendedData, ExtendedDataSize) \
466 (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
467 ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
468 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
469 ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
470 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
471 ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
472 EFI_UNSUPPORTED
473
474#endif
UINT64 UINTN
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
UINTN * BASE_LIST
Definition: Base.h:703
#define OUT
Definition: Base.h:284
BOOLEAN EFIAPI ReportErrorCodeEnabled(VOID)
EFI_STATUS EFIAPI ReportStatusCodeWithExtendedData(IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_VALUE Value, IN CONST VOID *ExtendedData, IN UINTN ExtendedDataSize)
BOOLEAN EFIAPI ReportProgressCodeEnabled(VOID)
BOOLEAN EFIAPI CodeTypeToPostCode(IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, OUT UINT8 *PostCode)
EFI_STATUS EFIAPI ReportStatusCodeWithDevicePath(IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_VALUE Value, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_STATUS EFIAPI ReportStatusCode(IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_VALUE Value)
EFI_STATUS EFIAPI ReportStatusCodeEx(IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN CONST EFI_GUID *CallerId OPTIONAL, IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL, IN CONST VOID *ExtendedData OPTIONAL, IN UINTN ExtendedDataSize)
BOOLEAN EFIAPI ReportDebugCodeEnabled(VOID)
BOOLEAN EFIAPI ReportStatusCodeExtractDebugInfo(IN CONST EFI_STATUS_CODE_DATA *Data, OUT UINT32 *ErrorLevel, OUT BASE_LIST *Marker, OUT CHAR8 **Format)
BOOLEAN EFIAPI ReportStatusCodeExtractAssertInfo(IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN CONST EFI_STATUS_CODE_DATA *Data, OUT CHAR8 **Filename, OUT CHAR8 **Description, OUT UINT32 *LineNumber)
UINT32 EFI_STATUS_CODE_VALUE
Definition: PiStatusCode.h:67
UINT32 EFI_STATUS_CODE_TYPE
Definition: PiStatusCode.h:24
UINT32 EFIAPI PostCode(IN UINT32 Value)
Definition: PostCode.c:35
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:28
Definition: Base.h:213