public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: victorx.hsu@intel.com
To: devel@edk2.groups.io
Cc: VictorX Hsu <victorx.hsu@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Guo Gua <gua.guo@intel.com>, Chan Laura <laura.chan@intel.com>,
	Prakashan Krishnadas Veliyathuparambil
	<krishnadas.veliyathuparambil.prakashan@intel.com>,
	K N Karthik <karthik.k.n@intel.com>
Subject: [PATCH 3/4] MdePkg: Add NULL library for TraceHubDebugLibSysT
Date: Tue, 31 Jan 2023 10:49:01 +0800	[thread overview]
Message-ID: <fb2b3da8a44c40f34af817721bb0577be004f559.1675131785.git.victorx.hsu@intel.com> (raw)
In-Reply-To: <29c690501f493d9d003ee7089228a7273c3ff091.1675131785.git.victorx.hsu@intel.com>

From: VictorX Hsu <victorx.hsu@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4144

This Library is NULL library for TraceHubDebugLibSysT.

Cc: Michael D Kinney <michael.d.kinney@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: VictorX Hsu <victorx.hsu@intel.com>
---
 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/TraceHubDebugLibNull.c
 create mode 100644 MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.inf

diff --git a/MdePkg/Include/Library/TraceHubDebugLib.h b/MdePkg/Include/Library/TraceHubDebugLib.h
new file mode 100644
index 0000000000..2e8d70ae97
--- /dev/null
+++ b/MdePkg/Include/Library/TraceHubDebugLib.h
@@ -0,0 +1,82 @@
+/** @file
+
+Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef TRACE_HUB_DEBUG_LIB_H_
+#define TRACE_HUB_DEBUG_LIB_H_
+
+#include <Uefi.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     An error level to decide whether to enable Trace Hub data.
+  @param[in]  Buffer           A pointer to the data buffer.
+  @param[in]  NumberOfBytes    Number of bytes to be written.
+
+  @retval EFI_SUCCESS      Data was written to Trace Hub.
+  @retval Other            Failed to output Trace Hub message.
+**/
+EFI_STATUS
+EFIAPI
+TraceHubDebugWrite (
+  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     An error level to decide whether to enable Trace Hub data.
+  @param[in]  Id               Catalog ID.
+  @param[in]  Guid             Driver Guid.
+
+  @retval EFI_SUCCESS      Data was written to Trace Hub.
+  @retval Other            Failed to output Trace Hub message.
+**/
+EFI_STATUS
+EFIAPI
+TraceHubWriteCataLog64StatusCode (
+  IN TRACE_HUB_SEVERITY_TYPE  SeverityType,
+  IN UINT64                   Id,
+  IN EFI_GUID                 *Guid
+  );
+
+/**
+  Write catalog message to specified Trace Hub MMIO address.
+
+  @param[in]  SeverityType   An error level to decide whether to enable Trace Hub data.
+  @param[in]  Id             Catalog ID.
+  @param[in]  NumberOfParams Number of parameters in argument list.
+  @param[in]  ...            Argument list that pass to Trace Hub.
+
+  @retval EFI_SUCCESS      Data was written to Trace Hub.
+  @retval Other            Failed to output Trace Hub message.
+**/
+EFI_STATUS
+EFIAPI
+TraceHubWriteCataLog64 (
+  IN TRACE_HUB_SEVERITY_TYPE  SeverityType,
+  IN UINT64                   Id,
+  IN UINTN                    NumberOfParams,
+  ...
+  );
+
+#endif // TRACE_HUB_DEBUG_LIB_H_
diff --git a/MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.c b/MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.c
new file mode 100644
index 0000000000..8d8f3f69e8
--- /dev/null
+++ b/MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.c
@@ -0,0 +1,75 @@
+/** @file
+
+Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Uefi.h>
+#include <Library/TraceHubDebugLib.h>
+
+/**
+  Write debug string to specified Trace Hub MMIO address.
+
+  @param[in]  SeverityType     An error level to decide whether to enable Trace Hub data.
+  @param[in]  Buffer           A pointer to the data buffer.
+  @param[in]  NumberOfBytes    Number of bytes to be written.
+
+  @retval EFI_SUCCESS      Data was written to Trace Hub.
+  @retval Other            Failed to output Trace Hub message.
+**/
+EFI_STATUS
+EFIAPI
+TraceHubDebugWrite (
+  IN TRACE_HUB_SEVERITY_TYPE  SeverityType,
+  IN UINT8                    *Buffer,
+  IN UINTN                    NumberOfBytes
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  Write catalog status code message to specified Trace Hub MMIO address.
+
+  @param[in]  SeverityType     An error level to decide whether to enable Trace Hub data.
+  @param[in]  Id               Catalog ID.
+  @param[in]  Guid             Driver Guid.
+
+  @retval EFI_SUCCESS      Data was written to Trace Hub.
+  @retval Other            Failed to output Trace Hub message.
+**/
+EFI_STATUS
+EFIAPI
+TraceHubWriteCataLog64StatusCode (
+  IN TRACE_HUB_SEVERITY_TYPE  SeverityType,
+  IN UINT64                   Id,
+  IN EFI_GUID                 *Guid
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  Write catalog message to specified Trace Hub MMIO address.
+
+  @param[in]  SeverityType   An error level to decide whether to enable Trace Hub data.
+  @param[in]  Id             Catalog ID.
+  @param[in]  NumberOfParams Number of parameters in argument list.
+  @param[in]  ...            Argument list that pass to Trace Hub.
+
+  @retval EFI_SUCCESS      Data was written to Trace Hub.
+  @retval Other            Failed to output Trace Hub message.
+**/
+EFI_STATUS
+EFIAPI
+TraceHubWriteCataLog64 (
+  IN TRACE_HUB_SEVERITY_TYPE  SeverityType,
+  IN UINT64                   Id,
+  IN UINTN                    NumberOfParams,
+  ...
+  )
+{
+  return EFI_UNSUPPORTED;
+}
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
+#  Null library of TraceHubDebugLib.
+#
+#  Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = TraceHubDebugLibNull
+  FILE_GUID                      = 16196A4E-4196-4AF4-9A6B-F4D2ACC430A8
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = TraceHubDebugLib
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64
+#
+
+[Packages]
+  MdePkg/MdePkg.dec
+
+[Sources]
+  TraceHubDebugLibNull.c
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 @@
   #
   MipiSysTLib|Include/Library/MipiSysTLib.h
 
+  ##  @libraryclass  Provides API to output Trace Hub debug message.
+  #
+  TraceHubDebugLib|Include/Library/TraceHubDebugLib.h
+
 [LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64]
   ##  @libraryclass  Provides services to generate random number.
   #
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]
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
   MipiSysTLib|MdePkg/Library/MipiSysTLib/MipiSysTLib.inf
+  TraceHubDebugLib|MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.inf
 
 [Components]
   MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
@@ -137,6 +138,7 @@
   MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf
   MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf
   MdePkg/Library/MipiSysTLib/MipiSysTLib.inf
+  MdePkg/Library/TraceHubDebugLibNull/TraceHubDebugLibNull.inf
 
 [Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
   #
-- 
2.28.0.windows.1


  parent reply	other threads:[~2023-01-31  2:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31  2:48 [PATCH 1/4] MdePkg: Add MipiSysTLib library victorx.hsu
2023-01-31  2:49 ` [PATCH 2/4] MdeModulePkg: Add TraceHubDebugLibSysT library victorx.hsu
2023-01-31  3:17   ` Guo, Gua
2023-01-31  2:49 ` victorx.hsu [this message]
2023-01-31  3:17   ` [PATCH 3/4] MdePkg: Add NULL library for TraceHubDebugLibSysT Guo, Gua
2023-01-31  2:49 ` [PATCH 4/4] Maintainers.txt: Update reviewers for Trace Hub library victorx.hsu
2023-01-31  3:16   ` Guo, Gua
2023-01-31  3:17 ` [PATCH 1/4] MdePkg: Add MipiSysTLib library Guo, Gua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb2b3da8a44c40f34af817721bb0577be004f559.1675131785.git.victorx.hsu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox