EFI DEBUG MASK PROTOCOL

From PhoenixWiki

Jump to: navigation, search

Global service to control which debug messages are displayed.

Contents

GUID

#define EFI_DEBUG_MASK_PROTOCOL_GUID \
  { 0x4c8a2451, 0xc207, 0x405b, 0x96, 0x94, 0x99, 0xea, 0x13, 0x25, 0x13, 0x41 }

Protocol Interface Structure

#include EFI_PROTOCOL_CONSUMER(DebugMask)
extern EFI_GUID gEfiDebugMaskProtocolGuid;
typedef struct _EFI_DEBUG_MASK_PROTOCOL {
  INT64                               Revision;
  EFI_GET_DEBUG_MASK                  GetDebugMask;
  EFI_SET_DEBUG_MASK                  SetDebugMask;
} EFI_DEBUG_MASK_PROTOCOL;

Description

The DXE Core installs the Debug Mask Protocol to control the level of debug messages which are output using ReportStatusCode(). The initial debug mask is initialized using the EFI Global Variable “EFIDebug”.

Debug versions of the EDK’s EFI Driver Library use this protocol to determine the current debug level. See the PEI_DEBUG and DEBUG macros.

The following table describes the different types of masks:

Mask Description
EFI_D_INIT Initialization Messages
EFI_D_WARN Warnings
EFI_D_LOAD Load/Unload Events
EFI_D_FS File System driver messages
EFI_D_PAGE Page allocation and free.
EFI_D_POOL Pool allocation and free.
EFI_D_INFO Informational messages.
EFI_D_VARIABLE Variable service messages
EFI_D_BM Boot manager messages
EFI_D_BLKIO Block I/O driver messages.
EFI_D_NET Networking messages
EFI_D_UNDI Network transport layer messages
EFI_D_LOADFILE Load File driver messages
EFI_D_EVENT Event messages
EFI_D_ERROR Error messages
EFI_D_GENERIC Combination of EFI_D_ERROR, EFI_D_INIT, EFI_D_WARN, EFI_D_INFO, EFI_D_BLKIO, EFI_D_NET and EFI_D_UNDI
EFI_D_INTRINSIC Combination of EFI_D_EVENT, EFI_D_POOL, EFI_D_PAGE, EFI_D_BM, EFI_D_LOAD, EFI_D_VARIABLE


Related Definitions

#define EFI_DEBUG_MASK_REVISION        0x00010000
#define EFI_D_INIT        0x00000001          // Initialization style messages
#define EFI_D_WARN        0x00000002          // Warnings
#define EFI_D_LOAD        0x00000004          // Load events
#define EFI_D_FS          0x00000008          // EFI File system
#define EFI_D_POOL        0x00000010          // Alloc & Free's
#define EFI_D_PAGE        0x00000020          // Alloc & Free's
#define EFI_D_INFO        0x00000040          // Verbose
#define EFI_D_VARIABLE    0x00000100          // Variable
#define EFI_D_BM          0x00000400          // Boot Manager (BDS)
#define EFI_D_BLKIO       0x00001000          // BlkIo Driver
#define EFI_D_NET         0x00004000          // SNI Driver
#define EFI_D_UNDI        0x00010000          // UNDI Driver
#define EFI_D_LOADFILE    0x00020000          // UNDI Driver
#define EFI_D_EVENT       0x00080000          // Event messages 
#define EFI_D_ERROR       0x80000000          // Error
#define EFI_D_GENERIC (EFI_D_ERROR | EFI_D_INIT | EFI_D_WARN | EFI_D_INFO | \
                       EFI_D_BLKIO | EFI_D_NET | EFI_D_UNDI )       
#define EFI_D_INTRINSIC ( EFI_D_EVENT | EFI_D_POOL | EFI_D_PAGE | \
                          EFI_D_BM | EFI_D_LOAD | EFI_D_VARIABLE )        

GetDebugMask()

Gets the current debug mask for an image, on which this protocol has been installed.

Prototype

typedef
EFI_STATUS
(EFIAPI * EFI_GET_DEBUG_MASK) (
  IN  EFI_DEBUG_MASK_PROTOCOL *This,             
  OUT UINTN                   *CurrentDebugMask  
  );

Parameters

Parameter Description
This Points to this instance of the EFI_DEBUG_MASK_PROTOCOL.
CurrentDebugMask On return, points to the current debug mask.

Status Codes Returned

Status Code Description
EFI_SUCCESS Debug mask is retrieved successfully
EFI_INVALID_PARAMETER CurrentDebugMask is NULL.
EFI_UNSUPPORTED The handle on which this protocol is installed is not an image handle.

SetDebugMask()

Prototype

typedef 
EFI_STATUS
(EFIAPI *EFI_SET_DEBUG_MASK) (
  IN  EFI_DEBUG_MASK_PROTOCOL     *This,         
  IN  UINTN                       NewDebugMask   
  );

Parameters

Parameter Description
This Points to this instance of the EFI_DEBUG_MASK_PROTOCOL.
NewDebugMask New debug mask value to set.

Status Codes Returned

Status Code Description
EFI_SUCCESS Debug mask is updated with the new value successfully
EFI_UNSUPPORTED The handle on which this protocol is installed is not an image handle.

Copyright (C) 2008 Phoenix Technologies Ltd. All Rights Reserved.

Personal tools