]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Update BaseDebugLibSerialPort library
authorLiming Gao <liming.gao@intel.com>
Fri, 6 Feb 2015 06:34:56 +0000 (06:34 +0000)
committerlgao4 <lgao4@Edk2>
Fri, 6 Feb 2015 06:34:56 +0000 (06:34 +0000)
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

MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c

index 2b59fb27b802fce3d2445d723935779636a338ea..823511b22f6bccd7683ae7b1b27ba793439ee529 100644 (file)
@@ -2,7 +2,7 @@
 #  Instance of Debug Library based on Serial Port Library.\r
 #  It uses Print Library to produce formatted output strings to seiral port device.\r
 #\r
-#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -45,4 +45,5 @@
 [Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue  ## SOMETIMES_CONSUMES\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask      ## CONSUMES\r
+  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES\r
 \r
index e1674fc25d5786b2203177394f4e6f704a3da445..6fa235c2af0cd581780fde85a2a9c3d033a6085e 100644 (file)
@@ -263,3 +263,22 @@ DebugClearMemoryEnabled (
 {\r
   return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);\r
 }\r
+\r
+/**\r
+  Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.\r
+\r
+  This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.\r
+\r
+  @retval  TRUE    Current ErrorLevel is supported.\r
+  @retval  FALSE   Current ErrorLevel is not supported.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+DebugPrintLevelEnabled (\r
+  IN  CONST UINTN        ErrorLevel\r
+  )\r
+{\r
+  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);\r
+}\r
+\r