]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Guid / ExtendedFirmwarePerformance.h
CommitLineData
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
5Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 6SPDX-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
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
28\r
73fef64f
LG
29//\r
30// Misc defines\r
31//\r
32#define FPDT_RECORD_REVISION_1 (0x01)\r
33\r
34//\r
35// Length field in EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER is a UINT8, thus:\r
36//\r
37#define FPDT_MAX_PERF_RECORD_SIZE (MAX_UINT8)\r
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
51#define FPDT_STRING_EVENT_RECORD_NAME_LENGTH 24\r
52\r
53#pragma pack(1)\r
54//\r
55// FPDT Boot Performance Guid Event Record Structure\r
56//\r
57typedef struct {\r
58 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
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
65 UINT16 ProgressID;\r
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
70 UINT32 ApicID;\r
71 ///\r
72 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
73 ///\r
74 UINT64 Timestamp;\r
75 ///\r
76 /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.\r
77 ///\r
78 EFI_GUID Guid;\r
79} FPDT_GUID_EVENT_RECORD;\r
80\r
81//\r
82// FPDT Boot Performance Dynamic String Event Record Structure\r
83//\r
84typedef struct {\r
85 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
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
92 UINT16 ProgressID;\r
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
97 UINT32 ApicID;\r
98 ///\r
99 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
100 ///\r
101 UINT64 Timestamp;\r
102 ///\r
103 /// If ProgressID < 0x10, GUID of the referenced module; otherwise, GUID of the module logging the event.\r
104 ///\r
105 EFI_GUID Guid;\r
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
110 CHAR8 String[0];\r
111} FPDT_DYNAMIC_STRING_EVENT_RECORD;\r
112\r
113//\r
114// FPDT Boot Performance Dual GUID String Event Record Structure\r
115//\r
116typedef struct {\r
117 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
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
124 UINT16 ProgressID;\r
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
129 UINT32 ApicID;\r
130 ///\r
131 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
132 ///\r
133 UINT64 Timestamp;\r
134 ///\r
135 /// GUID of the module logging the event.\r
136 ///\r
137 EFI_GUID Guid1;\r
138 ///\r
139 /// Event or Ppi or Protocol GUID for Callback.\r
140 ///\r
141 EFI_GUID Guid2;\r
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
146 CHAR8 String[0];\r
147} FPDT_DUAL_GUID_STRING_EVENT_RECORD;\r
148\r
149//\r
150// FPDT Boot Performance GUID Qword Event Record Structure\r
151//\r
152typedef struct {\r
153 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
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
160 UINT16 ProgressID;\r
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
165 UINT32 ApicID;\r
166 ///\r
167 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
168 ///\r
169 UINT64 Timestamp;\r
170 ///\r
171 /// GUID of the module logging the event\r
172 ///\r
173 EFI_GUID Guid;\r
174 ///\r
175 /// Qword of misc data, meaning depends on the ProgressId\r
176 ///\r
177 UINT64 Qword;\r
178} FPDT_GUID_QWORD_EVENT_RECORD;\r
179\r
180//\r
181// FPDT Boot Performance GUID Qword String Event Record Structure\r
182//\r
183typedef struct {\r
184 EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER Header;\r
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
191 UINT16 ProgressID;\r
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
196 UINT32 ApicID;\r
197 ///\r
198 /// 64-bit value (nanosecond) describing elapsed time since the most recent deassertion of processor reset.\r
199 ///\r
200 UINT64 Timestamp;\r
201 ///\r
202 /// GUID of the module logging the event\r
203 ///\r
204 EFI_GUID Guid;\r
205 ///\r
206 /// Qword of misc data, meaning depends on the ProgressId\r
207 ///\r
208 UINT64 Qword;\r
209 ///\r
210 /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).\r
211 ///\r
212 CHAR8 String[0];\r
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
220typedef union {\r
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
227} FPDT_RECORD;\r
228\r
229//\r
230// Union of all pointers to FPDT records\r
231//\r
232typedef union {\r
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
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
246typedef struct {\r
247 UINT32 SizeOfAllEntries;\r
248 UINT32 LoadImageCount;\r
249 UINT32 HobIsFull;\r
250} FPDT_PEI_EXT_PERF_HEADER;\r
251\r
252extern EFI_GUID gEdkiiFpdtExtendedFirmwarePerformanceGuid;\r
253\r
254#endif\r