summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGua Guo <gua.guo@intel.com>2023-05-10 10:12:18 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-05-11 07:26:38 +0000
commit3d50fdc5c6878b865a4b244430c3f26b77943996 (patch)
treec2fb944f82cbac97252f64c759483dcfe51645f9
parentc6bb7d54beb05ac85a29b38fc0e5d63bf6001840 (diff)
downloadedk2-3d50fdc5c6878b865a4b244430c3f26b77943996.tar.gz
edk2-3d50fdc5c6878b865a4b244430c3f26b77943996.tar.bz2
edk2-3d50fdc5c6878b865a4b244430c3f26b77943996.zip
MdePkg: Add NULL library of TraceHubDebugSysTLib
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4144 This Library is NULL library of TraceHubDebugSysTLib. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Guo Gua <gua.guo@intel.com> Cc: Chan Laura <laura.chan@intel.com> Cc: Prakashan Krishnadas Veliyathuparambil <krishnadas.veliyathuparambil.prakashan@intel.com> Cc: K N Karthik <karthik.k.n@intel.com> Signed-off-by: Guo Gua <gua.guo@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: K N Karthik <karthik.k.n@intel.com> Reviewed-by: Chan Laura <laura.chan@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
-rw-r--r--MdePkg/Include/Library/TraceHubDebugSysTLib.h81
-rw-r--r--MdePkg/Library/TraceHubDebugSysTLibNull/TraceHubDebugSysTLibNull.c76
-rw-r--r--MdePkg/Library/TraceHubDebugSysTLibNull/TraceHubDebugSysTLibNull.inf29
-rw-r--r--MdePkg/MdePkg.dsc1
4 files changed, 187 insertions, 0 deletions
diff --git a/MdePkg/Include/Library/TraceHubDebugSysTLib.h b/MdePkg/Include/Library/TraceHubDebugSysTLib.h
new file mode 100644
index 0000000000..7df20e67d6
--- /dev/null
+++ b/MdePkg/Include/Library/TraceHubDebugSysTLib.h
@@ -0,0 +1,81 @@
+/** @file
+This header file declares Trace Hub related top level APIs.
+
+Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef TRACE_HUB_DEBUG_SYST_LIB_H_
+#define TRACE_HUB_DEBUG_SYST_LIB_H_
+
+typedef enum {
+ SeverityNone = 0,
+ SeverityFatal = 1,
+ SeverityError = 2,
+ SeverityWarning = 3,
+ SeverityNormal = 4,
+ SeverityUser1 = 5,
+ SeverityUser2 = 6,
+ SeverityUser3 = 7,
+ SeverityMax
+} TRACE_HUB_SEVERITY_TYPE;
+
+/**
+ Write debug string to specified Trace Hub MMIO address.
+
+ @param[in] SeverityType Severity type of input message.
+ @param[in] Buffer A pointer to the data buffer.
+ @param[in] NumberOfBytes The size of data buffer.
+
+ @retval RETURN_SUCCESS Data was written to Trace Hub.
+ @retval Other Failed to output Trace Hub message.
+**/
+RETURN_STATUS
+EFIAPI
+TraceHubSysTDebugWrite (
+ IN TRACE_HUB_SEVERITY_TYPE SeverityType,
+ IN UINT8 *Buffer,
+ IN UINTN NumberOfBytes
+ );
+
+/**
+ Write catalog status code message to specified Trace Hub MMIO address.
+
+ @param[in] SeverityType Severity type of input message.
+ @param[in] Id Catalog ID.
+ @param[in] Guid Driver Guid.
+
+ @retval RETURN_SUCCESS Data was written to Trace Hub.
+ @retval Other Failed to output Trace Hub message.
+**/
+RETURN_STATUS
+EFIAPI
+TraceHubSysTWriteCataLog64StatusCode (
+ IN TRACE_HUB_SEVERITY_TYPE SeverityType,
+ IN UINT64 Id,
+ IN GUID *Guid
+ );
+
+/**
+ Write catalog message to specified Trace Hub MMIO address.
+
+ @param[in] SeverityType Severity type of input message.
+ @param[in] Id Catalog ID.
+ @param[in] NumberOfParams Number of entries in argument list.
+ @param[in] ... Catalog message parameters.
+
+ @retval RETURN_SUCCESS Data was written to Trace Hub.
+ @retval Other Failed to output Trace Hub message.
+**/
+RETURN_STATUS
+EFIAPI
+TraceHubSysTWriteCataLog64 (
+ IN TRACE_HUB_SEVERITY_TYPE SeverityType,
+ IN UINT64 Id,
+ IN UINTN NumberOfParams,
+ ...
+ );
+
+#endif // TRACE_HUB_DEBUG_SYST_LIB_H_
diff --git a/MdePkg/Library/TraceHubDebugSysTLibNull/TraceHubDebugSysTLibNull.c b/MdePkg/Library/TraceHubDebugSysTLibNull/TraceHubDebugSysTLibNull.c
new file mode 100644
index 0000000000..0bd14d4e24
--- /dev/null
+++ b/MdePkg/Library/TraceHubDebugSysTLibNull/TraceHubDebugSysTLibNull.c
@@ -0,0 +1,76 @@
+/** @file
+Null library of TraceHubDebugSysTLib.
+
+Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Base.h>
+#include <Library/TraceHubDebugSysTLib.h>
+
+/**
+ Write debug string to specified Trace Hub MMIO address.
+
+ @param[in] SeverityType Severity type of input message.
+ @param[in] Buffer A pointer to the data buffer.
+ @param[in] NumberOfBytes The size of data buffer.
+
+ @retval RETURN_SUCCESS Data was written to Trace Hub.
+ @retval Other Failed to output Trace Hub message.
+**/
+RETURN_STATUS
+EFIAPI
+TraceHubSysTDebugWrite (
+ IN TRACE_HUB_SEVERITY_TYPE SeverityType,
+ IN UINT8 *Buffer,
+ IN UINTN NumberOfBytes
+ )
+{
+ return RETURN_UNSUPPORTED;
+}
+
+/**
+ Write catalog status code message to specified Trace Hub MMIO address.
+
+ @param[in] SeverityType Severity type of input message.
+ @param[in] Id Catalog ID.
+ @param[in] Guid Driver Guid.
+
+ @retval RETURN_SUCCESS Data was written to Trace Hub.
+ @retval Other Failed to output Trace Hub message.
+**/
+RETURN_STATUS
+EFIAPI
+TraceHubSysTWriteCataLog64StatusCode (
+ IN TRACE_HUB_SEVERITY_TYPE SeverityType,
+ IN UINT64 Id,
+ IN GUID *Guid
+ )
+{
+ return RETURN_UNSUPPORTED;
+}
+
+/**
+ Write catalog message to specified Trace Hub MMIO address.
+
+ @param[in] SeverityType Severity type of input message.
+ @param[in] Id Catalog ID.
+ @param[in] NumberOfParams Number of entries in argument list.
+ @param[in] ... Catalog message parameters.
+
+ @retval RETURN_SUCCESS Data was written to Trace Hub.
+ @retval Other Failed to output Trace Hub message.
+**/
+RETURN_STATUS
+EFIAPI
+TraceHubSysTWriteCataLog64 (
+ IN TRACE_HUB_SEVERITY_TYPE SeverityType,
+ IN UINT64 Id,
+ IN UINTN NumberOfParams,
+ ...
+ )
+{
+ return RETURN_UNSUPPORTED;
+}
diff --git a/MdePkg/Library/TraceHubDebugSysTLibNull/TraceHubDebugSysTLibNull.inf b/MdePkg/Library/TraceHubDebugSysTLibNull/TraceHubDebugSysTLibNull.inf
new file mode 100644
index 0000000000..ba894fc250
--- /dev/null
+++ b/MdePkg/Library/TraceHubDebugSysTLibNull/TraceHubDebugSysTLibNull.inf
@@ -0,0 +1,29 @@
+## @file
+# Null library of TraceHubDebugSysTLib.
+#
+# Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = TraceHubDebugSysTLibNull
+ FILE_GUID = 16196A4E-4196-4AF4-9A6B-F4D2ACC430A8
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = TraceHubDebugSysTLib
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64
+#
+
+[Packages]
+ MdePkg/MdePkg.dec
+
+[Sources]
+ TraceHubDebugSysTLibNull.c
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index 902a39cffc..c850970b23 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -185,6 +185,7 @@
MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
MdePkg/Library/TdxLib/TdxLib.inf
MdePkg/Library/MipiSysTLib/MipiSysTLib.inf
+ MdePkg/Library/TraceHubDebugSysTLibNull/TraceHubDebugSysTLibNull.inf
[Components.EBC]
MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf