Update DebugLib to provide support for "err" command in the EFI Shell to adjust the filter mask for DEBUG() messages. The "err" command provide the ability to adjust this filter mask at a global level through an EFI Variable and at the module level through a the Debug Mask Protocol. In order to support the degree of flexibility, the DebugLib needs to use library to abstract the get/set operations to the filter mask.

1) Update PeiDxeDebugLibReportStatusCode to use DebugPrintErrorLevelLib instead of the PcdDebugPrintErrorLevel PCD.
2) Add default mappings for the DebugPrintErrorLevelLib to the DSC file for this package.






git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11368 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
mdkinney 2011-03-10 22:25:34 +00:00
parent 48fff860a9
commit c77b88d627
3 changed files with 10 additions and 8 deletions

View File

@ -3,7 +3,7 @@
# #
# This file is used to build all modules in IntelFrameworkModulePkg. # This file is used to build all modules in IntelFrameworkModulePkg.
# #
#Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR> #Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
#This program and the accompanying materials are licensed and made available under #This program and the accompanying materials are licensed and made available under
#the terms and conditions of the BSD License that accompanies this distribution. #the terms and conditions of the BSD License that accompanies this distribution.
#The full text of the license may be found at #The full text of the license may be found at
@ -40,6 +40,7 @@
[LibraryClasses] [LibraryClasses]
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf

View File

@ -4,7 +4,7 @@
Note that if the debug message length is larger than the maximum allowable Note that if the debug message length is larger than the maximum allowable
record length, then the debug message will be ignored directly. record length, then the debug message will be ignored directly.
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -25,13 +25,14 @@
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/ReportStatusCodeLib.h> #include <Library/ReportStatusCodeLib.h>
#include <Library/PcdLib.h> #include <Library/PcdLib.h>
#include <Library/DebugPrintErrorLevelLib.h>
/** /**
Prints a debug message to the debug output device if the specified error level is enabled. Prints a debug message to the debug output device if the specified error level is enabled.
If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
the message specified by Format and the associated variable argument list to GetDebugPrintErrorLevel (), then print the message specified by Format and the
the debug output device. associated variable argument list to the debug output device.
If Format is NULL, then ASSERT(). If Format is NULL, then ASSERT().
@ -68,7 +69,7 @@ DebugPrint (
// //
// Check driver Debug Level value and global debug level // Check driver Debug Level value and global debug level
// //
if ((ErrorLevel & PcdGet32 (PcdDebugPrintErrorLevel)) == 0) { if ((ErrorLevel & GetDebugPrintErrorLevel ()) == 0) {
return; return;
} }

View File

@ -2,7 +2,7 @@
# Debug Library based on report status code library # Debug Library based on report status code library
# #
# Debug Library for PEIMs and DXE drivers that sends debug messages to ReportStatusCode # Debug Library for PEIMs and DXE drivers that sends debug messages to ReportStatusCode
# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -43,9 +43,9 @@
ReportStatusCodeLib ReportStatusCodeLib
BaseMemoryLib BaseMemoryLib
BaseLib BaseLib
DebugPrintErrorLevelLib
[Pcd] [Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask