TianoCore EDK2 master
Loading...
Searching...
No Matches
SmiHandlerProfileInfo.c
Go to the documentation of this file.
1
9#include <PiDxe.h>
10#include <Library/BaseLib.h>
15#include <Library/DebugLib.h>
16#include <Library/PrintLib.h>
17#include <Library/UefiLib.h>
22
24
25#define PROFILE_NAME_STRING_LENGTH 64
26CHAR8 mNameString[PROFILE_NAME_STRING_LENGTH + 1];
27
28VOID *mSmiHandlerProfileDatabase;
29UINTN mSmiHandlerProfileDatabaseSize;
30
37VOID
39 IN UINT8 *Data,
40 IN UINTN Size
41 )
42{
43 UINTN Index;
44
45 for (Index = 0; Index < Size; Index++) {
46 Print (L"%02x", (UINTN)Data[Index]);
47 if ((Index + 1) != Size) {
48 Print (L" ");
49 }
50 }
51}
52
56VOID
58 VOID
59 )
60{
61 EFI_STATUS Status;
62 UINTN CommSize;
63 UINT8 *CommBuffer;
67 EFI_SMM_COMMUNICATION_PROTOCOL *SmmCommunication;
68 UINTN MinimalSizeNeeded;
69 EDKII_PI_SMM_COMMUNICATION_REGION_TABLE *PiSmmCommunicationRegionTable;
70 UINT32 Index;
72 VOID *Buffer;
73 UINTN Size;
74 UINTN Offset;
75
76 Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **)&SmmCommunication);
77 if (EFI_ERROR (Status)) {
78 Print (L"SmiHandlerProfile: Locate SmmCommunication protocol - %r\n", Status);
79 return;
80 }
81
82 MinimalSizeNeeded = EFI_PAGE_SIZE;
83
85 &gEdkiiPiSmmCommunicationRegionTableGuid,
86 (VOID **)&PiSmmCommunicationRegionTable
87 );
88 if (EFI_ERROR (Status)) {
89 Print (L"SmiHandlerProfile: Get PiSmmCommunicationRegionTable - %r\n", Status);
90 return;
91 }
92
93 ASSERT (PiSmmCommunicationRegionTable != NULL);
94 Entry = (EFI_MEMORY_DESCRIPTOR *)(PiSmmCommunicationRegionTable + 1);
95 Size = 0;
96 for (Index = 0; Index < PiSmmCommunicationRegionTable->NumberOfEntries; Index++) {
97 if (Entry->Type == EfiConventionalMemory) {
98 Size = EFI_PAGES_TO_SIZE ((UINTN)Entry->NumberOfPages);
99 if (Size >= MinimalSizeNeeded) {
100 break;
101 }
102 }
103
104 Entry = (EFI_MEMORY_DESCRIPTOR *)((UINT8 *)Entry + PiSmmCommunicationRegionTable->DescriptorSize);
105 }
106
107 ASSERT (Index < PiSmmCommunicationRegionTable->NumberOfEntries);
108 CommBuffer = (UINT8 *)(UINTN)Entry->PhysicalStart;
109
110 //
111 // Get Size
112 //
113 CommHeader = (EFI_SMM_COMMUNICATE_HEADER *)&CommBuffer[0];
114 CopyMem (&CommHeader->HeaderGuid, &gSmiHandlerProfileGuid, sizeof (gSmiHandlerProfileGuid));
116
118 CommGetInfo->Header.Command = SMI_HANDLER_PROFILE_COMMAND_GET_INFO;
119 CommGetInfo->Header.DataLength = sizeof (*CommGetInfo);
120 CommGetInfo->Header.ReturnStatus = (UINT64)-1;
121 CommGetInfo->DataSize = 0;
122
123 CommSize = sizeof (EFI_GUID) + sizeof (UINTN) + CommHeader->MessageLength;
124 Status = SmmCommunication->Communicate (SmmCommunication, CommBuffer, &CommSize);
125 if (EFI_ERROR (Status)) {
126 Print (L"SmiHandlerProfile: SmmCommunication - %r\n", Status);
127 return;
128 }
129
130 if (CommGetInfo->Header.ReturnStatus != 0) {
131 Print (L"SmiHandlerProfile: GetInfo - 0x%0x\n", CommGetInfo->Header.ReturnStatus);
132 return;
133 }
134
135 mSmiHandlerProfileDatabaseSize = (UINTN)CommGetInfo->DataSize;
136
137 //
138 // Get Data
139 //
140 mSmiHandlerProfileDatabase = AllocateZeroPool (mSmiHandlerProfileDatabaseSize);
141 if (mSmiHandlerProfileDatabase == NULL) {
142 Status = EFI_OUT_OF_RESOURCES;
143 Print (L"SmiHandlerProfile: AllocateZeroPool (0x%x) for dump buffer - %r\n", mSmiHandlerProfileDatabaseSize, Status);
144 return;
145 }
146
147 CommHeader = (EFI_SMM_COMMUNICATE_HEADER *)&CommBuffer[0];
148 CopyMem (&CommHeader->HeaderGuid, &gSmiHandlerProfileGuid, sizeof (gSmiHandlerProfileGuid));
150
152 CommGetData->Header.Command = SMI_HANDLER_PROFILE_COMMAND_GET_DATA_BY_OFFSET;
153 CommGetData->Header.DataLength = sizeof (*CommGetData);
154 CommGetData->Header.ReturnStatus = (UINT64)-1;
155
156 CommSize = sizeof (EFI_GUID) + sizeof (UINTN) + CommHeader->MessageLength;
157 Buffer = (UINT8 *)CommHeader + CommSize;
158 Size -= CommSize;
159
160 CommGetData->DataBuffer = (PHYSICAL_ADDRESS)(UINTN)Buffer;
161 CommGetData->DataOffset = 0;
162 while (CommGetData->DataOffset < mSmiHandlerProfileDatabaseSize) {
163 Offset = (UINTN)CommGetData->DataOffset;
164 if (Size <= (mSmiHandlerProfileDatabaseSize - CommGetData->DataOffset)) {
165 CommGetData->DataSize = (UINT64)Size;
166 } else {
167 CommGetData->DataSize = (UINT64)(mSmiHandlerProfileDatabaseSize - CommGetData->DataOffset);
168 }
169
170 Status = SmmCommunication->Communicate (SmmCommunication, CommBuffer, &CommSize);
171 ASSERT_EFI_ERROR (Status);
172
173 if (CommGetData->Header.ReturnStatus != 0) {
174 FreePool (mSmiHandlerProfileDatabase);
175 mSmiHandlerProfileDatabase = NULL;
176 Print (L"SmiHandlerProfile: GetData - 0x%x\n", CommGetData->Header.ReturnStatus);
177 return;
178 }
179
180 CopyMem ((UINT8 *)mSmiHandlerProfileDatabase + Offset, (VOID *)(UINTN)CommGetData->DataBuffer, (UINTN)CommGetData->DataSize);
181 }
182
183 DEBUG ((DEBUG_INFO, "SmiHandlerProfileSize - 0x%x\n", mSmiHandlerProfileDatabaseSize));
184
185 return;
186}
187
200VOID
202 IN CHAR8 *PdbFileName,
203 OUT CHAR8 *AsciiBuffer
204 )
205{
206 UINTN IndexPdb; // Current work location within a Pdb string.
207 UINTN IndexBuffer; // Current work location within a Buffer string.
208 UINTN StartIndex;
209 UINTN EndIndex;
210
211 ZeroMem (AsciiBuffer, PROFILE_NAME_STRING_LENGTH + 1);
212
213 if (PdbFileName == NULL) {
214 AsciiStrnCpyS (AsciiBuffer, PROFILE_NAME_STRING_LENGTH + 1, " ", 1);
215 } else {
216 StartIndex = 0;
217 for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++) {
218 }
219
220 for (IndexPdb = 0; PdbFileName[IndexPdb] != 0; IndexPdb++) {
221 if ((PdbFileName[IndexPdb] == '\\') || (PdbFileName[IndexPdb] == '/')) {
222 StartIndex = IndexPdb + 1;
223 }
224
225 if (PdbFileName[IndexPdb] == '.') {
226 EndIndex = IndexPdb;
227 }
228 }
229
230 IndexBuffer = 0;
231 for (IndexPdb = StartIndex; IndexPdb < EndIndex; IndexPdb++) {
232 AsciiBuffer[IndexBuffer] = PdbFileName[IndexPdb];
233 IndexBuffer++;
234 if (IndexBuffer >= PROFILE_NAME_STRING_LENGTH) {
235 AsciiBuffer[PROFILE_NAME_STRING_LENGTH] = 0;
236 break;
237 }
238 }
239 }
240}
241
254CHAR8 *
257 )
258{
259 EFI_STATUS Status;
260 CHAR16 *NameString;
261 UINTN StringSize;
262
263 if (ImageStruct == NULL) {
264 return "???";
265 }
266
267 //
268 // Method 1: Get the name string from image PDB
269 //
270 if (ImageStruct->PdbStringOffset != 0) {
271 GetShortPdbFileName ((CHAR8 *)((UINTN)ImageStruct + ImageStruct->PdbStringOffset), mNameString);
272 return mNameString;
273 }
274
275 if (!IsZeroGuid (&ImageStruct->FileGuid)) {
276 //
277 // Try to get the image's FFS UI section by image GUID
278 //
279 NameString = NULL;
280 StringSize = 0;
281 Status = GetSectionFromAnyFv (
282 &ImageStruct->FileGuid,
283 EFI_SECTION_USER_INTERFACE,
284 0,
285 (VOID **)&NameString,
286 &StringSize
287 );
288 if (!EFI_ERROR (Status)) {
289 //
290 // Method 2: Get the name string from FFS UI section
291 //
292 if (StrLen (NameString) > PROFILE_NAME_STRING_LENGTH) {
293 NameString[PROFILE_NAME_STRING_LENGTH] = 0;
294 }
295
296 UnicodeStrToAsciiStrS (NameString, mNameString, sizeof (mNameString));
297 FreePool (NameString);
298 return mNameString;
299 }
300 }
301
302 //
303 // Method 3: Get the name string from image GUID
304 //
305 AsciiSPrint (mNameString, sizeof (mNameString), "%g", &ImageStruct->FileGuid);
306 return mNameString;
307}
308
318 IN UINTN ImageRef
319 )
320{
322
323 ImageStruct = (VOID *)mSmiHandlerProfileDatabase;
324 while ((UINTN)ImageStruct < (UINTN)mSmiHandlerProfileDatabase + mSmiHandlerProfileDatabaseSize) {
325 if (ImageStruct->Header.Signature == SMM_CORE_IMAGE_DATABASE_SIGNATURE) {
326 if (ImageStruct->ImageRef == ImageRef) {
327 return ImageStruct;
328 }
329 }
330
331 ImageStruct = (VOID *)((UINTN)ImageStruct + ImageStruct->Header.Length);
332 }
333
334 return NULL;
335}
336
340VOID
342 VOID
343 )
344{
346 CHAR8 *PdbString;
347 CHAR8 *NameString;
348
349 ImageStruct = (VOID *)mSmiHandlerProfileDatabase;
350 while ((UINTN)ImageStruct < (UINTN)mSmiHandlerProfileDatabase + mSmiHandlerProfileDatabaseSize) {
351 if (ImageStruct->Header.Signature == SMM_CORE_IMAGE_DATABASE_SIGNATURE) {
352 NameString = GetDriverNameString (ImageStruct);
353 Print (L" <Image Name=\"%a\"", NameString);
354 Print (L" Base=\"0x%lx\" Size=\"0x%lx\"", ImageStruct->ImageBase, ImageStruct->ImageSize);
355 if (ImageStruct->EntryPoint != 0) {
356 Print (L" EntryPoint=\"0x%lx\"", ImageStruct->EntryPoint);
357 }
358
359 Print (L" FvFile=\"%g\"", &ImageStruct->FileGuid);
360 Print (L" RefId=\"0x%x\"", ImageStruct->ImageRef);
361 Print (L">\n");
362 if (ImageStruct->PdbStringOffset != 0) {
363 PdbString = (CHAR8 *)((UINTN)ImageStruct + ImageStruct->PdbStringOffset);
364 Print (L" <Pdb>%a</Pdb>\n", PdbString);
365 }
366
367 Print (L" </Image>\n");
368 }
369
370 ImageStruct = (VOID *)((UINTN)ImageStruct + ImageStruct->Header.Length);
371 }
372
373 return;
374}
375
376CHAR8 *mSxTypeString[] = {
377 "SxS0",
378 "SxS1",
379 "SxS2",
380 "SxS3",
381 "SxS4",
382 "SxS5",
383};
384
392CHAR8 *
394 IN EFI_SLEEP_TYPE Type
395 )
396{
397 if ((Type >= 0) && (Type < ARRAY_SIZE (mSxTypeString))) {
398 return mSxTypeString[Type];
399 } else {
400 AsciiSPrint (mNameString, sizeof (mNameString), "0x%x", Type);
401 return mNameString;
402 }
403}
404
405CHAR8 *mSxPhaseString[] = {
406 "SxEntry",
407 "SxExit",
408};
409
417CHAR8 *
419 IN EFI_SLEEP_PHASE Phase
420 )
421{
422 if ((Phase >= 0) && (Phase < ARRAY_SIZE (mSxPhaseString))) {
423 return mSxPhaseString[Phase];
424 } else {
425 AsciiSPrint (mNameString, sizeof (mNameString), "0x%x", Phase);
426 return mNameString;
427 }
428}
429
430CHAR8 *mPowerButtonPhaseString[] = {
431 "PowerButtonEntry",
432 "PowerButtonExit",
433};
434
442CHAR8 *
445 )
446{
447 if ((Phase >= 0) && (Phase < ARRAY_SIZE (mPowerButtonPhaseString))) {
448 return mPowerButtonPhaseString[Phase];
449 } else {
450 AsciiSPrint (mNameString, sizeof (mNameString), "0x%x", Phase);
451 return mNameString;
452 }
453}
454
455CHAR8 *mStandbyButtonPhaseString[] = {
456 "StandbyButtonEntry",
457 "StandbyButtonExit",
458};
459
467CHAR8 *
470 )
471{
472 if ((Phase >= 0) && (Phase < ARRAY_SIZE (mStandbyButtonPhaseString))) {
473 return mStandbyButtonPhaseString[Phase];
474 } else {
475 AsciiSPrint (mNameString, sizeof (mNameString), "0x%x", Phase);
476 return mNameString;
477 }
478}
479
480CHAR8 *mIoTrapTypeString[] = {
481 "WriteTrap",
482 "ReadTrap",
483 "ReadWriteTrap",
484};
485
493CHAR8 *
496 )
497{
498 if ((Type >= 0) && (Type < ARRAY_SIZE (mIoTrapTypeString))) {
499 return mIoTrapTypeString[Type];
500 } else {
501 AsciiSPrint (mNameString, sizeof (mNameString), "0x%x", Type);
502 return mNameString;
503 }
504}
505
506CHAR8 *mUsbTypeString[] = {
507 "UsbLegacy",
508 "UsbWake",
509};
510
518CHAR8 *
521 )
522{
523 if ((Type >= 0) && (Type < ARRAY_SIZE (mUsbTypeString))) {
524 return mUsbTypeString[Type];
525 } else {
526 AsciiSPrint (mNameString, sizeof (mNameString), "0x%x", Type);
527 return mNameString;
528 }
529}
530
538VOID
540 IN EFI_GUID *HandlerType,
541 IN VOID *Context,
542 IN UINTN ContextSize
543 )
544{
545 CHAR16 *Str;
546
547 if (CompareGuid (HandlerType, &gEfiSmmSwDispatch2ProtocolGuid)) {
548 Print (L" SwSmi=\"0x%lx\"", ((SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT *)Context)->SwSmiInputValue);
549 } else if (CompareGuid (HandlerType, &gEfiSmmSxDispatch2ProtocolGuid)) {
550 Print (L" SxType=\"%a\"", SxTypeToString (((EFI_SMM_SX_REGISTER_CONTEXT *)Context)->Type));
551 Print (L" SxPhase=\"%a\"", SxPhaseToString (((EFI_SMM_SX_REGISTER_CONTEXT *)Context)->Phase));
552 } else if (CompareGuid (HandlerType, &gEfiSmmPowerButtonDispatch2ProtocolGuid)) {
553 Print (L" PowerButtonPhase=\"%a\"", PowerButtonPhaseToString (((EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT *)Context)->Phase));
554 } else if (CompareGuid (HandlerType, &gEfiSmmStandbyButtonDispatch2ProtocolGuid)) {
555 Print (L" StandbyButtonPhase=\"%a\"", StandbyButtonPhaseToString (((EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT *)Context)->Phase));
556 } else if (CompareGuid (HandlerType, &gEfiSmmPeriodicTimerDispatch2ProtocolGuid)) {
557 Print (L" PeriodicTimerPeriod=\"%ld\"", ((EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT *)Context)->Period);
558 Print (L" PeriodicTimerSmiTickInterval=\"%ld\"", ((EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT *)Context)->SmiTickInterval);
559 } else if (CompareGuid (HandlerType, &gEfiSmmGpiDispatch2ProtocolGuid)) {
560 Print (L" GpiNum=\"0x%lx\"", ((EFI_SMM_GPI_REGISTER_CONTEXT *)Context)->GpiNum);
561 } else if (CompareGuid (HandlerType, &gEfiSmmIoTrapDispatch2ProtocolGuid)) {
562 Print (L" IoTrapAddress=\"0x%x\"", ((EFI_SMM_IO_TRAP_REGISTER_CONTEXT *)Context)->Address);
563 Print (L" IoTrapLength=\"0x%x\"", ((EFI_SMM_IO_TRAP_REGISTER_CONTEXT *)Context)->Length);
564 Print (L" IoTrapType=\"%a\"", IoTrapTypeToString (((EFI_SMM_IO_TRAP_REGISTER_CONTEXT *)Context)->Type));
565 } else if (CompareGuid (HandlerType, &gEfiSmmUsbDispatch2ProtocolGuid)) {
566 Print (L" UsbType=\"0x%x\"", UsbTypeToString (((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT *)Context)->Type));
568 Print (L" UsbDevicePath=\"%s\"", Str);
569 if (Str != NULL) {
570 FreePool (Str);
571 }
572 } else {
573 Print (L" Context=\"");
574 InternalDumpData (Context, ContextSize);
575 Print (L"\"");
576 }
577}
578
584VOID
586 IN UINT32 HandlerCategory
587 )
588{
590 SMM_CORE_SMI_HANDLER_STRUCTURE *SmiHandlerStruct;
591 UINTN Index;
593 CHAR8 *NameString;
594
595 SmiStruct = (VOID *)mSmiHandlerProfileDatabase;
596 while ((UINTN)SmiStruct < (UINTN)mSmiHandlerProfileDatabase + mSmiHandlerProfileDatabaseSize) {
597 if ((SmiStruct->Header.Signature == SMM_CORE_SMI_DATABASE_SIGNATURE) && (SmiStruct->HandlerCategory == HandlerCategory)) {
598 SmiHandlerStruct = (VOID *)(SmiStruct + 1);
599 Print (L" <SmiEntry");
600 if (!IsZeroGuid (&SmiStruct->HandlerType)) {
601 Print (L" HandlerType=\"%g\"", &SmiStruct->HandlerType);
602 }
603
604 Print (L">\n");
605 for (Index = 0; Index < SmiStruct->HandlerCount; Index++) {
606 Print (L" <SmiHandler");
607 if (SmiHandlerStruct->ContextBufferSize != 0) {
608 DumpSmiChildContext (&SmiStruct->HandlerType, (UINT8 *)SmiHandlerStruct + SmiHandlerStruct->ContextBufferOffset, SmiHandlerStruct->ContextBufferSize);
609 }
610
611 Print (L">\n");
612 ImageStruct = GetImageFromRef ((UINTN)SmiHandlerStruct->ImageRef);
613 NameString = GetDriverNameString (ImageStruct);
614 Print (L" <Module RefId=\"0x%x\" Name=\"%a\">\n", SmiHandlerStruct->ImageRef, NameString);
615 if ((ImageStruct != NULL) && (ImageStruct->PdbStringOffset != 0)) {
616 Print (L" <Pdb>%a</Pdb>\n", (UINT8 *)ImageStruct + ImageStruct->PdbStringOffset);
617 }
618
619 Print (L" </Module>\n");
620 Print (L" <Handler Address=\"0x%lx\">\n", SmiHandlerStruct->Handler);
621 if (ImageStruct != NULL) {
622 Print (L" <RVA>0x%x</RVA>\n", (UINTN)(SmiHandlerStruct->Handler - ImageStruct->ImageBase));
623 }
624
625 Print (L" </Handler>\n", SmiHandlerStruct->Handler);
626 Print (L" <Caller Address=\"0x%lx\">\n", SmiHandlerStruct->CallerAddr);
627 if (ImageStruct != NULL) {
628 Print (L" <RVA>0x%x</RVA>\n", (UINTN)(SmiHandlerStruct->CallerAddr - ImageStruct->ImageBase));
629 }
630
631 Print (L" </Caller>\n", SmiHandlerStruct->Handler);
632 SmiHandlerStruct = (VOID *)((UINTN)SmiHandlerStruct + SmiHandlerStruct->Length);
633 Print (L" </SmiHandler>\n");
634 }
635
636 Print (L" </SmiEntry>\n");
637 }
638
639 SmiStruct = (VOID *)((UINTN)SmiStruct + SmiStruct->Header.Length);
640 }
641
642 return;
643}
644
655EFIAPI
657 IN EFI_HANDLE ImageHandle,
658 IN EFI_SYSTEM_TABLE *SystemTable
659 )
660{
662
663 if (mSmiHandlerProfileDatabase == NULL) {
664 return EFI_SUCCESS;
665 }
666
667 //
668 // Dump all image
669 //
670 Print (L"<?xml version=\"1.0\" encoding=\"utf-16\"?>\n");
671 Print (L"<SmiHandlerProfile>\n");
672 Print (L"<ImageDatabase>\n");
673 Print (L" <!-- SMM image loaded -->\n");
675 Print (L"</ImageDatabase>\n\n");
676
677 //
678 // Dump SMI Handler
679 //
680 Print (L"<SmiHandlerDatabase>\n");
681 Print (L" <!-- SMI Handler registered -->\n\n");
682 Print (L" <SmiHandlerCategory Name=\"RootSmi\">\n");
683 Print (L" <!-- The root SMI Handler registered by SmmCore -->\n");
684 DumpSmiHandler (SmmCoreSmiHandlerCategoryRootHandler);
685 Print (L" </SmiHandlerCategory>\n\n");
686
687 Print (L" <SmiHandlerCategory Name=\"GuidSmi\">\n");
688 Print (L" <!-- The GUID SMI Handler registered by SmmCore -->\n");
689 DumpSmiHandler (SmmCoreSmiHandlerCategoryGuidHandler);
690 Print (L" </SmiHandlerCategory>\n\n");
691
692 Print (L" <SmiHandlerCategory Name=\"HardwareSmi\">\n");
693 Print (L" <!-- The hardware SMI Handler registered by SmmChildDispatcher -->\n");
694 DumpSmiHandler (SmmCoreSmiHandlerCategoryHardwareHandler);
695 Print (L" </SmiHandlerCategory>\n\n");
696
697 Print (L"</SmiHandlerDatabase>\n");
698 Print (L"</SmiHandlerProfile>\n");
699
700 if (mSmiHandlerProfileDatabase != NULL) {
701 FreePool (mSmiHandlerProfileDatabase);
702 }
703
704 return EFI_SUCCESS;
705}
UINT64 UINTN
RETURN_STATUS EFIAPI AsciiStrnCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source, IN UINTN Length)
Definition: SafeString.c:1875
RETURN_STATUS EFIAPI UnicodeStrToAsciiStrS(IN CONST CHAR16 *Source, OUT CHAR8 *Destination, IN UINTN DestMax)
Definition: SafeString.c:2650
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
Definition: MemLibGuid.c:73
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
BOOLEAN EFIAPI IsZeroGuid(IN CONST GUID *Guid)
Definition: MemLibGuid.c:156
CHAR16 *EFIAPI ConvertDevicePathToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
EFI_STATUS EFIAPI GetSectionFromAnyFv(IN CONST EFI_GUID *NameGuid, IN EFI_SECTION_TYPE SectionType, IN UINTN SectionInstance, OUT VOID **Buffer, OUT UINTN *Size)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
UINTN EFIAPI AsciiSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
Definition: PrintLib.c:813
#define NULL
Definition: Base.h:319
#define TRUE
Definition: Base.h:301
#define ARRAY_SIZE(Array)
Definition: Base.h:1393
#define IN
Definition: Base.h:279
#define OFFSET_OF(TYPE, Field)
Definition: Base.h:758
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_MM_IO_TRAP_DISPATCH_TYPE
EFI_POWER_BUTTON_PHASE
EFI_STANDBY_BUTTON_PHASE
EFI_SLEEP_TYPE
Definition: MmSxDispatch.h:25
EFI_SLEEP_PHASE
Definition: MmSxDispatch.h:38
EFI_USB_MMI_TYPE
Definition: MmUsbDispatch.h:28
EFI_STATUS EFIAPI SmiHandlerProfileInfoEntrypoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID InternalDumpData(IN UINT8 *Data, IN UINTN Size)
VOID DumpSmiHandler(IN UINT32 HandlerCategory)
SMM_CORE_IMAGE_DATABASE_STRUCTURE * GetImageFromRef(IN UINTN ImageRef)
CHAR8 * UsbTypeToString(IN EFI_USB_SMI_TYPE Type)
CHAR8 * SxTypeToString(IN EFI_SLEEP_TYPE Type)
VOID DumpSmmLoadedImage(VOID)
CHAR8 * StandbyButtonPhaseToString(IN EFI_STANDBY_BUTTON_PHASE Phase)
VOID GetSmiHandlerProfileDatabase(VOID)
CHAR8 * IoTrapTypeToString(IN EFI_SMM_IO_TRAP_DISPATCH_TYPE Type)
CHAR8 * PowerButtonPhaseToString(IN EFI_POWER_BUTTON_PHASE Phase)
CHAR8 * GetDriverNameString(IN SMM_CORE_IMAGE_DATABASE_STRUCTURE *ImageStruct)
VOID GetShortPdbFileName(IN CHAR8 *PdbFileName, OUT CHAR8 *AsciiBuffer)
VOID DumpSmiChildContext(IN EFI_GUID *HandlerType, IN VOID *Context, IN UINTN ContextSize)
CHAR8 * SxPhaseToString(IN EFI_SLEEP_PHASE Phase)
#define EFI_PAGES_TO_SIZE(Pages)
Definition: UefiBaseType.h:213
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
GUID EFI_GUID
Definition: UefiBaseType.h:25
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
EFI_STATUS EFIAPI EfiGetSystemConfigurationTable(IN EFI_GUID *TableGuid, OUT VOID **Table)
Definition: UefiLib.c:82
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)
Definition: UefiLibPrint.c:113
@ EfiConventionalMemory
Definition: Base.h:213