]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h
MdeModulePkg/S3SmmInitDone.h: Fix copyright coding style error.
[mirror_edk2.git] / MdeModulePkg / Include / Guid / ExtendedFirmwarePerformance.h
1 /** @file
2 This file defines edk2 extended firmware performance records.
3 These records will be added into ACPI FPDT Firmware Basic Boot Performance Table.
4
5 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __EXTENDED_FIRMWARE_PERFORMANCE_H__
17 #define __EXTENDED_FIRMWARE_PERFORMANCE_H__
18
19 #include <IndustryStandard/Acpi.h>
20
21 //
22 // Known performance tokens
23 //
24 #define SEC_TOK "SEC" ///< SEC Phase
25 #define DXE_TOK "DXE" ///< DXE Phase
26 #define PEI_TOK "PEI" ///< PEI Phase
27 #define BDS_TOK "BDS" ///< BDS Phase
28 #define DRIVERBINDING_START_TOK "DB:Start:" ///< Driver Binding Start() function call
29 #define DRIVERBINDING_SUPPORT_TOK "DB:Support:" ///< Driver Binding Support() function call
30 #define DRIVERBINDING_STOP_TOK "DB:Stop:" ///< Driver Binding Stop() function call
31 #define LOAD_IMAGE_TOK "LoadImage:" ///< Load a dispatched module
32 #define START_IMAGE_TOK "StartImage:" ///< Dispatched Modules Entry Point execution
33 #define PEIM_TOK "PEIM" ///< PEIM Modules Entry Point execution
34
35 //
36 // Misc defines
37 //
38 #define FPDT_RECORD_REVISION_1 (0x01)
39
40 //
41 // Length field in EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER is a UINT8, thus:
42 //
43 #define FPDT_MAX_PERF_RECORD_SIZE (MAX_UINT8)
44
45 //
46 // FPDT Record Types
47 //
48 #define FPDT_GUID_EVENT_TYPE 0x1010
49 #define FPDT_DYNAMIC_STRING_EVENT_TYPE 0x1011
50 #define FPDT_DUAL_GUID_STRING_EVENT_TYPE 0x1012
51 #define FPDT_GUID_QWORD_EVENT_TYPE 0x1013
52 #define FPDT_GUID_QWORD_STRING_EVENT_TYPE 0x1014
53
54 //
55 // EDKII extended Fpdt record structures
56 //
57 #define FPDT_STRING_EVENT_RECORD_NAME_LENGTH 24
58
59 #pragma pack(1)
60 //
61 // FPDT Boot Performance Guid Event Record Structure
62 //
63 typedef struct {
64 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;
65 ///
66 /// ProgressID < 0x10 are reserved for core performance entries.
67 /// Start measurement point shall have lowered one nibble set to zero and
68 /// corresponding end points shall have lowered one nibble set to non-zero value;
69 /// keeping other nibbles same as start point.
70 ///
71 UINT16 ProgressID;
72 ///
73 /// APIC ID for the processor in the system used as a timestamp clock source.
74 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
75 ///
76 UINT32 ApicID;
77 ///
78 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
79 ///
80 UINT64 Timestamp;
81 ///
82 /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.
83 ///
84 EFI_GUID Guid;
85 } FPDT_GUID_EVENT_RECORD;
86
87 //
88 // FPDT Boot Performance Dynamic String Event Record Structure
89 //
90 typedef struct {
91 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;
92 ///
93 /// ProgressID < 0x10 are reserved for core performance entries.
94 /// Start measurement point shall have lowered one nibble set to zero and
95 /// corresponding end points shall have lowered one nibble set to non-zero value;
96 /// keeping other nibbles same as start point.
97 ///
98 UINT16 ProgressID;
99 ///
100 /// APIC ID for the processor in the system used as a timestamp clock source.
101 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
102 ///
103 UINT32 ApicID;
104 ///
105 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
106 ///
107 UINT64 Timestamp;
108 ///
109 /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.
110 ///
111 EFI_GUID Guid;
112 ///
113 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
114 /// It may be module name, function name, or token name.
115 ///
116 CHAR8 String[0];
117 } FPDT_DYNAMIC_STRING_EVENT_RECORD;
118
119 //
120 // FPDT Boot Performance Dual GUID String Event Record Structure
121 //
122 typedef struct {
123 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;
124 ///
125 /// ProgressID < 0x10 are reserved for core performance entries.
126 /// Start measurement point shall have lowered one nibble set to zero and
127 /// corresponding end points shall have lowered one nibble set to non-zero value;
128 /// keeping other nibbles same as start point.
129 ///
130 UINT16 ProgressID;
131 ///
132 /// APIC ID for the processor in the system used as a timestamp clock source.
133 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
134 ///
135 UINT32 ApicID;
136 ///
137 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
138 ///
139 UINT64 Timestamp;
140 ///
141 /// GUID of the module logging the event.
142 ///
143 EFI_GUID Guid1;
144 ///
145 /// Event or Ppi or Protocol GUID for Callback.
146 ///
147 EFI_GUID Guid2;
148 ///
149 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
150 /// It is the function name.
151 ///
152 CHAR8 String[0];
153 } FPDT_DUAL_GUID_STRING_EVENT_RECORD;
154
155 //
156 // FPDT Boot Performance GUID Qword Event Record Structure
157 //
158 typedef struct {
159 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;
160 ///
161 /// ProgressID < 0x10 are reserved for core performance entries.
162 /// Start measurement point shall have lowered one nibble set to zero and
163 /// corresponding end points shall have lowered one nibble set to non-zero value;
164 /// keeping other nibbles same as start point.
165 ///
166 UINT16 ProgressID;
167 ///
168 /// APIC ID for the processor in the system used as a timestamp clock source.
169 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
170 ///
171 UINT32 ApicID;
172 ///
173 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
174 ///
175 UINT64 Timestamp;
176 ///
177 /// GUID of the module logging the event
178 ///
179 EFI_GUID Guid;
180 ///
181 /// Qword of misc data, meaning depends on the ProgressId
182 ///
183 UINT64 Qword;
184 } FPDT_GUID_QWORD_EVENT_RECORD;
185
186 //
187 // FPDT Boot Performance GUID Qword String Event Record Structure
188 //
189 typedef struct {
190 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;
191 ///
192 /// ProgressID < 0x10 are reserved for core performance entries.
193 /// Start measurement point shall have lowered one nibble set to zero and
194 /// corresponding end points shall have lowered one nibble set to non-zero value;
195 /// keeping other nibbles same as start point.
196 ///
197 UINT16 ProgressID;
198 ///
199 /// APIC ID for the processor in the system used as a timestamp clock source.
200 /// If only one timestamp clock source is used, this field is Reserved and populated as 0.
201 ///
202 UINT32 ApicID;
203 ///
204 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.
205 ///
206 UINT64 Timestamp;
207 ///
208 /// GUID of the module logging the event
209 ///
210 EFI_GUID Guid;
211 ///
212 /// Qword of misc data, meaning depends on the ProgressId
213 ///
214 UINT64 Qword;
215 ///
216 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
217 ///
218 CHAR8 String[0];
219 } FPDT_GUID_QWORD_STRING_EVENT_RECORD;
220
221 #pragma pack()
222
223 //
224 // Union of all FPDT records
225 //
226 typedef union {
227 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER RecordHeader;
228 FPDT_GUID_EVENT_RECORD GuidEvent;
229 FPDT_DYNAMIC_STRING_EVENT_RECORD DynamicStringEvent;
230 FPDT_DUAL_GUID_STRING_EVENT_RECORD DualGuidStringEvent;
231 FPDT_GUID_QWORD_EVENT_RECORD GuidQwordEvent;
232 FPDT_GUID_QWORD_STRING_EVENT_RECORD GuidQwordStringEvent;
233 } FPDT_RECORD;
234
235 //
236 // Union of all pointers to FPDT records
237 //
238 typedef union {
239 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER *RecordHeader;
240 FPDT_GUID_EVENT_RECORD *GuidEvent;
241 FPDT_DYNAMIC_STRING_EVENT_RECORD *DynamicStringEvent;
242 FPDT_DUAL_GUID_STRING_EVENT_RECORD *DualGuidStringEvent;
243 FPDT_GUID_QWORD_EVENT_RECORD *GuidQwordEvent;
244 FPDT_GUID_QWORD_STRING_EVENT_RECORD *GuidQwordStringEvent;
245 } FPDT_RECORD_PTR;
246
247 ///
248 /// Hob:
249 /// GUID - gEdkiiFpdtExtendedFirmwarePerformanceGuid;
250 /// Data - FPDT_PEI_EXT_PERF_HEADER + one or more FPDT records
251 ///
252 typedef struct {
253 UINT32 SizeOfAllEntries;
254 UINT32 LoadImageCount;
255 UINT32 HobIsFull;
256 } FPDT_PEI_EXT_PERF_HEADER;
257
258 extern EFI_GUID gEdkiiFpdtExtendedFirmwarePerformanceGuid;
259
260 #endif