From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.3916.1675133388550261734 for ; Mon, 30 Jan 2023 18:49:48 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=C7r6HeHp; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: victorx.hsu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675133388; x=1706669388; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vHI+p6lzBQEwwJEdOocJB1D6Prr3IWNh14UziLOV9lI=; b=C7r6HeHpGG9WqQj/jG6dWG2FuS00QUc2Yuqewal8NKjY7DRo3UJyaoHf sdkTJ2qn7edQILyA/jnxyXs/8B17E7xjuWEfCELiy8YlP1hA1FJ85CESj nZO5qXFv4napg32+HKmndVrbtHA3C4IqUdgsZypq/pibGAiTsMLThDHAa D1yRrJUyKyLwRystm+foQrDrLfgN8xWyoPnkzM4WVJvyC4H9c0pr9xmGa 3Yr4cutI6trZ5sHp/JqZmUlYTkmPPUw882oWgCo30dikEA372YzwwZpbv NEuSaXnsfRBmlASKf27gCBTg8mjihJBTGtgI7nCwok7KhIqUQvF08L0jm A==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="329008487" X-IronPort-AV: E=Sophos;i="5.97,259,1669104000"; d="scan'208";a="329008487" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2023 18:49:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="753077520" X-IronPort-AV: E=Sophos;i="5.97,259,1669104000"; d="scan'208";a="753077520" Received: from hsuc1x-desk1.gar.corp.intel.com ([10.227.107.38]) by FMSMGA003.fm.intel.com with ESMTP; 30 Jan 2023 18:49:46 -0800 From: victorx.hsu@intel.com To: devel@edk2.groups.io Cc: VictorX Hsu , Michael D Kinney , Guo Gua , Chan Laura , Prakashan Krishnadas Veliyathuparambil , K N Karthik Subject: [PATCH 3/4] MdePkg: Add NULL library for TraceHubDebugLibSysT Date: Tue, 31 Jan 2023 10:49:01 +0800 Message-Id: X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <29c690501f493d9d003ee7089228a7273c3ff091.1675131785.git.victorx.hsu@intel.com> References: <29c690501f493d9d003ee7089228a7273c3ff091.1675131785.git.victorx.hsu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: VictorX Hsu REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4144 This Library is NULL library for TraceHubDebugLibSysT. Cc: Michael D Kinney Cc: Guo Gua Cc: Chan Laura Cc: Prakashan Krishnadas Veliyathuparambil Cc: K N Karthik Signed-off-by: VictorX Hsu --- MdePkg/Include/Library/TraceHubDebugLib.h | 82 +++++++++++++++++++ .../TraceHubDebugLibNull.c | 75 +++++++++++++++++ .../TraceHubDebugLibNull.inf | 29 +++++++ MdePkg/MdePkg.dec | 4 + MdePkg/MdePkg.dsc | 2 + 5 files changed, 192 insertions(+) create mode 100644 MdePkg/Include/Library/TraceHubDebugLib.h create mode 100644 MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNul= l.c create mode 100644 MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNul= l.inf diff --git a/MdePkg/Include/Library/TraceHubDebugLib.h b/MdePkg/Include/Lib= rary/TraceHubDebugLib.h new file mode 100644 index 0000000000..2e8d70ae97 --- /dev/null +++ b/MdePkg/Include/Library/TraceHubDebugLib.h @@ -0,0 +1,82 @@ +/** @file=0D +=0D +Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D +=0D +SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#ifndef TRACE_HUB_DEBUG_LIB_H_=0D +#define TRACE_HUB_DEBUG_LIB_H_=0D +=0D +#include =0D +=0D +typedef enum {=0D + SeverityNone =3D 0,=0D + SeverityFatal =3D 1,=0D + SeverityError =3D 2,=0D + SeverityWarning =3D 3,=0D + SeverityNormal =3D 4,=0D + SeverityUser1 =3D 5,=0D + SeverityUser2 =3D 6,=0D + SeverityUser3 =3D 7,=0D + SeverityMax=0D +} TRACE_HUB_SEVERITY_TYPE;=0D +=0D +/**=0D + Write debug string to specified Trace Hub MMIO address.=0D +=0D + @param[in] SeverityType An error level to decide whether to enable = Trace Hub data.=0D + @param[in] Buffer A pointer to the data buffer.=0D + @param[in] NumberOfBytes Number of bytes to be written.=0D +=0D + @retval EFI_SUCCESS Data was written to Trace Hub.=0D + @retval Other Failed to output Trace Hub message.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +TraceHubDebugWrite (=0D + IN TRACE_HUB_SEVERITY_TYPE SeverityType,=0D + IN UINT8 *Buffer,=0D + IN UINTN NumberOfBytes=0D + );=0D +=0D +/**=0D + Write catalog status code message to specified Trace Hub MMIO address.=0D +=0D + @param[in] SeverityType An error level to decide whether to enable = Trace Hub data.=0D + @param[in] Id Catalog ID.=0D + @param[in] Guid Driver Guid.=0D +=0D + @retval EFI_SUCCESS Data was written to Trace Hub.=0D + @retval Other Failed to output Trace Hub message.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +TraceHubWriteCataLog64StatusCode (=0D + IN TRACE_HUB_SEVERITY_TYPE SeverityType,=0D + IN UINT64 Id,=0D + IN EFI_GUID *Guid=0D + );=0D +=0D +/**=0D + Write catalog message to specified Trace Hub MMIO address.=0D +=0D + @param[in] SeverityType An error level to decide whether to enable Tr= ace Hub data.=0D + @param[in] Id Catalog ID.=0D + @param[in] NumberOfParams Number of parameters in argument list.=0D + @param[in] ... Argument list that pass to Trace Hub.=0D +=0D + @retval EFI_SUCCESS Data was written to Trace Hub.=0D + @retval Other Failed to output Trace Hub message.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +TraceHubWriteCataLog64 (=0D + IN TRACE_HUB_SEVERITY_TYPE SeverityType,=0D + IN UINT64 Id,=0D + IN UINTN NumberOfParams,=0D + ...=0D + );=0D +=0D +#endif // TRACE_HUB_DEBUG_LIB_H_=0D diff --git a/MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.c b/M= dePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.c new file mode 100644 index 0000000000..8d8f3f69e8 --- /dev/null +++ b/MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.c @@ -0,0 +1,75 @@ +/** @file=0D +=0D +Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D +=0D +SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#include =0D +#include =0D +=0D +/**=0D + Write debug string to specified Trace Hub MMIO address.=0D +=0D + @param[in] SeverityType An error level to decide whether to enable = Trace Hub data.=0D + @param[in] Buffer A pointer to the data buffer.=0D + @param[in] NumberOfBytes Number of bytes to be written.=0D +=0D + @retval EFI_SUCCESS Data was written to Trace Hub.=0D + @retval Other Failed to output Trace Hub message.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +TraceHubDebugWrite (=0D + IN TRACE_HUB_SEVERITY_TYPE SeverityType,=0D + IN UINT8 *Buffer,=0D + IN UINTN NumberOfBytes=0D + )=0D +{=0D + return EFI_UNSUPPORTED;=0D +}=0D +=0D +/**=0D + Write catalog status code message to specified Trace Hub MMIO address.=0D +=0D + @param[in] SeverityType An error level to decide whether to enable = Trace Hub data.=0D + @param[in] Id Catalog ID.=0D + @param[in] Guid Driver Guid.=0D +=0D + @retval EFI_SUCCESS Data was written to Trace Hub.=0D + @retval Other Failed to output Trace Hub message.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +TraceHubWriteCataLog64StatusCode (=0D + IN TRACE_HUB_SEVERITY_TYPE SeverityType,=0D + IN UINT64 Id,=0D + IN EFI_GUID *Guid=0D + )=0D +{=0D + return EFI_UNSUPPORTED;=0D +}=0D +=0D +/**=0D + Write catalog message to specified Trace Hub MMIO address.=0D +=0D + @param[in] SeverityType An error level to decide whether to enable Tr= ace Hub data.=0D + @param[in] Id Catalog ID.=0D + @param[in] NumberOfParams Number of parameters in argument list.=0D + @param[in] ... Argument list that pass to Trace Hub.=0D +=0D + @retval EFI_SUCCESS Data was written to Trace Hub.=0D + @retval Other Failed to output Trace Hub message.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +TraceHubWriteCataLog64 (=0D + IN TRACE_HUB_SEVERITY_TYPE SeverityType,=0D + IN UINT64 Id,=0D + IN UINTN NumberOfParams,=0D + ...=0D + )=0D +{=0D + return EFI_UNSUPPORTED;=0D +}=0D diff --git a/MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.inf b= /MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.inf new file mode 100644 index 0000000000..0629365b6e --- /dev/null +++ b/MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.inf @@ -0,0 +1,29 @@ +## @file=0D +# Null library of TraceHubDebugLib.=0D +#=0D +# Copyright (c) 2023, Intel Corporation. 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 TraceHubDebugLibNull=0D + FILE_GUID =3D 16196A4E-4196-4AF4-9A6B-F4D2ACC430A8= =0D + MODULE_TYPE =3D BASE=0D + VERSION_STRING =3D 1.0=0D + LIBRARY_CLASS =3D TraceHubDebugLib=0D +=0D +#=0D +# The following information is for reference only and not required by the = build tools.=0D +#=0D +# VALID_ARCHITECTURES =3D IA32 X64=0D +#=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D +=0D +[Sources]=0D + TraceHubDebugLibNull.c=0D diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index bee7ac538a..1ea6a0aae6 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -289,6 +289,10 @@ #=0D MipiSysTLib|Include/Library/MipiSysTLib.h=0D =0D + ## @libraryclass Provides API to output Trace Hub debug message.=0D + #=0D + TraceHubDebugLib|Include/Library/TraceHubDebugLib.h=0D +=0D [LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64]=0D ## @libraryclass Provides services to generate random number.=0D #=0D diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index cbcf4a6047..a2b4164d84 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -35,6 +35,7 @@ [LibraryClasses]=0D SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf=0D MipiSysTLib|MdePkg/Library/MipiSysTLib/MipiSysTLib.inf=0D + TraceHubDebugLib|MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNul= l.inf=0D =0D [Components]=0D MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf=0D @@ -137,6 +138,7 @@ MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf=0D MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf=0D MdePkg/Library/MipiSysTLib/MipiSysTLib.inf=0D + MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.inf=0D =0D [Components.IA32, Components.X64, Components.ARM, Components.AARCH64]=0D #=0D --=20 2.28.0.windows.1