diff options
author | Liming Gao <liming.gao@intel.com> | 2015-02-06 06:34:56 +0000 |
---|---|---|
committer | lgao4 <lgao4@Edk2> | 2015-02-06 06:34:56 +0000 |
commit | 243dfd85199004b355b5feddd3d6e164f2551e6a (patch) | |
tree | 53aed4587569c151f576ff58c4a35180c56f5379 /MdePkg/Library/BaseDebugLibSerialPort | |
parent | 8b1aa27a217cb74f1a0fed61894a071afc5d3f4d (diff) | |
download | edk2-243dfd85199004b355b5feddd3d6e164f2551e6a.tar.gz edk2-243dfd85199004b355b5feddd3d6e164f2551e6a.tar.bz2 edk2-243dfd85199004b355b5feddd3d6e164f2551e6a.zip |
MdePkg: Update BaseDebugLibSerialPort 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@16790 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseDebugLibSerialPort')
-rw-r--r-- | MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf | 3 | ||||
-rw-r--r-- | MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c | 19 |
2 files changed, 21 insertions, 1 deletions
diff --git a/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf b/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf index 2b59fb27b8..823511b22f 100644 --- a/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf +++ b/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf @@ -2,7 +2,7 @@ # Instance of Debug Library based on Serial Port Library.
# It uses Print Library to produce formatted output strings to seiral port device.
#
-# Copyright (c) 2006 - 2014, 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
@@ -45,4 +45,5 @@ [Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES
+ gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c index e1674fc25d..6fa235c2af 100644 --- a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c +++ b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c @@ -263,3 +263,22 @@ 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);
+}
+
|