]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Update BaseDebugLibStdErr library
authorLiming Gao <liming.gao@intel.com>
Fri, 6 Feb 2015 06:37:10 +0000 (06:37 +0000)
committerlgao4 <lgao4@Edk2>
Fri, 6 Feb 2015 06:37:10 +0000 (06:37 +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@16794 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf

index a0aa873a4e52426a959c0bac4e06d757bea6f2a8..bbd6d946444d4672d2c39d87741930c665c03441 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Debug Lib that sends messages to the Standard Error Device in the EFI System Table.\r
 \r
-  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -258,3 +258,21 @@ 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
index db76f9b2a5761f4dc36c60fa0b9c820cc23e1f55..196487cf8c05dcd1d570d13105094e3a71af8157 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 #  Debug Lib that sends messages to the the Standard Error Device in the EFI System Table.\r
 #\r
-#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 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
@@ -48,4 +48,5 @@
 [Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue   ## SOMETIMES_CONSUMES\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask       ## CONSUMES\r
+  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES\r
 \r