summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2015-02-06 06:36:27 +0000
committerlgao4 <lgao4@Edk2>2015-02-06 06:36:27 +0000
commitdfbe4d27e5192475c32e44a77afc45a7909d686f (patch)
treed6e3c674e870bf800ff7f098e3c3fd4e68efd1f3 /MdePkg/Library
parent7c6c450a04ff30b2f4d28a07149794a2691f8c0c (diff)
downloadedk2-dfbe4d27e5192475c32e44a77afc45a7909d686f.tar.gz
edk2-dfbe4d27e5192475c32e44a77afc45a7909d686f.tar.bz2
edk2-dfbe4d27e5192475c32e44a77afc45a7909d686f.zip
MdePkg: Update BaseDebugLibConOut library
Implement new API DebugPrintLevelEnabled() to base on PCD PcdFixedDebugPrintErrorLevel. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16792 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library')
-rw-r--r--MdePkg/Library/UefiDebugLibConOut/DebugLib.c20
-rw-r--r--MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf3
2 files changed, 21 insertions, 2 deletions
diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
index e0ac471f95..2ac2204e1d 100644
--- a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
+++ b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
@@ -1,7 +1,7 @@
/** @file
UEFI Debug Library that sends messages to the Console Output Device in the EFI System Table.
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
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
@@ -257,3 +257,21 @@ DebugClearMemoryEnabled (
{
return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
}
+
+/**
+ Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
+
+ This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
+
+ @retval TRUE Current ErrorLevel is supported.
+ @retval FALSE Current ErrorLevel is not supported.
+
+**/
+BOOLEAN
+EFIAPI
+DebugPrintLevelEnabled (
+ IN CONST UINTN ErrorLevel
+ )
+{
+ return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
+}
diff --git a/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf b/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
index 8cad49ef49..583872f54e 100644
--- a/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
+++ b/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
@@ -3,7 +3,7 @@
#
# Debug Lib that sends messages to the Console Output Device in the EFI System Table.
#
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -50,4 +50,5 @@
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES
+ gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES