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