TianoCore EDK2 master
|
#include <PiDxe.h>
#include <Library/DebugPrintErrorLevelLib.h>
#include <Library/PcdLib.h>
#include <Library/HobLib.h>
#include <Guid/DebugMask.h>
Go to the source code of this file.
Functions | |
EFI_STATUS EFIAPI | GetDebugMask (IN EFI_DEBUG_MASK_PROTOCOL *This, IN OUT UINTN *CurrentDebugMask) |
EFI_STATUS EFIAPI | SetDebugMask (IN EFI_DEBUG_MASK_PROTOCOL *This, IN UINTN NewDebugMask) |
EFI_STATUS EFIAPI | DxeDebugPrintErrorLevelLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
EFI_STATUS EFIAPI | DxeDebugPrintErrorLevelLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
UINT32 EFIAPI | GetDebugPrintErrorLevel (VOID) |
BOOLEAN EFIAPI | SetDebugPrintErrorLevel (UINT32 ErrorLevel) |
Variables | |
EFI_DEBUG_MASK_PROTOCOL | mDebugMaskProtocol |
BOOLEAN | mGlobalErrorLevelInitialized = FALSE |
UINT32 | mDebugPrintErrorLevel = 0 |
EFI_SYSTEM_TABLE * | mSystemTable = NULL |
Debug Print Error Level library instance that provide compatibility with the "err" shell command. This includes support for the Debug Mask Protocol supports for global debug print error level mask stored in an EFI Variable. This library instance only support DXE Phase modules.
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file DxeDebugPrintErrorLevelLib.c.
EFI_STATUS EFIAPI DxeDebugPrintErrorLevelLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The constructor function caches the PCI Express Base Address and creates a Set Virtual Address Map event to convert physical address to virtual addresses.
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The constructor completed successfully. |
Other | value The constructor did not complete successfully. |
Definition at line 116 of file DxeDebugPrintErrorLevelLib.c.
EFI_STATUS EFIAPI DxeDebugPrintErrorLevelLibDestructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The destructor function frees any allocated buffers and closes the Set Virtual Address Map event.
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The destructor completed successfully. |
Other | value The destructor did not complete successfully. |
Definition at line 164 of file DxeDebugPrintErrorLevelLib.c.
EFI_STATUS EFIAPI GetDebugMask | ( | IN EFI_DEBUG_MASK_PROTOCOL * | This, |
IN OUT UINTN * | CurrentDebugMask | ||
) |
Debug Mask Protocol function prototypes Retrieves the current debug print error level mask for a module are returns it in CurrentDebugMask.
This | The protocol instance pointer. |
CurrentDebugMask | Pointer to the debug print error level mask that is returned. |
EFI_SUCCESS | The current debug print error level mask was returned in CurrentDebugMask. |
EFI_INVALID_PARAMETER | CurrentDebugMask is NULL. |
EFI_DEVICE_ERROR | The current debug print error level mask could not be retrieved. |
Retrieves the current debug print error level mask for a module are returns it in CurrentDebugMask.
This | The protocol instance pointer. |
CurrentDebugMask | Pointer to the debug print error level mask that is returned. |
EFI_SUCCESS | The current debug print error level mask was returned in CurrentDebugMask. |
EFI_INVALID_PARAMETER | CurrentDebugMask is NULL. |
EFI_DEVICE_ERROR | The current debug print error level mask could not be retrieved. |
Definition at line 344 of file DxeDebugPrintErrorLevelLib.c.
UINT32 EFIAPI GetDebugPrintErrorLevel | ( | VOID | ) |
Returns the debug print error level mask for the current module.
Definition at line 188 of file DxeDebugPrintErrorLevelLib.c.
EFI_STATUS EFIAPI SetDebugMask | ( | IN EFI_DEBUG_MASK_PROTOCOL * | This, |
IN UINTN | NewDebugMask | ||
) |
Sets the current debug print error level mask for a module to the value specified by NewDebugMask.
This | The protocol instance pointer. |
NewDebugMask | The new debug print error level mask for this module. |
EFI_SUCCESS | The current debug print error level mask was set to the value specified by NewDebugMask. |
EFI_DEVICE_ERROR | The current debug print error level mask could not be set to the value specified by NewDebugMask. |
Definition at line 375 of file DxeDebugPrintErrorLevelLib.c.
BOOLEAN EFIAPI SetDebugPrintErrorLevel | ( | UINT32 | ErrorLevel | ) |
Sets the global debug print error level mask fpr the entire platform.
ErrorLevel | Global debug print error level |
TRUE | The debug print error level mask was sucessfully set. |
FALSE | The debug print error level mask could not be set. |
Definition at line 278 of file DxeDebugPrintErrorLevelLib.c.
EFI_DEBUG_MASK_PROTOCOL mDebugMaskProtocol |
Debug Mask Protocol instance
Definition at line 69 of file DxeDebugPrintErrorLevelLib.c.
UINT32 mDebugPrintErrorLevel = 0 |
Global variable that contains the current debug error level mask for the module that is using this library instance. This variable is initially set to the PcdDebugPrintErrorLevel value. If the EFI Variable exists that contains the global debug print error level mask, then that overrides the PcdDebugPrintErrorLevel value. The EFI Variable can optionally be discovered via a HOB so early DXE drivers can access the variable. If the Debug Mask Protocol SetDebugMask() service is called, then that overrides the PcdDebugPrintErrorLevel and the EFI Variable setting.
Definition at line 93 of file DxeDebugPrintErrorLevelLib.c.
BOOLEAN mGlobalErrorLevelInitialized = FALSE |
Global variable that is set to TRUE after the first attempt is made to retrieve the global error level mask through the EFI Varibale Services. This variable prevents the EFI Variable Services from being called fort every DEBUG() macro.
Definition at line 81 of file DxeDebugPrintErrorLevelLib.c.
EFI_SYSTEM_TABLE* mSystemTable = NULL |
Global variable that is used to cache a pointer to the EFI System Table that is required to access the EFI Variable Services to get and set the global debug print error level mask value. The UefiBootServicesTableLib is not used to prevent a circular dependency between these libraries.
Definition at line 101 of file DxeDebugPrintErrorLevelLib.c.