Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MdeModulePkg: Add Trace Hub debug library
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4144 Part 2: Provide a debug library which consumed by Trace Hub to output debug message. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: VictorX Hsu <victorx.hsu@intel.com>
- Loading branch information
Showing
19 changed files
with
3,733 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
/** @file | ||
Copyright (c) 2022, 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/UefiBaseType.h> | ||
#include <Guid/StatusCodeDataTypeDebug.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 Statuscode to NPK with GUID information. | ||
This API would be enabled for Release BIOS Only | ||
@param[in] SeverityType Severity type of the written data buffer. | ||
@param[in] Id Catalog ID | ||
@param[in] Guid Driver Guid | ||
**/ | ||
VOID | ||
EFIAPI | ||
TraceHubWriteCataLog64StatusCode ( | ||
IN TRACE_HUB_SEVERITY_TYPE SeverityType, | ||
IN UINT64 Id, | ||
IN EFI_GUID *Guid | ||
); | ||
|
||
/** | ||
Write data from buffer and Severity to TraceHub. | ||
Writes NumberOfBytes data bytes from Buffer and Severity to TraceHub. | ||
If Buffer is NULL or NumberOfBytes is larger than zero, then ASSERT(). | ||
If NumberOfBytes is zero, no buffer is written. | ||
@param[in] SeverityType Severity type of the written data buffer. | ||
@param[in] Buffer Pointer to the data buffer to be written. | ||
@param[in] NumberOfBytes Number of bytes to written to TraceHub device. | ||
@retval EFI_SUCCESS The number of bytes written to TraceHub. | ||
@retval Other Fail to write the buffer to TraceHub. | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
TraceHubDebugWrite ( | ||
IN TRACE_HUB_SEVERITY_TYPE SeverityType, | ||
IN UINT8 *Buffer, | ||
IN UINTN NumberOfBytes | ||
); | ||
|
||
/** | ||
Write catalog64 message mipi_syst event with 0 parameters to TraceHub | ||
@param[in] SeverityType Severity type of the catid message event. | ||
@param[in] Id Catalog ID | ||
**/ | ||
VOID | ||
EFIAPI | ||
TraceHubWriteCataLog64_0 ( | ||
IN TRACE_HUB_SEVERITY_TYPE SeverityType, | ||
IN UINT64 Id | ||
); | ||
|
||
/** | ||
Write catalog64 message mipi_syst event with 1 parameters to TraceHub | ||
@param[in] SeverityType Severity type of the catid message event. | ||
@param[in] Id Catalog ID | ||
@param[in] Param1 Parameter 1 passed to catid message event. | ||
**/ | ||
VOID | ||
EFIAPI | ||
TraceHubWriteCataLog64_1 ( | ||
IN TRACE_HUB_SEVERITY_TYPE SeverityType, | ||
IN UINT64 Id, | ||
IN UINT32 Param1 | ||
); | ||
|
||
/** | ||
Write catalog64 message mipi_syst event with 2 parameters to TraceHub | ||
@param[in] SeverityType Severity type of the catid message event. | ||
@param[in] Id Catalog ID | ||
@param[in] Param1 Parameter 1 passed to catid message event. | ||
@param[in] Param2 Parameter 2 passed to catid message event. | ||
**/ | ||
VOID | ||
EFIAPI | ||
TraceHubWriteCataLog64_2 ( | ||
IN TRACE_HUB_SEVERITY_TYPE SeverityType, | ||
IN UINT64 Id, | ||
IN UINT32 Param1, | ||
IN UINT32 Param2 | ||
); | ||
|
||
/** | ||
Write catalog64 message mipi_syst event with 3 parameters to TraceHub | ||
@param[in] SeverityType Severity type of the catid message event. | ||
@param[in] Id Catalog ID | ||
@param[in] Param1 Parameter 1 passed to catid message event. | ||
@param[in] Param2 Parameter 2 passed to catid message event. | ||
@param[in] Param3 Parameter 3 passed to catid message event. | ||
**/ | ||
VOID | ||
EFIAPI | ||
TraceHubWriteCataLog64_3 ( | ||
IN TRACE_HUB_SEVERITY_TYPE SeverityType, | ||
IN UINT64 Id, | ||
IN UINT32 Param1, | ||
IN UINT32 Param2, | ||
IN UINT32 Param3 | ||
); | ||
|
||
/** | ||
Write catalog64 message mipi_syst event with 4 parameters to TraceHub | ||
@param[in] SeverityType Severity type of the catid message event. | ||
@param[in] Id Catalog ID | ||
@param[in] Param1 Parameter 1 passed to catid message event. | ||
@param[in] Param2 Parameter 2 passed to catid message event. | ||
@param[in] Param3 Parameter 3 passed to catid message event. | ||
@param[in] Param4 Parameter 4 passed to catid message event. | ||
**/ | ||
VOID | ||
EFIAPI | ||
TraceHubWriteCataLog64_4 ( | ||
IN TRACE_HUB_SEVERITY_TYPE SeverityType, | ||
IN UINT64 Id, | ||
IN UINT32 Param1, | ||
IN UINT32 Param2, | ||
IN UINT32 Param3, | ||
IN UINT32 Param4 | ||
); | ||
|
||
/** | ||
Write catalog64 message mipi_syst event with 5 parameters to TraceHub | ||
@param[in] SeverityType Severity type of the catid message event. | ||
@param[in] Id Catalog ID | ||
@param[in] Param1 Parameter 1 passed to catid message event. | ||
@param[in] Param2 Parameter 2 passed to catid message event. | ||
@param[in] Param3 Parameter 3 passed to catid message event. | ||
@param[in] Param4 Parameter 4 passed to catid message event. | ||
@param[in] Param5 Parameter 5 passed to catid message event. | ||
**/ | ||
VOID | ||
EFIAPI | ||
TraceHubWriteCataLog64_5 ( | ||
IN TRACE_HUB_SEVERITY_TYPE SeverityType, | ||
IN UINT64 Id, | ||
IN UINT32 Param1, | ||
IN UINT32 Param2, | ||
IN UINT32 Param3, | ||
IN UINT32 Param4, | ||
IN UINT32 Param5 | ||
); | ||
|
||
/** | ||
Write catalog64 message mipi_syst event with 6 parameters to TraceHub | ||
@param[in] SeverityType Severity type of the catid message event. | ||
@param[in] Id Catalog ID | ||
@param[in] Param1 Parameter 1 passed to catid message event. | ||
@param[in] Param2 Parameter 2 passed to catid message event. | ||
@param[in] Param3 Parameter 3 passed to catid message event. | ||
@param[in] Param4 Parameter 4 passed to catid message event. | ||
@param[in] Param5 Parameter 5 passed to catid message event. | ||
@param[in] Param6 Parameter 6 passed to catid message event. | ||
**/ | ||
VOID | ||
EFIAPI | ||
TraceHubWriteCataLog64_6 ( | ||
IN TRACE_HUB_SEVERITY_TYPE SeverityType, | ||
IN UINT64 Id, | ||
IN UINT32 Param1, | ||
IN UINT32 Param2, | ||
IN UINT32 Param3, | ||
IN UINT32 Param4, | ||
IN UINT32 Param5, | ||
IN UINT32 Param6 | ||
); | ||
|
||
#endif // TRACE_HUB_DEBUG_LIB_H_ |
Oops, something went wrong.