EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions | Variables

MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c File Reference

#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_TABLEmSystemTable = NULL

Detailed Description

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, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file DxeDebugPrintErrorLevelLib.c.


Function Documentation

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.

Parameters:
ImageHandleThe firmware allocated handle for the EFI image.
SystemTableA pointer to the EFI System Table.
Return values:
EFI_SUCCESSThe constructor completed successfully.
Othervalue The constructor did not complete successfully.

Definition at line 122 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.

Parameters:
ImageHandleThe firmware allocated handle for the EFI image.
SystemTableA pointer to the EFI System Table.
Return values:
EFI_SUCCESSThe destructor completed successfully.
Othervalue The destructor did not complete successfully.

Definition at line 169 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.

Parameters:
ThisThe protocol instance pointer.
CurrentDebugMaskPointer to the debug print error level mask that is returned.
Return values:
EFI_SUCCESSThe current debug print error level mask was returned in CurrentDebugMask.
EFI_INVALID_PARAMETERCurrentDebugMask is NULL.
EFI_DEVICE_ERRORThe 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.

Parameters:
ThisThe protocol instance pointer.
CurrentDebugMaskPointer to the debug print error level mask that is returned.
Return values:
EFI_SUCCESSThe current debug print error level mask was returned in CurrentDebugMask.
EFI_INVALID_PARAMETERCurrentDebugMask is NULL.
EFI_DEVICE_ERRORThe current debug print error level mask could not be retrieved.

Definition at line 347 of file DxeDebugPrintErrorLevelLib.c.

UINT32 EFIAPI GetDebugPrintErrorLevel ( VOID  )

Returns the debug print error level mask for the current module.

Returns:
Debug print error level mask for the current module.

Definition at line 192 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.

Parameters:
ThisThe protocol instance pointer.
NewDebugMaskThe new debug print error level mask for this module.
Return values:
EFI_SUCCESSThe current debug print error level mask was set to the value specified by NewDebugMask.
EFI_DEVICE_ERRORThe current debug print error level mask could not be set to the value specified by NewDebugMask.

Definition at line 378 of file DxeDebugPrintErrorLevelLib.c.

BOOLEAN EFIAPI SetDebugPrintErrorLevel ( UINT32  ErrorLevel)

Sets the global debug print error level mask fpr the entire platform.

Parameters:
ErrorLevelGlobal debug print error level
Return values:
TRUEThe debug print error level mask was sucessfully set.
FALSEThe debug print error level mask could not be set.

Definition at line 282 of file DxeDebugPrintErrorLevelLib.c.


Variable Documentation

Initial value:

Debug Mask Protocol instance

Definition at line 75 of file DxeDebugPrintErrorLevelLib.c.

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 99 of file DxeDebugPrintErrorLevelLib.c.

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 87 of file DxeDebugPrintErrorLevelLib.c.

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 107 of file DxeDebugPrintErrorLevelLib.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines