TianoCore EDK2 master
|
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootManagerLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Protocol/ReportStatusCodeHandler.h>
#include <Guid/GlobalVariable.h>
#include <Guid/StatusCodeDataTypeId.h>
#include <Pi/PiStatusCode.h>
Go to the source code of this file.
Functions | |
STATIC EFI_STATUS EFIAPI | HandleStatusCode (IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data) |
STATIC VOID EFIAPI | UnregisterAtExitBootServices (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS EFIAPI | PlatformBmPrintScRegisterHandler (VOID) |
Variables | |
STATIC EFI_STATUS_CODE_VALUE | mLoadPrep |
STATIC EFI_STATUS_CODE_VALUE | mLoadFail |
STATIC EFI_STATUS_CODE_VALUE | mStartPrep |
STATIC EFI_STATUS_CODE_VALUE | mStartFail |
Register a status code handler for printing the Boot Manager's LoadImage() and StartImage() preparations, and return codes, to the UEFI console.
This feature enables users that are not accustomed to analyzing the firmware log to glean some information about UEFI boot option processing (loading and starting).
This library instance filters out (ignores) status codes that are not reported by the containing firmware module. The intent is to link this library instance into BdsDxe via PlatformBootManagerLib (which BdsDxe depends upon), then catch only those status codes that BdsDxe reports (which happens via UefiBootManagerLib). Status codes reported by other modules (such as UiApp), via UefiBootManagerLib or otherwise, are meant to be ignored.
Copyright (C) 2019, Red Hat, Inc.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file StatusCodeHandler.c.
STATIC EFI_STATUS EFIAPI HandleStatusCode | ( | IN EFI_STATUS_CODE_TYPE | CodeType, |
IN EFI_STATUS_CODE_VALUE | Value, | ||
IN UINT32 | Instance, | ||
IN EFI_GUID * | CallerId, | ||
IN EFI_STATUS_CODE_DATA * | Data | ||
) |
Handle status codes reported through ReportStatusCodeLib / EFI_STATUS_CODE_PROTOCOL.ReportStatusCode(). Format matching status codes to the system console.
The highest TPL at which this handler can be registered with EFI_RSC_HANDLER_PROTOCOL.Register() is TPL_CALLBACK. That's because HandleStatusCode() uses the UEFI variable services.
The parameter list of this function precisely matches that of EFI_STATUS_CODE_PROTOCOL.ReportStatusCode().
The return status of this function is ignored by the caller, but the function still returns sensible codes:
EFI_SUCCESS | The status code has been processed; either as a no-op, due to filtering, or by formatting it to the system console. |
EFI_INVALID_PARAMETER | Unknown or malformed contents have been detected in Data. |
EFI_INCOMPATIBLE_VERSION | Unexpected UEFI variable behavior has been encountered. |
Definition at line 79 of file StatusCodeHandler.c.
EFI_STATUS EFIAPI PlatformBmPrintScRegisterHandler | ( | VOID | ) |
Register a status code handler for printing the Boot Manager's LoadImage() and StartImage() preparations, and return codes, to the UEFI console.
EFI_SUCCESS | The status code handler has been successfully registered. |
Definition at line 275 of file StatusCodeHandler.c.
Unregister HandleStatusCode() at ExitBootServices().
(See EFI_RSC_HANDLER_PROTOCOL in Volume 3 of the Platform Init spec.)
[in] | Event | Event whose notification function is being invoked. |
[in] | Context | Pointer to EFI_RSC_HANDLER_PROTOCOL, originally looked up when HandleStatusCode() was registered. |
Definition at line 252 of file StatusCodeHandler.c.
STATIC EFI_STATUS_CODE_VALUE mLoadFail |
Definition at line 44 of file StatusCodeHandler.c.
STATIC EFI_STATUS_CODE_VALUE mLoadPrep |
Definition at line 43 of file StatusCodeHandler.c.
STATIC EFI_STATUS_CODE_VALUE mStartFail |
Definition at line 46 of file StatusCodeHandler.c.
STATIC EFI_STATUS_CODE_VALUE mStartPrep |
Definition at line 45 of file StatusCodeHandler.c.