1 | /** @file
|
---|
2 | This header file declares functions and type for common use.
|
---|
3 |
|
---|
4 | Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
|
---|
5 |
|
---|
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
7 |
|
---|
8 | **/
|
---|
9 |
|
---|
10 | #ifndef INTERNAL_TRACE_HUB_API_COMMON_H_
|
---|
11 | #define INTERNAL_TRACE_HUB_API_COMMON_H_
|
---|
12 |
|
---|
13 | typedef enum {
|
---|
14 | TraceHubDebugType = 0,
|
---|
15 | TraceHubCatalogType
|
---|
16 | } TRACEHUB_PRINTTYPE;
|
---|
17 |
|
---|
18 | typedef enum {
|
---|
19 | TraceHubRoutingDisable = 0,
|
---|
20 | TraceHubRoutingEnable,
|
---|
21 | TraceHubRoutingMax
|
---|
22 | } TRACE_HUB_ROUTING;
|
---|
23 |
|
---|
24 | typedef enum {
|
---|
25 | TraceHubDebugLevelError = 0,
|
---|
26 | TraceHubDebugLevelErrorWarning,
|
---|
27 | TraceHubDebugLevelErrorWarningInfo,
|
---|
28 | TraceHubDebugLevelErrorWarningInfoVerbose,
|
---|
29 | TraceHubDebugLevelMax
|
---|
30 | } TRACE_HUB_DEBUG_LEVEL;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | Conditionally determine whether to enable Trace Hub message.
|
---|
34 |
|
---|
35 | @param[in] Flag Flag to enable or disable Trace Hub message.
|
---|
36 | @param[in] DbgLevel Debug Level of Trace Hub.
|
---|
37 | @param[in] SeverityType Severity type of input message.
|
---|
38 |
|
---|
39 | @retval TRUE Enable trace hub message.
|
---|
40 | @retval FALSE Disable trace hub message.
|
---|
41 | **/
|
---|
42 | BOOLEAN
|
---|
43 | EFIAPI
|
---|
44 | TraceHubDataEnabled (
|
---|
45 | IN BOOLEAN Flag,
|
---|
46 | IN UINT8 DbgLevel,
|
---|
47 | IN TRACE_HUB_SEVERITY_TYPE SeverityType
|
---|
48 | );
|
---|
49 |
|
---|
50 | /**
|
---|
51 | Convert GUID from LE to BE or BE to LE.
|
---|
52 |
|
---|
53 | @param[in] Guid GUID that need to be converted.
|
---|
54 | @param[out] ConvertedGuid GUID that is converted.
|
---|
55 | **/
|
---|
56 | VOID
|
---|
57 | EFIAPI
|
---|
58 | SwapBytesGuid (
|
---|
59 | IN GUID *Guid,
|
---|
60 | OUT GUID *ConvertedGuid
|
---|
61 | );
|
---|
62 |
|
---|
63 | /**
|
---|
64 | Check whether to output Trace Hub message according to some conditions.
|
---|
65 | Trace Hub message will be disabled if TraceHubDataEnabled() return FALSE
|
---|
66 | or Trace Hub MMIO address is 0.
|
---|
67 |
|
---|
68 | @param[in, out] MipiSystHandle A pointer to MIPI_SYST_HANDLE structure.
|
---|
69 | @param[in] DbgContext A pointer to Trace Hub debug instance.
|
---|
70 | @param[in] SeverityType Severity type of input message.
|
---|
71 | @param[in] PrintType Either catalog print or debug print.
|
---|
72 |
|
---|
73 | @retval RETURN_SUCCESS Current Trace Hub message need to be output.
|
---|
74 | @retval Other Current Trace Hub message will be disabled.
|
---|
75 | **/
|
---|
76 | RETURN_STATUS
|
---|
77 | EFIAPI
|
---|
78 | CheckWhetherToOutputMsg (
|
---|
79 | IN OUT MIPI_SYST_HANDLE *MipiSystHandle,
|
---|
80 | IN UINT8 *DbgContext,
|
---|
81 | IN TRACE_HUB_SEVERITY_TYPE SeverityType,
|
---|
82 | IN TRACEHUB_PRINTTYPE PrintType
|
---|
83 | );
|
---|
84 |
|
---|
85 | /**
|
---|
86 | Get Trace Hub MMIO Address.
|
---|
87 |
|
---|
88 | @param[in] DbgContext A pointer to Trace Hub debug instance.
|
---|
89 | @param[in, out] TraceAddress Trace Hub MMIO Address.
|
---|
90 |
|
---|
91 | @retval RETURN_SUCCESS Operation is successfully.
|
---|
92 | @retval Other Operation is failed.
|
---|
93 | **/
|
---|
94 | RETURN_STATUS
|
---|
95 | EFIAPI
|
---|
96 | GetTraceHubMmioAddress (
|
---|
97 | IN UINT8 *DbgContext,
|
---|
98 | IN OUT UINT64 *TraceAddress
|
---|
99 | );
|
---|
100 |
|
---|
101 | /**
|
---|
102 | Get visibility of Trace Hub Msg.
|
---|
103 |
|
---|
104 | @param[in] DbgContext A pointer to Trace Hub debug instance.
|
---|
105 | @param[in, out] Flag Flag to enable or disable Trace Hub message.
|
---|
106 | @param[in, out] DbgLevel Debug Level of Trace Hub.
|
---|
107 |
|
---|
108 | @retval RETURN_SUCCESS Operation is successfully.
|
---|
109 | @retval Other Operation is failed.
|
---|
110 | **/
|
---|
111 | RETURN_STATUS
|
---|
112 | EFIAPI
|
---|
113 | GetTraceHubMsgVisibility (
|
---|
114 | IN UINT8 *DbgContext,
|
---|
115 | IN OUT BOOLEAN *Flag,
|
---|
116 | IN OUT UINT8 *DbgLevel
|
---|
117 | );
|
---|
118 |
|
---|
119 | #endif // INTERNAL_TRACE_HUB_API_COMMON_H_
|
---|