]>
Commit | Line | Data |
---|---|---|
84edd20b SZ |
1 | /** @file\r |
2 | Memory profile data structure.\r | |
3 | \r | |
d1102dba | 4 | Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
84edd20b SZ |
6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef _MEMORY_PROFILE_H_\r | |
10 | #define _MEMORY_PROFILE_H_\r | |
11 | \r | |
94092aa6 SZ |
12 | #include <Pi/PiFirmwareFile.h>\r |
13 | \r | |
84edd20b | 14 | //\r |
db9b00f1 | 15 | // For BIOS MemoryType (0 ~ EfiMaxMemoryType - 1), it is recorded in UsageByType[MemoryType]. (Each valid entry has one entry)\r |
84edd20b | 16 | // For OS MemoryType (0x80000000 ~ 0xFFFFFFFF), it is recorded in UsageByType[EfiMaxMemoryType]. (All types are combined into one entry)\r |
db9b00f1 | 17 | // For OEM MemoryType (0x70000000 ~ 0x7FFFFFFF), it is recorded in UsageByType[EfiMaxMemoryType + 1]. (All types are combined into one entry)\r |
84edd20b SZ |
18 | //\r |
19 | \r | |
20 | typedef struct {\r | |
21 | UINT32 Signature;\r | |
22 | UINT16 Length;\r | |
23 | UINT16 Revision;\r | |
24 | } MEMORY_PROFILE_COMMON_HEADER;\r | |
25 | \r | |
26 | #define MEMORY_PROFILE_CONTEXT_SIGNATURE SIGNATURE_32 ('M','P','C','T')\r | |
db9b00f1 | 27 | #define MEMORY_PROFILE_CONTEXT_REVISION 0x0002\r |
84edd20b SZ |
28 | \r |
29 | typedef struct {\r | |
30 | MEMORY_PROFILE_COMMON_HEADER Header;\r | |
31 | UINT64 CurrentTotalUsage;\r | |
32 | UINT64 PeakTotalUsage;\r | |
db9b00f1 SZ |
33 | UINT64 CurrentTotalUsageByType[EfiMaxMemoryType + 2];\r |
34 | UINT64 PeakTotalUsageByType[EfiMaxMemoryType + 2];\r | |
84edd20b SZ |
35 | UINT64 TotalImageSize;\r |
36 | UINT32 ImageCount;\r | |
37 | UINT32 SequenceCount;\r | |
38 | } MEMORY_PROFILE_CONTEXT;\r | |
39 | \r | |
40 | #define MEMORY_PROFILE_DRIVER_INFO_SIGNATURE SIGNATURE_32 ('M','P','D','I')\r | |
94092aa6 | 41 | #define MEMORY_PROFILE_DRIVER_INFO_REVISION 0x0003\r |
84edd20b SZ |
42 | \r |
43 | typedef struct {\r | |
44 | MEMORY_PROFILE_COMMON_HEADER Header;\r | |
45 | EFI_GUID FileName;\r | |
46 | PHYSICAL_ADDRESS ImageBase;\r | |
47 | UINT64 ImageSize;\r | |
48 | PHYSICAL_ADDRESS EntryPoint;\r | |
49 | UINT16 ImageSubsystem;\r | |
50 | EFI_FV_FILETYPE FileType;\r | |
51 | UINT8 Reserved[1];\r | |
52 | UINT32 AllocRecordCount;\r | |
53 | UINT64 CurrentUsage;\r | |
54 | UINT64 PeakUsage;\r | |
db9b00f1 SZ |
55 | UINT64 CurrentUsageByType[EfiMaxMemoryType + 2];\r |
56 | UINT64 PeakUsageByType[EfiMaxMemoryType + 2];\r | |
94092aa6 SZ |
57 | UINT16 PdbStringOffset;\r |
58 | UINT8 Reserved2[6];\r | |
59 | //CHAR8 PdbString[];\r | |
84edd20b SZ |
60 | } MEMORY_PROFILE_DRIVER_INFO;\r |
61 | \r | |
62 | typedef enum {\r | |
63 | MemoryProfileActionAllocatePages = 1,\r | |
64 | MemoryProfileActionFreePages = 2,\r | |
65 | MemoryProfileActionAllocatePool = 3,\r | |
66 | MemoryProfileActionFreePool = 4,\r | |
67 | } MEMORY_PROFILE_ACTION;\r | |
68 | \r | |
94092aa6 SZ |
69 | //\r |
70 | // Below is the detailed MEMORY_PROFILE_ACTION definition.\r | |
71 | //\r | |
72 | // 31 15 9 8 8 7 7 6 6 5-4 3 - 0\r | |
73 | // +----------------------------------------------+\r | |
74 | // |User | |Lib| |Re|Copy|Zero|Align|Type|Basic|\r | |
75 | // +----------------------------------------------+\r | |
76 | //\r | |
77 | \r | |
78 | //\r | |
79 | // Basic Action\r | |
80 | // 1 : AllocatePages\r | |
81 | // 2 : FreePages\r | |
82 | // 3 : AllocatePool\r | |
83 | // 4 : FreePool\r | |
84 | //\r | |
85 | #define MEMORY_PROFILE_ACTION_BASIC_MASK 0xF\r | |
86 | \r | |
87 | //\r | |
88 | // Extension\r | |
89 | //\r | |
90 | #define MEMORY_PROFILE_ACTION_EXTENSION_MASK 0xFFF0\r | |
91 | #define MEMORY_PROFILE_ACTION_EXTENSION_LIB_MASK 0x8000\r | |
92 | #define MEMORY_PROFILE_ACTION_EXTENSION_REALLOC_MASK 0x0200\r | |
93 | #define MEMORY_PROFILE_ACTION_EXTENSION_COPY_MASK 0x0100\r | |
94 | #define MEMORY_PROFILE_ACTION_EXTENSION_ZERO_MASK 0x0080\r | |
95 | #define MEMORY_PROFILE_ACTION_EXTENSION_ALIGN_MASK 0x0040\r | |
96 | #define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_MASK 0x0030\r | |
97 | #define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_BASIC 0x0000\r | |
98 | #define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_RUNTIME 0x0010\r | |
99 | #define MEMORY_PROFILE_ACTION_EXTENSION_MEM_TYPE_RESERVED 0x0020\r | |
100 | \r | |
101 | //\r | |
102 | // Extension (used by memory allocation lib)\r | |
103 | //\r | |
104 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_PAGES 0x8001\r | |
105 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_PAGES 0x8011\r | |
106 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_PAGES 0x8021\r | |
107 | #define MEMORY_PROFILE_ACTION_LIB_FREE_PAGES 0x8002\r | |
108 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_PAGES 0x8041\r | |
109 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_RUNTIME_PAGES 0x8051\r | |
110 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ALIGNED_RESERVED_PAGES 0x8061\r | |
111 | #define MEMORY_PROFILE_ACTION_LIB_FREE_ALIGNED_PAGES 0x8042\r | |
112 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_POOL 0x8003\r | |
113 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_POOL 0x8013\r | |
114 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_POOL 0x8023\r | |
115 | #define MEMORY_PROFILE_ACTION_LIB_FREE_POOL 0x8004\r | |
116 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_ZERO_POOL 0x8083\r | |
117 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_ZERO_POOL 0x8093\r | |
118 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_ZERO_POOL 0x80a3\r | |
119 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_COPY_POOL 0x8103\r | |
120 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_COPY_POOL 0x8113\r | |
121 | #define MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_COPY_POOL 0x8123\r | |
122 | #define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_POOL 0x8203\r | |
123 | #define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RUNTIME_POOL 0x8213\r | |
124 | #define MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RESERVED_POOL 0x8223\r | |
125 | \r | |
126 | //\r | |
127 | // User defined: 0x80000000~0xFFFFFFFF\r | |
128 | //\r | |
129 | // NOTE: User defined action MUST OR the basic action,\r | |
130 | // so that core can know the action is allocate or free,\r | |
131 | // and the type is pages (can be freed partially)\r | |
132 | // or pool (cannot be freed partially).\r | |
133 | //\r | |
134 | #define MEMORY_PROFILE_ACTION_USER_DEFINED_MASK 0x80000000\r | |
135 | \r | |
84edd20b | 136 | #define MEMORY_PROFILE_ALLOC_INFO_SIGNATURE SIGNATURE_32 ('M','P','A','I')\r |
94092aa6 | 137 | #define MEMORY_PROFILE_ALLOC_INFO_REVISION 0x0002\r |
84edd20b SZ |
138 | \r |
139 | typedef struct {\r | |
140 | MEMORY_PROFILE_COMMON_HEADER Header;\r | |
141 | PHYSICAL_ADDRESS CallerAddress;\r | |
142 | UINT32 SequenceId;\r | |
072a3ca1 SZ |
143 | UINT8 Reserved[2];\r |
144 | UINT16 ActionStringOffset;\r | |
84edd20b SZ |
145 | MEMORY_PROFILE_ACTION Action;\r |
146 | EFI_MEMORY_TYPE MemoryType;\r | |
147 | PHYSICAL_ADDRESS Buffer;\r | |
148 | UINT64 Size;\r | |
94092aa6 | 149 | //CHAR8 ActionString[];\r |
84edd20b SZ |
150 | } MEMORY_PROFILE_ALLOC_INFO;\r |
151 | \r | |
152 | #define MEMORY_PROFILE_DESCRIPTOR_SIGNATURE SIGNATURE_32 ('M','P','D','R')\r | |
153 | #define MEMORY_PROFILE_DESCRIPTOR_REVISION 0x0001\r | |
154 | \r | |
155 | typedef struct {\r | |
156 | MEMORY_PROFILE_COMMON_HEADER Header;\r | |
157 | PHYSICAL_ADDRESS Address;\r | |
158 | UINT64 Size;\r | |
159 | } MEMORY_PROFILE_DESCRIPTOR;\r | |
160 | \r | |
161 | #define MEMORY_PROFILE_FREE_MEMORY_SIGNATURE SIGNATURE_32 ('M','P','R','M')\r | |
162 | #define MEMORY_PROFILE_FREE_MEMORY_REVISION 0x0001\r | |
163 | \r | |
164 | typedef struct {\r | |
165 | MEMORY_PROFILE_COMMON_HEADER Header;\r | |
166 | UINT64 TotalFreeMemoryPages;\r | |
167 | UINT32 FreeMemoryEntryCount;\r | |
168 | UINT8 Reserved[4];\r | |
169 | //MEMORY_PROFILE_DESCRIPTOR MemoryDescriptor[FreeMemoryEntryCount];\r | |
170 | } MEMORY_PROFILE_FREE_MEMORY;\r | |
171 | \r | |
172 | #define MEMORY_PROFILE_MEMORY_RANGE_SIGNATURE SIGNATURE_32 ('M','P','M','R')\r | |
173 | #define MEMORY_PROFILE_MEMORY_RANGE_REVISION 0x0001\r | |
174 | \r | |
175 | typedef struct {\r | |
176 | MEMORY_PROFILE_COMMON_HEADER Header;\r | |
177 | UINT32 MemoryRangeCount;\r | |
178 | UINT8 Reserved[4];\r | |
179 | //MEMORY_PROFILE_DESCRIPTOR MemoryDescriptor[MemoryRangeCount];\r | |
180 | } MEMORY_PROFILE_MEMORY_RANGE;\r | |
181 | \r | |
182 | //\r | |
183 | // UEFI memory profile layout:\r | |
184 | // +--------------------------------+\r | |
185 | // | CONTEXT |\r | |
186 | // +--------------------------------+\r | |
187 | // | DRIVER_INFO(1) |\r | |
188 | // +--------------------------------+\r | |
189 | // | ALLOC_INFO(1, 1) |\r | |
190 | // +--------------------------------+\r | |
191 | // | ALLOC_INFO(1, m1) |\r | |
192 | // +--------------------------------+\r | |
193 | // | DRIVER_INFO(n) |\r | |
194 | // +--------------------------------+\r | |
195 | // | ALLOC_INFO(n, 1) |\r | |
196 | // +--------------------------------+\r | |
197 | // | ALLOC_INFO(n, mn) |\r | |
198 | // +--------------------------------+\r | |
199 | //\r | |
200 | \r | |
201 | typedef struct _EDKII_MEMORY_PROFILE_PROTOCOL EDKII_MEMORY_PROFILE_PROTOCOL;\r | |
202 | \r | |
203 | /**\r | |
204 | Get memory profile data.\r | |
205 | \r | |
206 | @param[in] This The EDKII_MEMORY_PROFILE_PROTOCOL instance.\r | |
207 | @param[in, out] ProfileSize On entry, points to the size in bytes of the ProfileBuffer.\r | |
208 | On return, points to the size of the data returned in ProfileBuffer.\r | |
209 | @param[out] ProfileBuffer Profile buffer.\r | |
d1102dba | 210 | \r |
84edd20b | 211 | @return EFI_SUCCESS Get the memory profile data successfully.\r |
94092aa6 | 212 | @return EFI_UNSUPPORTED Memory profile is unsupported.\r |
d1102dba | 213 | @return EFI_BUFFER_TO_SMALL The ProfileSize is too small for the resulting data.\r |
84edd20b SZ |
214 | ProfileSize is updated with the size required.\r |
215 | \r | |
216 | **/\r | |
217 | typedef\r | |
218 | EFI_STATUS\r | |
219 | (EFIAPI *EDKII_MEMORY_PROFILE_GET_DATA)(\r | |
220 | IN EDKII_MEMORY_PROFILE_PROTOCOL *This,\r | |
221 | IN OUT UINT64 *ProfileSize,\r | |
222 | OUT VOID *ProfileBuffer\r | |
223 | );\r | |
224 | \r | |
225 | /**\r | |
226 | Register image to memory profile.\r | |
227 | \r | |
228 | @param[in] This The EDKII_MEMORY_PROFILE_PROTOCOL instance.\r | |
229 | @param[in] FilePath File path of the image.\r | |
230 | @param[in] ImageBase Image base address.\r | |
231 | @param[in] ImageSize Image size.\r | |
232 | @param[in] FileType File type of the image.\r | |
233 | \r | |
94092aa6 SZ |
234 | @return EFI_SUCCESS Register successfully.\r |
235 | @return EFI_UNSUPPORTED Memory profile is unsupported,\r | |
236 | or memory profile for the image is not required.\r | |
237 | @return EFI_OUT_OF_RESOURCES No enough resource for this register.\r | |
84edd20b SZ |
238 | \r |
239 | **/\r | |
240 | typedef\r | |
241 | EFI_STATUS\r | |
242 | (EFIAPI *EDKII_MEMORY_PROFILE_REGISTER_IMAGE)(\r | |
243 | IN EDKII_MEMORY_PROFILE_PROTOCOL *This,\r | |
244 | IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r | |
245 | IN PHYSICAL_ADDRESS ImageBase,\r | |
246 | IN UINT64 ImageSize,\r | |
247 | IN EFI_FV_FILETYPE FileType\r | |
248 | );\r | |
249 | \r | |
250 | /**\r | |
251 | Unregister image from memory profile.\r | |
252 | \r | |
253 | @param[in] This The EDKII_MEMORY_PROFILE_PROTOCOL instance.\r | |
254 | @param[in] FilePath File path of the image.\r | |
255 | @param[in] ImageBase Image base address.\r | |
256 | @param[in] ImageSize Image size.\r | |
257 | \r | |
94092aa6 SZ |
258 | @return EFI_SUCCESS Unregister successfully.\r |
259 | @return EFI_UNSUPPORTED Memory profile is unsupported,\r | |
260 | or memory profile for the image is not required.\r | |
84edd20b SZ |
261 | @return EFI_NOT_FOUND The image is not found.\r |
262 | \r | |
263 | **/\r | |
264 | typedef\r | |
265 | EFI_STATUS\r | |
266 | (EFIAPI *EDKII_MEMORY_PROFILE_UNREGISTER_IMAGE)(\r | |
267 | IN EDKII_MEMORY_PROFILE_PROTOCOL *This,\r | |
268 | IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r | |
269 | IN PHYSICAL_ADDRESS ImageBase,\r | |
270 | IN UINT64 ImageSize\r | |
271 | );\r | |
272 | \r | |
94092aa6 SZ |
273 | #define MEMORY_PROFILE_RECORDING_ENABLE TRUE\r |
274 | #define MEMORY_PROFILE_RECORDING_DISABLE FALSE\r | |
275 | \r | |
276 | /**\r | |
277 | Get memory profile recording state.\r | |
278 | \r | |
279 | @param[in] This The EDKII_MEMORY_PROFILE_PROTOCOL instance.\r | |
280 | @param[out] RecordingState Recording state.\r | |
281 | \r | |
282 | @return EFI_SUCCESS Memory profile recording state is returned.\r | |
283 | @return EFI_UNSUPPORTED Memory profile is unsupported.\r | |
284 | @return EFI_INVALID_PARAMETER RecordingState is NULL.\r | |
285 | \r | |
286 | **/\r | |
287 | typedef\r | |
288 | EFI_STATUS\r | |
289 | (EFIAPI *EDKII_MEMORY_PROFILE_GET_RECORDING_STATE) (\r | |
290 | IN EDKII_MEMORY_PROFILE_PROTOCOL *This,\r | |
291 | OUT BOOLEAN *RecordingState\r | |
292 | );\r | |
293 | \r | |
294 | /**\r | |
295 | Set memory profile recording state.\r | |
296 | \r | |
297 | @param[in] This The EDKII_MEMORY_PROFILE_PROTOCOL instance.\r | |
298 | @param[in] RecordingState Recording state.\r | |
299 | \r | |
300 | @return EFI_SUCCESS Set memory profile recording state successfully.\r | |
301 | @return EFI_UNSUPPORTED Memory profile is unsupported.\r | |
302 | \r | |
303 | **/\r | |
304 | typedef\r | |
305 | EFI_STATUS\r | |
306 | (EFIAPI *EDKII_MEMORY_PROFILE_SET_RECORDING_STATE) (\r | |
307 | IN EDKII_MEMORY_PROFILE_PROTOCOL *This,\r | |
308 | IN BOOLEAN RecordingState\r | |
309 | );\r | |
310 | \r | |
311 | /**\r | |
312 | Record memory profile of multilevel caller.\r | |
313 | \r | |
314 | @param[in] This The EDKII_MEMORY_PROFILE_PROTOCOL instance.\r | |
315 | @param[in] CallerAddress Address of caller.\r | |
316 | @param[in] Action Memory profile action.\r | |
317 | @param[in] MemoryType Memory type.\r | |
318 | EfiMaxMemoryType means the MemoryType is unknown.\r | |
319 | @param[in] Buffer Buffer address.\r | |
320 | @param[in] Size Buffer size.\r | |
321 | @param[in] ActionString String for memory profile action.\r | |
322 | Only needed for user defined allocate action.\r | |
323 | \r | |
324 | @return EFI_SUCCESS Memory profile is updated.\r | |
325 | @return EFI_UNSUPPORTED Memory profile is unsupported,\r | |
326 | or memory profile for the image is not required,\r | |
327 | or memory profile for the memory type is not required.\r | |
328 | @return EFI_ACCESS_DENIED It is during memory profile data getting.\r | |
329 | @return EFI_ABORTED Memory profile recording is not enabled.\r | |
330 | @return EFI_OUT_OF_RESOURCES No enough resource to update memory profile for allocate action.\r | |
331 | @return EFI_NOT_FOUND No matched allocate info found for free action.\r | |
332 | \r | |
333 | **/\r | |
334 | typedef\r | |
335 | EFI_STATUS\r | |
336 | (EFIAPI *EDKII_MEMORY_PROFILE_RECORD) (\r | |
337 | IN EDKII_MEMORY_PROFILE_PROTOCOL *This,\r | |
338 | IN PHYSICAL_ADDRESS CallerAddress,\r | |
339 | IN MEMORY_PROFILE_ACTION Action,\r | |
340 | IN EFI_MEMORY_TYPE MemoryType,\r | |
341 | IN VOID *Buffer,\r | |
342 | IN UINTN Size,\r | |
343 | IN CHAR8 *ActionString OPTIONAL\r | |
344 | );\r | |
345 | \r | |
84edd20b | 346 | struct _EDKII_MEMORY_PROFILE_PROTOCOL {\r |
94092aa6 SZ |
347 | EDKII_MEMORY_PROFILE_GET_DATA GetData;\r |
348 | EDKII_MEMORY_PROFILE_REGISTER_IMAGE RegisterImage;\r | |
349 | EDKII_MEMORY_PROFILE_UNREGISTER_IMAGE UnregisterImage;\r | |
350 | EDKII_MEMORY_PROFILE_GET_RECORDING_STATE GetRecordingState;\r | |
351 | EDKII_MEMORY_PROFILE_SET_RECORDING_STATE SetRecordingState;\r | |
352 | EDKII_MEMORY_PROFILE_RECORD Record;\r | |
84edd20b SZ |
353 | };\r |
354 | \r | |
355 | //\r | |
356 | // SMRAM profile layout:\r | |
357 | // +--------------------------------+\r | |
358 | // | CONTEXT |\r | |
359 | // +--------------------------------+\r | |
360 | // | DRIVER_INFO(1) |\r | |
361 | // +--------------------------------+\r | |
362 | // | ALLOC_INFO(1, 1) |\r | |
363 | // +--------------------------------+\r | |
364 | // | ALLOC_INFO(1, m1) |\r | |
365 | // +--------------------------------+\r | |
366 | // | DRIVER_INFO(n) |\r | |
367 | // +--------------------------------+\r | |
368 | // | ALLOC_INFO(n, 1) |\r | |
369 | // +--------------------------------+\r | |
370 | // | ALLOC_INFO(n, mn) |\r | |
371 | // +--------------------------------+\r | |
372 | // | FREE_MEMORY |\r | |
373 | // +--------------------------------+\r | |
374 | // | FREE MEMORY DESCRIPTOR(1) |\r | |
375 | // +--------------------------------+\r | |
376 | // | FREE MEMORY DESCRIPTOR(p) |\r | |
377 | // +--------------------------------+\r | |
378 | // | MEMORY_RANGE |\r | |
379 | // +--------------------------------+\r | |
380 | // | MEMORY RANGE DESCRIPTOR(1) |\r | |
381 | // +--------------------------------+\r | |
382 | // | MEMORY RANGE DESCRIPTOR(q) |\r | |
383 | // +--------------------------------+\r | |
384 | //\r | |
385 | \r | |
386 | //\r | |
387 | // SMRAM profile command\r | |
388 | //\r | |
73e0de62 SZ |
389 | #define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO 0x1\r |
390 | #define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA 0x2\r | |
84edd20b | 391 | //\r |
3b3f8822 | 392 | // Below 2 commands have been deprecated. They may not be re-used.\r |
84edd20b | 393 | //\r |
3b3f8822 M |
394 | #define SMRAM_PROFILE_COMMAND_DEPRECATED1 0x3\r |
395 | #define SMRAM_PROFILE_COMMAND_DEPRECATED2 0x4\r | |
73e0de62 SZ |
396 | \r |
397 | #define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET 0x5\r | |
94092aa6 SZ |
398 | #define SMRAM_PROFILE_COMMAND_GET_RECORDING_STATE 0x6\r |
399 | #define SMRAM_PROFILE_COMMAND_SET_RECORDING_STATE 0x7\r | |
84edd20b SZ |
400 | \r |
401 | typedef struct {\r | |
402 | UINT32 Command;\r | |
403 | UINT32 DataLength;\r | |
404 | UINT64 ReturnStatus;\r | |
405 | } SMRAM_PROFILE_PARAMETER_HEADER;\r | |
406 | \r | |
407 | typedef struct {\r | |
408 | SMRAM_PROFILE_PARAMETER_HEADER Header;\r | |
409 | UINT64 ProfileSize;\r | |
410 | } SMRAM_PROFILE_PARAMETER_GET_PROFILE_INFO;\r | |
411 | \r | |
412 | typedef struct {\r | |
413 | SMRAM_PROFILE_PARAMETER_HEADER Header;\r | |
414 | UINT64 ProfileSize;\r | |
415 | PHYSICAL_ADDRESS ProfileBuffer;\r | |
416 | } SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA;\r | |
417 | \r | |
73e0de62 SZ |
418 | typedef struct {\r |
419 | SMRAM_PROFILE_PARAMETER_HEADER Header;\r | |
420 | //\r | |
421 | // On input, profile buffer size.\r | |
422 | // On output, actual profile data size copied.\r | |
423 | //\r | |
424 | UINT64 ProfileSize;\r | |
425 | PHYSICAL_ADDRESS ProfileBuffer;\r | |
426 | //\r | |
427 | // On input, profile buffer offset to copy.\r | |
428 | // On output, next time profile buffer offset to copy.\r | |
429 | //\r | |
430 | UINT64 ProfileOffset;\r | |
431 | } SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA_BY_OFFSET;\r | |
432 | \r | |
94092aa6 SZ |
433 | typedef struct {\r |
434 | SMRAM_PROFILE_PARAMETER_HEADER Header;\r | |
435 | BOOLEAN RecordingState;\r | |
436 | } SMRAM_PROFILE_PARAMETER_RECORDING_STATE;\r | |
437 | \r | |
84edd20b SZ |
438 | typedef struct {\r |
439 | SMRAM_PROFILE_PARAMETER_HEADER Header;\r | |
440 | EFI_GUID FileName;\r | |
441 | PHYSICAL_ADDRESS ImageBuffer;\r | |
442 | UINT64 NumberOfPage;\r | |
443 | } SMRAM_PROFILE_PARAMETER_REGISTER_IMAGE;\r | |
444 | \r | |
445 | typedef struct {\r | |
446 | SMRAM_PROFILE_PARAMETER_HEADER Header;\r | |
447 | EFI_GUID FileName;\r | |
448 | PHYSICAL_ADDRESS ImageBuffer;\r | |
449 | UINT64 NumberOfPage;\r | |
450 | } SMRAM_PROFILE_PARAMETER_UNREGISTER_IMAGE;\r | |
451 | \r | |
452 | \r | |
453 | #define EDKII_MEMORY_PROFILE_GUID { \\r | |
94092aa6 | 454 | 0x821c9a09, 0x541a, 0x40f6, { 0x9f, 0x43, 0xa, 0xd1, 0x93, 0xa1, 0x2c, 0xfe } \\r |
84edd20b SZ |
455 | }\r |
456 | \r | |
457 | extern EFI_GUID gEdkiiMemoryProfileGuid;\r | |
458 | \r | |
94092aa6 SZ |
459 | typedef EDKII_MEMORY_PROFILE_PROTOCOL EDKII_SMM_MEMORY_PROFILE_PROTOCOL;\r |
460 | \r | |
461 | #define EDKII_SMM_MEMORY_PROFILE_GUID { \\r | |
462 | 0xe22bbcca, 0x516a, 0x46a8, { 0x80, 0xe2, 0x67, 0x45, 0xe8, 0x36, 0x93, 0xbd } \\r | |
463 | }\r | |
464 | \r | |
465 | extern EFI_GUID gEdkiiSmmMemoryProfileGuid;\r | |
466 | \r | |
84edd20b SZ |
467 | #endif\r |
468 | \r |