]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: Update PlatformBaseDebugLibIoPort library
authorLiming Gao <liming.gao@intel.com>
Fri, 6 Feb 2015 06:38:37 +0000 (06:38 +0000)
committerlgao4 <lgao4@Edk2>
Fri, 6 Feb 2015 06:38:37 +0000 (06:38 +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: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16797 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf

index 84299ca7832eba1eefc92552b24cba3b3bba7880..585f9fb111d70195c488043d8d18a4fe7ec959c1 100644 (file)
@@ -2,7 +2,7 @@
   Base Debug library instance for QEMU debug port.\r
   It uses PrintLib to send debug messages to a fixed I/O port.\r
 \r
-  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   Copyright (c) 2012, Red Hat, Inc.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -267,3 +267,20 @@ DebugClearMemoryEnabled (
   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 a70c7b53608b4a7cfd2f0d3822f1a454221da560..0e74fe94cbc00d516adef8be38f8db649c3dfe15 100644 (file)
@@ -2,7 +2,7 @@
 #  Instance of Debug Library for the QEMU debug console port.\r
 #  It uses Print Library to produce formatted output strings.\r
 #\r
-#  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 #  Copyright (c) 2012, Red Hat, Inc.<BR>\r
 #\r
 #  This program and the accompanying materials\r
@@ -47,4 +47,5 @@
   gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort                ## CONSUMES\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue        ## CONSUMES\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask            ## CONSUMES\r
+  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel    ## CONSUMES\r
 \r