From c77b88d627f1624fb4bdf3c92b8122556b753c80 Mon Sep 17 00:00:00 2001 From: mdkinney Date: Thu, 10 Mar 2011 22:25:34 +0000 Subject: [PATCH] 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 --- IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc | 3 ++- .../Library/PeiDxeDebugLibReportStatusCode/DebugLib.c | 11 ++++++----- .../PeiDxeDebugLibReportStatusCode.inf | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc index 677de6d361..d73b413f1b 100644 --- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc +++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc @@ -3,7 +3,7 @@ # # This file is used to build all modules in IntelFrameworkModulePkg. # -#Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+#Copyright (c) 2007 - 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 that accompanies this distribution. #The full text of the license may be found at @@ -40,6 +40,7 @@ [LibraryClasses] DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf BaseLib|MdePkg/Library/BaseLib/BaseLib.inf SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf diff --git a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c index c9ecfd8f6d..e4ca5b5539 100644 --- a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c +++ b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c @@ -4,7 +4,7 @@ Note that if the debug message length is larger than the maximum allowable record length, then the debug message will be ignored directly. - Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 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 @@ -25,13 +25,14 @@ #include #include #include +#include /** 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 - the message specified by Format and the associated variable argument list to - the debug output device. + If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function + GetDebugPrintErrorLevel (), then print the message specified by Format and the + associated variable argument list to the debug output device. If Format is NULL, then ASSERT(). @@ -68,7 +69,7 @@ DebugPrint ( // // Check driver Debug Level value and global debug level // - if ((ErrorLevel & PcdGet32 (PcdDebugPrintErrorLevel)) == 0) { + if ((ErrorLevel & GetDebugPrintErrorLevel ()) == 0) { return; } diff --git a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf index c828bd1953..676a199382 100644 --- a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf +++ b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf @@ -2,7 +2,7 @@ # Debug Library based on report status code library # # Debug Library for PEIMs and DXE drivers that sends debug messages to ReportStatusCode -# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 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 @@ -43,9 +43,9 @@ ReportStatusCodeLib BaseMemoryLib BaseLib + DebugPrintErrorLevelLib [Pcd] - gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask -- 2.39.2