TianoCore EDK2 master
Loading...
Searching...
No Matches
InternalTraceHubApiCommon.c File Reference
#include <Base.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/TraceHubDebugSysTLib.h>
#include <Library/MipiSysTLib/mipi_syst.h>
#include <Guid/TraceHubDebugInfoHob.h>
#include "InternalTraceHubApiCommon.h"
#include "InternalTraceHubApi.h"

Go to the source code of this file.

Functions

BOOLEAN EFIAPI TraceHubDataEnabled (IN BOOLEAN Flag, IN UINT8 DbgLevel, IN TRACE_HUB_SEVERITY_TYPE SeverityType)
 
VOID EFIAPI SwapBytesGuid (IN GUID *Guid, OUT GUID *ConvertedGuid)
 
RETURN_STATUS EFIAPI CheckWhetherToOutputMsg (IN OUT MIPI_SYST_HANDLE *MipiSystHandle, IN UINT8 *DbgContext, IN TRACE_HUB_SEVERITY_TYPE SeverityType, IN TRACEHUB_PRINTTYPE PrintType)
 
RETURN_STATUS EFIAPI GetTraceHubMmioAddress (IN UINT8 *DbgContext, IN OUT UINT64 *TraceAddress)
 
RETURN_STATUS EFIAPI GetTraceHubMsgVisibility (IN UINT8 *DbgContext, IN OUT BOOLEAN *Flag, IN OUT UINT8 *DbgLevel)
 

Detailed Description

Functions implementation defined in this file are common for all type of TraceHubDebugSysTLib

Copyright (c) 2023, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file InternalTraceHubApiCommon.c.

Function Documentation

◆ CheckWhetherToOutputMsg()

RETURN_STATUS EFIAPI CheckWhetherToOutputMsg ( IN OUT MIPI_SYST_HANDLE MipiSystHandle,
IN UINT8 *  DbgContext,
IN TRACE_HUB_SEVERITY_TYPE  SeverityType,
IN TRACEHUB_PRINTTYPE  PrintType 
)

Check whether to output Trace Hub message according to some conditions. Trace Hub message will be disabled if TraceHubDataEnabled() return FALSE or Trace Hub MMIO address is 0.

Parameters
[in,out]MipiSystHandleA pointer to MIPI_SYST_HANDLE structure.
[in]DbgContextA pointer to Trace Hub debug instance.
[in]SeverityTypeSeverity type of input message.
[in]PrintTypeEither catalog print or debug print.
Return values
RETURN_SUCCESSCurrent Trace Hub message need to be output.
OtherCurrent Trace Hub message will be disabled.

Definition at line 94 of file InternalTraceHubApiCommon.c.

◆ GetTraceHubMmioAddress()

RETURN_STATUS EFIAPI GetTraceHubMmioAddress ( IN UINT8 *  DbgContext,
IN OUT UINT64 *  TraceAddress 
)

Get Trace Hub MMIO Address.

Parameters
[in]DbgContextA pointer to Trace Hub debug instance.
[in,out]TraceAddressTrace Hub MMIO Address.
Return values
RETURN_SUCCESSOperation is successfully.
OtherOperation is failed.

Definition at line 145 of file InternalTraceHubApiCommon.c.

◆ GetTraceHubMsgVisibility()

RETURN_STATUS EFIAPI GetTraceHubMsgVisibility ( IN UINT8 *  DbgContext,
IN OUT BOOLEAN *  Flag,
IN OUT UINT8 *  DbgLevel 
)

Get visibility of Trace Hub Msg.

Parameters
[in]DbgContextA pointer to Trace Hub debug instance.
[in,out]FlagFlag to enable or disable Trace Hub message.
[in,out]DbgLevelDebug Level of Trace Hub.
Return values
RETURN_SUCCESSOperation is successfully.
OtherOperation is failed.

Definition at line 178 of file InternalTraceHubApiCommon.c.

◆ SwapBytesGuid()

VOID EFIAPI SwapBytesGuid ( IN GUID Guid,
OUT GUID ConvertedGuid 
)

Convert GUID from LE to BE or BE to LE.

Parameters
[in]GuidGUID that need to be converted.
[out]ConvertedGuidGUID that is converted.

Definition at line 68 of file InternalTraceHubApiCommon.c.

◆ TraceHubDataEnabled()

BOOLEAN EFIAPI TraceHubDataEnabled ( IN BOOLEAN  Flag,
IN UINT8  DbgLevel,
IN TRACE_HUB_SEVERITY_TYPE  SeverityType 
)

Conditionally determine whether to enable Trace Hub message.

Parameters
[in]FlagFlag to enable or disable Trace Hub message.
[in]DbgLevelDebug Level of Trace Hub.
[in]SeverityTypeSeverity type of input message.
Return values
TRUEEnable trace hub message.
FALSEDisable trace hub message.

Definition at line 31 of file InternalTraceHubApiCommon.c.