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.web12.10324.1589302963005830550 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 9F43DCD467; Tue, 12 May 2020 20:02:39 +0300 (MSK) From: "Vitaly Cheptsov" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu Subject: [PATCH V5 04/27] MdeModulePkg: Add support for DebugCommonLib Date: Tue, 12 May 2020 20:02:14 +0300 Message-Id: <20200512170237.19796-5-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 CC: Jian J Wang CC: Hao A Wu Signed-off-by: Vitaly Cheptsov --- MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c = | 100 -------------------- MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf = | 2 +- MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c = | 98 ------------------- MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportSt= atusCode.inf | 2 +- MdeModulePkg/MdeModulePkg.dsc = | 1 + 5 files changed, 3 insertions(+), 200 deletions(-) diff --git a/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c b/MdeModul= ePkg/Library/PeiDebugLibDebugPpi/DebugLib.c index 05a7dab99c..66748ee836 100644 --- a/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c +++ b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c @@ -352,103 +352,3 @@ DebugClearMemory ( =0D return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue));=0D }=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/MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.i= nf b/MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf index 4df479d742..ca1a3d16e4 100644 --- a/MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf +++ b/MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf @@ -41,6 +41,7 @@ [Packages] [LibraryClasses]=0D PcdLib=0D BaseMemoryLib=0D + DebugCommonLib=0D DebugPrintErrorLevelLib=0D PeiServicesLib=0D PeiServicesTablePointerLib=0D @@ -52,7 +53,6 @@ [Ppis] [Pcd]=0D gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_C= ONSUMES=0D gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES=0D - gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES=0D =0D [Depex]=0D gEdkiiDebugPpiGuid=0D diff --git a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c= b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c index fb47401466..ec90cb6e37 100644 --- a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c +++ b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c @@ -501,101 +501,3 @@ DebugClearMemory ( =0D return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue));=0D }=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 - 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 diff --git a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebu= gLibReportStatusCode.inf b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusC= ode/PeiDxeDebugLibReportStatusCode.inf index b52fc5686a..ca724326bd 100644 --- a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibRep= ortStatusCode.inf +++ b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibRep= ortStatusCode.inf @@ -37,12 +37,12 @@ [LibraryClasses] ReportStatusCodeLib=0D BaseMemoryLib=0D BaseLib=0D + DebugCommonLib=0D DebugPrintErrorLevelLib=0D =0D [Pcd]=0D gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES= =0D gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES=0D - gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES=0D =0D [Guids]=0D gEfiStatusCodeDataTypeDebugGuid ## SOMETIMES_CONSUMES ## GUID=0D diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 25aea3e2a4..72b6fa755b 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -74,6 +74,7 @@ [LibraryClasses] # Misc=0D #=0D DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf=0D + DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf= =0D DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseD= ebugPrintErrorLevelLib.inf=0D ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf=0D PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeC= offExtraActionLibNull.inf=0D --=20 2.24.2 (Apple Git-127)