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