diff options
author | Liming Gao <liming.gao@intel.com> | 2015-02-06 06:38:37 +0000 |
---|---|---|
committer | lgao4 <lgao4@Edk2> | 2015-02-06 06:38:37 +0000 |
commit | 5e795f936f54e86d2bfb8e131f90b4da9a367951 (patch) | |
tree | 16c7bbd72bc3979567508a26e05eeded7c73d212 /OvmfPkg | |
parent | f3b5686f7e3cf9e19a55019fba35da6ba586fb94 (diff) | |
download | edk2-5e795f936f54e86d2bfb8e131f90b4da9a367951.tar.gz edk2-5e795f936f54e86d2bfb8e131f90b4da9a367951.tar.bz2 edk2-5e795f936f54e86d2bfb8e131f90b4da9a367951.zip |
OvmfPkg: Update PlatformBaseDebugLibIoPort 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: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16797 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg')
-rw-r--r-- | OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c | 19 | ||||
-rw-r--r-- | OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf | 3 |
2 files changed, 20 insertions, 2 deletions
diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c index 84299ca783..585f9fb111 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c @@ -2,7 +2,7 @@ Base Debug library instance for QEMU debug port.
It uses PrintLib to send debug messages to a fixed I/O port.
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2012, Red Hat, Inc.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -267,3 +267,20 @@ 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/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf index a70c7b5360..0e74fe94cb 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf @@ -2,7 +2,7 @@ # Instance of Debug Library for the QEMU debug console port.
# It uses Print Library to produce formatted output strings.
#
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2012, Red Hat, Inc.<BR>
#
# This program and the accompanying materials
@@ -47,4 +47,5 @@ gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES
+ gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
|