From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.45]) by mx.groups.io with SMTP id smtpd.web11.10191.1589302963220227339 for ; Tue, 12 May 2020 10:02:44 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: ispras.ru, ip: 83.149.199.45, mailfrom: cheptsov@ispras.ru) Received: from localhost.localdomain (unknown [77.232.9.83]) by mail.ispras.ru (Postfix) with ESMTPSA id B631DCD464; Tue, 12 May 2020 20:02:38 +0300 (MSK) From: "Vitaly Cheptsov" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao Subject: [PATCH V5 01/27] MdePkg: Introduce DebugCommonLib interface and BaseDebugCommonLib Date: Tue, 12 May 2020 20:02:11 +0300 Message-Id: <20200512170237.19796-2-cheptsov@ispras.ru> X-Mailer: git-send-email 2.24.2 (Apple Git-127) In-Reply-To: <20200512170237.19796-1-cheptsov@ispras.ru> References: <20200512170237.19796-1-cheptsov@ispras.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2054 This library allows to make a common part of all DebugLib instances and avoid the need to update every DebugLib on extending a new debug mask PCD bit. CC: Michael D Kinney CC: Liming Gao Signed-off-by: Vitaly Cheptsov --- MdePkg/Include/Library/DebugCommonLib.h | 154 +++++++++++= +++++++++ MdePkg/Include/Library/DebugLib.h | 137 +----------= ------ MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf | 35 +++++ MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.uni | 16 ++ MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c | 113 +++++++++++= +++ MdePkg/MdePkg.dec | 3 + MdePkg/MdePkg.dsc | 1 + 7 files changed, 323 insertions(+), 136 deletions(-) diff --git a/MdePkg/Include/Library/DebugCommonLib.h b/MdePkg/Include/Libra= ry/DebugCommonLib.h new file mode 100644 index 0000000000..31249f91fa --- /dev/null +++ b/MdePkg/Include/Library/DebugCommonLib.h @@ -0,0 +1,154 @@ +/** @file=0D + Provides services to access common debugging features.=0D +=0D + The debug common library interface provides common code for all debug li= braries.=0D +=0D + Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2020, Vitaly Cheptsov. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#ifndef __DEBUG_COMMON_LIB_H__=0D +#define __DEBUG_COMMON_LIB_H__=0D +=0D +//=0D +// Declare bits for PcdDebugPropertyMask=0D +//=0D +#define DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED 0x01=0D +#define DEBUG_PROPERTY_DEBUG_PRINT_ENABLED 0x02=0D +#define DEBUG_PROPERTY_DEBUG_CODE_ENABLED 0x04=0D +#define DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED 0x08=0D +#define DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED 0x10=0D +#define DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED 0x20=0D +=0D +//=0D +// Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter o= f DebugPrint()=0D +//=0D +#define DEBUG_INIT 0x00000001 // Initialization=0D +#define DEBUG_WARN 0x00000002 // Warnings=0D +#define DEBUG_LOAD 0x00000004 // Load events=0D +#define DEBUG_FS 0x00000008 // EFI File system=0D +#define DEBUG_POOL 0x00000010 // Alloc & Free (pool)=0D +#define DEBUG_PAGE 0x00000020 // Alloc & Free (page)=0D +#define DEBUG_INFO 0x00000040 // Informational debug messages=0D +#define DEBUG_DISPATCH 0x00000080 // PEI/DXE/SMM Dispatchers=0D +#define DEBUG_VARIABLE 0x00000100 // Variable=0D +#define DEBUG_BM 0x00000400 // Boot Manager=0D +#define DEBUG_BLKIO 0x00001000 // BlkIo Driver=0D +#define DEBUG_NET 0x00004000 // Network Io Driver=0D +#define DEBUG_UNDI 0x00010000 // UNDI Driver=0D +#define DEBUG_LOADFILE 0x00020000 // LoadFile=0D +#define DEBUG_EVENT 0x00080000 // Event messages=0D +#define DEBUG_GCD 0x00100000 // Global Coherency Database changes=0D +#define DEBUG_CACHE 0x00200000 // Memory range cachability changes=0D +#define DEBUG_VERBOSE 0x00400000 // Detailed debug messages that may=0D + // significantly impact boot performan= ce=0D +#define DEBUG_ERROR 0x80000000 // Error=0D +=0D +//=0D +// Aliases of debug message mask bits=0D +//=0D +#define EFI_D_INIT DEBUG_INIT=0D +#define EFI_D_WARN DEBUG_WARN=0D +#define EFI_D_LOAD DEBUG_LOAD=0D +#define EFI_D_FS DEBUG_FS=0D +#define EFI_D_POOL DEBUG_POOL=0D +#define EFI_D_PAGE DEBUG_PAGE=0D +#define EFI_D_INFO DEBUG_INFO=0D +#define EFI_D_DISPATCH DEBUG_DISPATCH=0D +#define EFI_D_VARIABLE DEBUG_VARIABLE=0D +#define EFI_D_BM DEBUG_BM=0D +#define EFI_D_BLKIO DEBUG_BLKIO=0D +#define EFI_D_NET DEBUG_NET=0D +#define EFI_D_UNDI DEBUG_UNDI=0D +#define EFI_D_LOADFILE DEBUG_LOADFILE=0D +#define EFI_D_EVENT DEBUG_EVENT=0D +#define EFI_D_VERBOSE DEBUG_VERBOSE=0D +#define EFI_D_ERROR DEBUG_ERROR=0D +=0D +/**=0D + Returns TRUE if ASSERT() macros are enabled.=0D +=0D + This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bi= t of=0D + PcdDebugProperyMask is set. Otherwise, FALSE is returned.=0D +=0D + @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebug= ProperyMask is set.=0D + @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebug= ProperyMask is clear.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +DebugAssertEnabled (=0D + VOID=0D + );=0D +=0D +=0D +/**=0D + Returns TRUE if DEBUG() macros are enabled.=0D +=0D + This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit= of=0D + PcdDebugProperyMask is set. Otherwise, FALSE is returned.=0D +=0D + @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugP= roperyMask is set.=0D + @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugP= roperyMask is clear.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +DebugPrintEnabled (=0D + VOID=0D + );=0D +=0D +=0D +/**=0D + Returns TRUE if DEBUG_CODE() macros are enabled.=0D +=0D + This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit = of=0D + PcdDebugProperyMask is set. Otherwise, FALSE is returned.=0D +=0D + @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPr= operyMask is set.=0D + @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPr= operyMask is clear.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +DebugCodeEnabled (=0D + VOID=0D + );=0D +=0D +=0D +/**=0D + Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.=0D +=0D + This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bi= t of=0D + PcdDebugProperyMask is set. Otherwise, FALSE is returned.=0D +=0D + @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebug= ProperyMask is set.=0D + @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebug= ProperyMask is clear.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +DebugClearMemoryEnabled (=0D + VOID=0D + );=0D +=0D +=0D +/**=0D + Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixe= dDebugPrintErrorLevel.=0D +=0D + This function compares the bit mask of ErrorLevel and PcdFixedDebugPrint= ErrorLevel.=0D +=0D + @retval TRUE Current ErrorLevel is supported.=0D + @retval FALSE Current ErrorLevel is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +DebugPrintLevelEnabled (=0D + IN CONST UINTN ErrorLevel=0D + );=0D +=0D +=0D +#endif=0D diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/Deb= ugLib.h index baab34bf05..a38e0e2904 100644 --- a/MdePkg/Include/Library/DebugLib.h +++ b/MdePkg/Include/Library/DebugLib.h @@ -16,60 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef __DEBUG_LIB_H__=0D #define __DEBUG_LIB_H__=0D =0D -//=0D -// Declare bits for PcdDebugPropertyMask=0D -//=0D -#define DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED 0x01=0D -#define DEBUG_PROPERTY_DEBUG_PRINT_ENABLED 0x02=0D -#define DEBUG_PROPERTY_DEBUG_CODE_ENABLED 0x04=0D -#define DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED 0x08=0D -#define DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED 0x10=0D -#define DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED 0x20=0D -=0D -//=0D -// Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter o= f DebugPrint()=0D -//=0D -#define DEBUG_INIT 0x00000001 // Initialization=0D -#define DEBUG_WARN 0x00000002 // Warnings=0D -#define DEBUG_LOAD 0x00000004 // Load events=0D -#define DEBUG_FS 0x00000008 // EFI File system=0D -#define DEBUG_POOL 0x00000010 // Alloc & Free (pool)=0D -#define DEBUG_PAGE 0x00000020 // Alloc & Free (page)=0D -#define DEBUG_INFO 0x00000040 // Informational debug messages=0D -#define DEBUG_DISPATCH 0x00000080 // PEI/DXE/SMM Dispatchers=0D -#define DEBUG_VARIABLE 0x00000100 // Variable=0D -#define DEBUG_BM 0x00000400 // Boot Manager=0D -#define DEBUG_BLKIO 0x00001000 // BlkIo Driver=0D -#define DEBUG_NET 0x00004000 // Network Io Driver=0D -#define DEBUG_UNDI 0x00010000 // UNDI Driver=0D -#define DEBUG_LOADFILE 0x00020000 // LoadFile=0D -#define DEBUG_EVENT 0x00080000 // Event messages=0D -#define DEBUG_GCD 0x00100000 // Global Coherency Database changes=0D -#define DEBUG_CACHE 0x00200000 // Memory range cachability changes=0D -#define DEBUG_VERBOSE 0x00400000 // Detailed debug messages that may=0D - // significantly impact boot performan= ce=0D -#define DEBUG_ERROR 0x80000000 // Error=0D -=0D -//=0D -// Aliases of debug message mask bits=0D -//=0D -#define EFI_D_INIT DEBUG_INIT=0D -#define EFI_D_WARN DEBUG_WARN=0D -#define EFI_D_LOAD DEBUG_LOAD=0D -#define EFI_D_FS DEBUG_FS=0D -#define EFI_D_POOL DEBUG_POOL=0D -#define EFI_D_PAGE DEBUG_PAGE=0D -#define EFI_D_INFO DEBUG_INFO=0D -#define EFI_D_DISPATCH DEBUG_DISPATCH=0D -#define EFI_D_VARIABLE DEBUG_VARIABLE=0D -#define EFI_D_BM DEBUG_BM=0D -#define EFI_D_BLKIO DEBUG_BLKIO=0D -#define EFI_D_NET DEBUG_NET=0D -#define EFI_D_UNDI DEBUG_UNDI=0D -#define EFI_D_LOADFILE DEBUG_LOADFILE=0D -#define EFI_D_EVENT DEBUG_EVENT=0D -#define EFI_D_VERBOSE DEBUG_VERBOSE=0D -#define EFI_D_ERROR DEBUG_ERROR=0D +#include =0D =0D /**=0D Prints a debug message to the debug output device if the specified error= level is enabled.=0D @@ -198,88 +145,6 @@ DebugClearMemory ( );=0D =0D =0D -/**=0D - Returns TRUE if ASSERT() macros are enabled.=0D -=0D - This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bi= t of=0D - PcdDebugProperyMask is set. Otherwise, FALSE is returned.=0D -=0D - @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebug= ProperyMask is set.=0D - @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebug= ProperyMask is clear.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -DebugAssertEnabled (=0D - VOID=0D - );=0D -=0D -=0D -/**=0D - Returns TRUE if DEBUG() macros are enabled.=0D -=0D - This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit= of=0D - PcdDebugProperyMask is set. Otherwise, FALSE is returned.=0D -=0D - @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugP= roperyMask is set.=0D - @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugP= roperyMask is clear.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -DebugPrintEnabled (=0D - VOID=0D - );=0D -=0D -=0D -/**=0D - Returns TRUE if DEBUG_CODE() macros are enabled.=0D -=0D - This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit = of=0D - PcdDebugProperyMask is set. Otherwise, FALSE is returned.=0D -=0D - @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPr= operyMask is set.=0D - @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPr= operyMask is clear.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -DebugCodeEnabled (=0D - VOID=0D - );=0D -=0D -=0D -/**=0D - Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.=0D -=0D - This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bi= t of=0D - PcdDebugProperyMask is set. Otherwise, FALSE is returned.=0D -=0D - @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebug= ProperyMask is set.=0D - @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebug= ProperyMask is clear.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -DebugClearMemoryEnabled (=0D - VOID=0D - );=0D -=0D -/**=0D - Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixe= dDebugPrintErrorLevel.=0D -=0D - This function compares the bit mask of ErrorLevel and PcdFixedDebugPrint= ErrorLevel.=0D -=0D - @retval TRUE Current ErrorLevel is supported.=0D - @retval FALSE Current ErrorLevel is not supported.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -DebugPrintLevelEnabled (=0D - IN CONST UINTN ErrorLevel=0D - );=0D -=0D /**=0D Internal worker macro that calls DebugAssert().=0D =0D diff --git a/MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf b/Mde= Pkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf new file mode 100644 index 0000000000..4ceefc291b --- /dev/null +++ b/MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf @@ -0,0 +1,35 @@ +## @file=0D +# Instance of Debug Common Library interface.=0D +# It uses PcdLib to provide a common set of Debug Library interface.=0D +#=0D +# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
= =0D +# Copyright (c) 2020, Vitaly Cheptsov. All rights reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +#=0D +##=0D +=0D +[Defines]=0D + INF_VERSION =3D 0x00010005=0D + BASE_NAME =3D BaseDebugCommonLib=0D + MODULE_UNI_FILE =3D BaseDebugCommonLib.uni=0D + FILE_GUID =3D 7CD790D2-E13F-4446-AF4F-813F0B9DEFF8= =0D + MODULE_TYPE =3D BASE=0D + VERSION_STRING =3D 1.0=0D + LIBRARY_CLASS =3D DebugCommonLib=0D +=0D +[Sources]=0D + DebugCommonLib.c=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D +=0D +[LibraryClasses]=0D + PcdLib=0D +=0D +[Pcd]=0D + gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES= =0D + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES=0D + gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES=0D +=0D diff --git a/MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.uni b/Mde= Pkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.uni new file mode 100644 index 0000000000..a5ad34298b --- /dev/null +++ b/MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.uni @@ -0,0 +1,16 @@ +// /** @file=0D +// Instance of Debug Common Library interface.=0D +//=0D +// It uses PcdLib to provide a common set of Debug Library interface.=0D +//=0D +// Copyright (c) 2020, Vitaly Cheptsov. All rights reserved.
=0D +//=0D +// SPDX-License-Identifier: BSD-2-Clause-Patent=0D +//=0D +// **/=0D +=0D +=0D +#string STR_MODULE_ABSTRACT #language en-US "Instance of Debug= Common Library interface"=0D +=0D +#string STR_MODULE_DESCRIPTION #language en-US "It uses PcdLib to= provide a common set of Debug Library interface."=0D +=0D diff --git a/MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c b/MdePkg/Li= brary/BaseDebugCommonLib/DebugCommonLib.c new file mode 100644 index 0000000000..2291fb5382 --- /dev/null +++ b/MdePkg/Library/BaseDebugCommonLib/DebugCommonLib.c @@ -0,0 +1,113 @@ +/** @file=0D + Instance of Debug Common Library interface.=0D + It uses PcdLib to provide a common set of Debug Library interface.=0D +=0D + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2020, Vitaly Cheptsov. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include =0D +#include =0D +#include =0D +=0D +=0D +/**=0D + Returns TRUE if ASSERT() macros are enabled.=0D +=0D + This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bi= t of=0D + PcdDebugProperyMask is set. Otherwise FALSE is returned.=0D +=0D + @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebug= ProperyMask is set.=0D + @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebug= ProperyMask is clear.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +DebugAssertEnabled (=0D + VOID=0D + )=0D +{=0D + return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG= _ASSERT_ENABLED) !=3D 0);=0D +}=0D +=0D +=0D +/**=0D + Returns TRUE if DEBUG() macros are enabled.=0D +=0D + This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit= of=0D + PcdDebugProperyMask is set. Otherwise FALSE is returned.=0D +=0D + @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugP= roperyMask is set.=0D + @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugP= roperyMask is clear.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +DebugPrintEnabled (=0D + VOID=0D + )=0D +{=0D + return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG= _PRINT_ENABLED) !=3D 0);=0D +}=0D +=0D +=0D +/**=0D + Returns TRUE if DEBUG_CODE() macros are enabled.=0D +=0D + This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit = of=0D + PcdDebugProperyMask is set. Otherwise FALSE is returned.=0D +=0D + @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPr= operyMask is set.=0D + @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPr= operyMask is clear.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +DebugCodeEnabled (=0D + VOID=0D + )=0D +{=0D + return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG= _CODE_ENABLED) !=3D 0);=0D +}=0D +=0D +=0D +/**=0D + Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.=0D +=0D + This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bi= t of=0D + PcdDebugProperyMask is set. Otherwise FALSE is returned.=0D +=0D + @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebug= ProperyMask is set.=0D + @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebug= ProperyMask is clear.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +DebugClearMemoryEnabled (=0D + VOID=0D + )=0D +{=0D + return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR= _MEMORY_ENABLED) !=3D 0);=0D +}=0D +=0D +=0D +/**=0D + Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixe= dDebugPrintErrorLevel.=0D +=0D + This function compares the bit mask of ErrorLevel and PcdFixedDebugPrint= ErrorLevel.=0D +=0D + @retval TRUE Current ErrorLevel is supported.=0D + @retval FALSE Current ErrorLevel is not supported.=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +DebugPrintLevelEnabled (=0D + IN CONST UINTN ErrorLevel=0D + )=0D +{=0D + return (BOOLEAN) ((ErrorLevel & PcdGet32 (PcdFixedDebugPrintErrorLevel))= !=3D 0);=0D +}=0D +=0D diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 0b9c4bc40a..a121b9ecab 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -229,6 +229,9 @@ [LibraryClasses] # library class maps directly on top of the Timer class= .=0D S3StallLib|Include/Library/S3StallLib.h=0D =0D + ## @libraryclass Provides services to access common debugging features= .=0D + DebugCommonLib|Include/Library/DebugCommonLib.h=0D +=0D ## @libraryclass Defines library APIs used by modules to get/set print= error level.=0D DebugPrintErrorLevelLib|Include/Library/DebugPrintErrorLevelLib.h=0D =0D diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index 6cd38e7ec3..1072322450 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -36,6 +36,7 @@ [Components] MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf=0D MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf=0D MdePkg/Library/BaseCpuLib/BaseCpuLib.inf=0D + MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf=0D MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf=0D MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf=0D MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.i= nf=0D --=20 2.24.2 (Apple Git-127)