2 Shell application to dump SMI handler profile information.
4 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <Library/BaseLib.h>
17 #include <Library/BaseMemoryLib.h>
18 #include <Library/MemoryAllocationLib.h>
19 #include <Library/UefiBootServicesTableLib.h>
20 #include <Library/UefiRuntimeServicesTableLib.h>
21 #include <Library/DebugLib.h>
22 #include <Library/PrintLib.h>
23 #include <Library/UefiLib.h>
24 #include <Library/DevicePathLib.h>
25 #include <Library/PeCoffGetEntryPointLib.h>
26 #include <Library/DxeServicesLib.h>
27 #include <Protocol/SmmCommunication.h>
28 #include <Guid/PiSmmCommunicationRegionTable.h>
30 #include <Guid/SmiHandlerProfile.h>
32 #define PROFILE_NAME_STRING_LENGTH 64
33 CHAR8 mNameString
[PROFILE_NAME_STRING_LENGTH
+ 1];
35 VOID
*mSmiHandlerProfileDatabase
;
36 UINTN mSmiHandlerProfileDatabaseSize
;
39 This function dump raw data.
42 @param Size raw data size
51 for (Index
= 0; Index
< Size
; Index
++) {
52 Print (L
"%02x", (UINTN
)Data
[Index
]);
53 if ((Index
+ 1) != Size
) {
60 Get SMI handler profile database.
63 GetSmiHandlerProfileDatabase(
70 EFI_SMM_COMMUNICATE_HEADER
*CommHeader
;
71 SMI_HANDLER_PROFILE_PARAMETER_GET_INFO
*CommGetInfo
;
72 SMI_HANDLER_PROFILE_PARAMETER_GET_DATA_BY_OFFSET
*CommGetData
;
73 EFI_SMM_COMMUNICATION_PROTOCOL
*SmmCommunication
;
74 UINTN MinimalSizeNeeded
;
75 EDKII_PI_SMM_COMMUNICATION_REGION_TABLE
*PiSmmCommunicationRegionTable
;
77 EFI_MEMORY_DESCRIPTOR
*Entry
;
82 Status
= gBS
->LocateProtocol(&gEfiSmmCommunicationProtocolGuid
, NULL
, (VOID
**)&SmmCommunication
);
83 if (EFI_ERROR(Status
)) {
84 Print(L
"SmiHandlerProfile: Locate SmmCommunication protocol - %r\n", Status
);
88 MinimalSizeNeeded
= EFI_PAGE_SIZE
;
90 Status
= EfiGetSystemConfigurationTable(
91 &gEdkiiPiSmmCommunicationRegionTableGuid
,
92 (VOID
**)&PiSmmCommunicationRegionTable
94 if (EFI_ERROR(Status
)) {
95 Print(L
"SmiHandlerProfile: Get PiSmmCommunicationRegionTable - %r\n", Status
);
98 ASSERT(PiSmmCommunicationRegionTable
!= NULL
);
99 Entry
= (EFI_MEMORY_DESCRIPTOR
*)(PiSmmCommunicationRegionTable
+ 1);
101 for (Index
= 0; Index
< PiSmmCommunicationRegionTable
->NumberOfEntries
; Index
++) {
102 if (Entry
->Type
== EfiConventionalMemory
) {
103 Size
= EFI_PAGES_TO_SIZE((UINTN
)Entry
->NumberOfPages
);
104 if (Size
>= MinimalSizeNeeded
) {
108 Entry
= (EFI_MEMORY_DESCRIPTOR
*)((UINT8
*)Entry
+ PiSmmCommunicationRegionTable
->DescriptorSize
);
110 ASSERT(Index
< PiSmmCommunicationRegionTable
->NumberOfEntries
);
111 CommBuffer
= (UINT8
*)(UINTN
)Entry
->PhysicalStart
;
116 CommHeader
= (EFI_SMM_COMMUNICATE_HEADER
*)&CommBuffer
[0];
117 CopyMem(&CommHeader
->HeaderGuid
, &gSmiHandlerProfileGuid
, sizeof(gSmiHandlerProfileGuid
));
118 CommHeader
->MessageLength
= sizeof(SMI_HANDLER_PROFILE_PARAMETER_GET_INFO
);
120 CommGetInfo
= (SMI_HANDLER_PROFILE_PARAMETER_GET_INFO
*)&CommBuffer
[OFFSET_OF(EFI_SMM_COMMUNICATE_HEADER
, Data
)];
121 CommGetInfo
->Header
.Command
= SMI_HANDLER_PROFILE_COMMAND_GET_INFO
;
122 CommGetInfo
->Header
.DataLength
= sizeof(*CommGetInfo
);
123 CommGetInfo
->Header
.ReturnStatus
= (UINT64
)-1;
124 CommGetInfo
->DataSize
= 0;
126 CommSize
= sizeof(EFI_GUID
) + sizeof(UINTN
) + CommHeader
->MessageLength
;
127 Status
= SmmCommunication
->Communicate(SmmCommunication
, CommBuffer
, &CommSize
);
128 if (EFI_ERROR(Status
)) {
129 Print(L
"SmiHandlerProfile: SmmCommunication - %r\n", Status
);
133 if (CommGetInfo
->Header
.ReturnStatus
!= 0) {
134 Print(L
"SmiHandlerProfile: GetInfo - 0x%0x\n", CommGetInfo
->Header
.ReturnStatus
);
138 mSmiHandlerProfileDatabaseSize
= (UINTN
)CommGetInfo
->DataSize
;
143 mSmiHandlerProfileDatabase
= AllocateZeroPool(mSmiHandlerProfileDatabaseSize
);
144 if (mSmiHandlerProfileDatabase
== NULL
) {
145 Status
= EFI_OUT_OF_RESOURCES
;
146 Print(L
"SmiHandlerProfile: AllocateZeroPool (0x%x) for dump buffer - %r\n", mSmiHandlerProfileDatabaseSize
, Status
);
150 CommHeader
= (EFI_SMM_COMMUNICATE_HEADER
*)&CommBuffer
[0];
151 CopyMem(&CommHeader
->HeaderGuid
, &gSmiHandlerProfileGuid
, sizeof(gSmiHandlerProfileGuid
));
152 CommHeader
->MessageLength
= sizeof(SMI_HANDLER_PROFILE_PARAMETER_GET_DATA_BY_OFFSET
);
154 CommGetData
= (SMI_HANDLER_PROFILE_PARAMETER_GET_DATA_BY_OFFSET
*)&CommBuffer
[OFFSET_OF(EFI_SMM_COMMUNICATE_HEADER
, Data
)];
155 CommGetData
->Header
.Command
= SMI_HANDLER_PROFILE_COMMAND_GET_DATA_BY_OFFSET
;
156 CommGetData
->Header
.DataLength
= sizeof(*CommGetData
);
157 CommGetData
->Header
.ReturnStatus
= (UINT64
)-1;
159 CommSize
= sizeof(EFI_GUID
) + sizeof(UINTN
) + CommHeader
->MessageLength
;
160 Buffer
= (UINT8
*)CommHeader
+ CommSize
;
163 CommGetData
->DataBuffer
= (PHYSICAL_ADDRESS
)(UINTN
)Buffer
;
164 CommGetData
->DataOffset
= 0;
165 while (CommGetData
->DataOffset
< mSmiHandlerProfileDatabaseSize
) {
166 Offset
= (UINTN
)CommGetData
->DataOffset
;
167 if (Size
<= (mSmiHandlerProfileDatabaseSize
- CommGetData
->DataOffset
)) {
168 CommGetData
->DataSize
= (UINT64
)Size
;
170 CommGetData
->DataSize
= (UINT64
)(mSmiHandlerProfileDatabaseSize
- CommGetData
->DataOffset
);
172 Status
= SmmCommunication
->Communicate(SmmCommunication
, CommBuffer
, &CommSize
);
173 ASSERT_EFI_ERROR(Status
);
175 if (CommGetData
->Header
.ReturnStatus
!= 0) {
176 FreePool(mSmiHandlerProfileDatabase
);
177 mSmiHandlerProfileDatabase
= NULL
;
178 Print(L
"SmiHandlerProfile: GetData - 0x%x\n", CommGetData
->Header
.ReturnStatus
);
181 CopyMem((UINT8
*)mSmiHandlerProfileDatabase
+ Offset
, (VOID
*)(UINTN
)CommGetData
->DataBuffer
, (UINTN
)CommGetData
->DataSize
);
184 DEBUG ((DEBUG_INFO
, "SmiHandlerProfileSize - 0x%x\n", mSmiHandlerProfileDatabaseSize
));
190 Get the file name portion of the Pdb File Name.
192 The portion of the Pdb File Name between the last backslash and
193 either a following period or the end of the string is copied into
194 AsciiBuffer. The name is truncated, if necessary, to ensure that
195 AsciiBuffer is not overrun.
197 @param[in] PdbFileName Pdb file name.
198 @param[out] AsciiBuffer The resultant Ascii File Name.
202 GetShortPdbFileName (
203 IN CHAR8
*PdbFileName
,
204 OUT CHAR8
*AsciiBuffer
207 UINTN IndexPdb
; // Current work location within a Pdb string.
208 UINTN IndexBuffer
; // Current work location within a Buffer string.
212 ZeroMem (AsciiBuffer
, PROFILE_NAME_STRING_LENGTH
+ 1);
214 if (PdbFileName
== NULL
) {
215 AsciiStrnCpyS (AsciiBuffer
, PROFILE_NAME_STRING_LENGTH
+ 1, " ", 1);
218 for (EndIndex
= 0; PdbFileName
[EndIndex
] != 0; EndIndex
++);
219 for (IndexPdb
= 0; PdbFileName
[IndexPdb
] != 0; IndexPdb
++) {
220 if ((PdbFileName
[IndexPdb
] == '\\') || (PdbFileName
[IndexPdb
] == '/')) {
221 StartIndex
= IndexPdb
+ 1;
224 if (PdbFileName
[IndexPdb
] == '.') {
230 for (IndexPdb
= StartIndex
; IndexPdb
< EndIndex
; IndexPdb
++) {
231 AsciiBuffer
[IndexBuffer
] = PdbFileName
[IndexPdb
];
233 if (IndexBuffer
>= PROFILE_NAME_STRING_LENGTH
) {
234 AsciiBuffer
[PROFILE_NAME_STRING_LENGTH
] = 0;
242 Get a human readable name for an image.
243 The following methods will be tried orderly:
248 @param[in] DriverInfo Pointer to memory profile driver info.
250 @return The resulting Ascii name string is stored in the mNameString global array.
254 GetDriverNameString (
255 IN SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
262 if (ImageStruct
== NULL
) {
267 // Method 1: Get the name string from image PDB
269 if (ImageStruct
->Header
.Length
> sizeof (SMM_CORE_IMAGE_DATABASE_STRUCTURE
)) {
270 GetShortPdbFileName ((CHAR8
*) (ImageStruct
+ 1), mNameString
);
274 if (!IsZeroGuid (&ImageStruct
->FileGuid
)) {
276 // Try to get the image's FFS UI section by image GUID
280 Status
= GetSectionFromAnyFv (
281 &ImageStruct
->FileGuid
,
282 EFI_SECTION_USER_INTERFACE
,
284 (VOID
**) &NameString
,
287 if (!EFI_ERROR (Status
)) {
289 // Method 2: Get the name string from FFS UI section
291 if (StrLen (NameString
) > PROFILE_NAME_STRING_LENGTH
) {
292 NameString
[PROFILE_NAME_STRING_LENGTH
] = 0;
294 UnicodeStrToAsciiStrS (NameString
, mNameString
, sizeof (mNameString
));
295 FreePool (NameString
);
301 // Method 3: Get the name string from image GUID
303 AsciiSPrint (mNameString
, sizeof (mNameString
), "%g", &ImageStruct
->FileGuid
);
308 Get image structure from reference index.
310 @param ImageRef the image reference index
312 @return image structure
314 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*
319 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
;
321 ImageStruct
= (VOID
*)mSmiHandlerProfileDatabase
;
322 while ((UINTN
)ImageStruct
< (UINTN
)mSmiHandlerProfileDatabase
+ mSmiHandlerProfileDatabaseSize
) {
323 if (ImageStruct
->Header
.Signature
== SMM_CORE_IMAGE_DATABASE_SIGNATURE
) {
324 if (ImageStruct
->ImageRef
== ImageRef
) {
328 ImageStruct
= (VOID
*)((UINTN
)ImageStruct
+ ImageStruct
->Header
.Length
);
335 Dump SMM loaded image information.
342 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
;
346 ImageStruct
= (VOID
*)mSmiHandlerProfileDatabase
;
347 while ((UINTN
)ImageStruct
< (UINTN
)mSmiHandlerProfileDatabase
+ mSmiHandlerProfileDatabaseSize
) {
348 if (ImageStruct
->Header
.Signature
== SMM_CORE_IMAGE_DATABASE_SIGNATURE
) {
349 NameString
= GetDriverNameString (ImageStruct
);
350 Print(L
" <Image Name=\"%a\"", NameString
);
351 Print(L
" Base=\"0x%x\" Size=\"0x%x\"", ImageStruct
->ImageBase
, ImageStruct
->ImageSize
);
352 if (ImageStruct
->EntryPoint
!= 0) {
353 Print(L
" EntryPoint=\"0x%x\"", ImageStruct
->EntryPoint
);
355 Print(L
" FvFile=\"%g\"", &ImageStruct
->FileGuid
);
356 Print(L
" RefId=\"0x%x\"", ImageStruct
->ImageRef
);
358 PdbString
= (CHAR8
*)((UINTN
)ImageStruct
+ ImageStruct
->PdbStringOffset
);
359 Print(L
" <Pdb>%a</Pdb>\n", PdbString
);
360 Print(L
" </Image>\n");
363 ImageStruct
= (VOID
*)((UINTN
)ImageStruct
+ ImageStruct
->Header
.Length
);
369 CHAR8
*mSxTypeString
[] = {
379 Convert SxType to a string.
383 @return SxType string
387 IN EFI_SLEEP_TYPE Type
390 if (Type
>= 0 && Type
<= ARRAY_SIZE(mSxTypeString
)) {
391 return mSxTypeString
[Type
];
393 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Type
);
398 CHAR8
*mSxPhaseString
[] = {
404 Convert SxPhase to a string.
408 @return SxPhase string
412 IN EFI_SLEEP_PHASE Phase
415 if (Phase
>= 0 && Phase
<= ARRAY_SIZE(mSxPhaseString
)) {
416 return mSxPhaseString
[Phase
];
418 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Phase
);
423 CHAR8
*mPowerButtonPhaseString
[] = {
429 Convert PowerButtonPhase to a string.
431 @param Phase PowerButtonPhase
433 @return PowerButtonPhase string
436 PowerButtonPhaseToString (
437 IN EFI_POWER_BUTTON_PHASE Phase
440 if (Phase
>= 0 && Phase
<= ARRAY_SIZE(mPowerButtonPhaseString
)) {
441 return mPowerButtonPhaseString
[Phase
];
443 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Phase
);
448 CHAR8
*mStandbyButtonPhaseString
[] = {
449 "StandbyButtonEntry",
454 Convert StandbyButtonPhase to a string.
456 @param Phase StandbyButtonPhase
458 @return StandbyButtonPhase string
461 StandbyButtonPhaseToString (
462 IN EFI_STANDBY_BUTTON_PHASE Phase
465 if (Phase
>= 0 && Phase
<= ARRAY_SIZE(mStandbyButtonPhaseString
)) {
466 return mStandbyButtonPhaseString
[Phase
];
468 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Phase
);
473 CHAR8
*mIoTrapTypeString
[] = {
480 Convert IoTrapType to a string.
482 @param Type IoTrapType
484 @return IoTrapType string
488 IN EFI_SMM_IO_TRAP_DISPATCH_TYPE Type
491 if (Type
>= 0 && Type
<= ARRAY_SIZE(mIoTrapTypeString
)) {
492 return mIoTrapTypeString
[Type
];
494 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Type
);
499 CHAR8
*mUsbTypeString
[] = {
505 Convert UsbType to a string.
509 @return UsbType string
513 IN EFI_USB_SMI_TYPE Type
516 if (Type
>= 0 && Type
<= ARRAY_SIZE(mUsbTypeString
)) {
517 return mUsbTypeString
[Type
];
519 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Type
);
525 Dump SMI child context.
527 @param HandlerType the handler type
528 @param Context the handler context
529 @param ContextSize the handler context size
532 DumpSmiChildContext (
533 IN EFI_GUID
*HandlerType
,
538 if (CompareGuid (HandlerType
, &gEfiSmmSwDispatch2ProtocolGuid
)) {
539 Print(L
" SwSmi=\"0x%x\"", ((EFI_SMM_SW_REGISTER_CONTEXT
*)Context
)->SwSmiInputValue
);
540 } else if (CompareGuid (HandlerType
, &gEfiSmmSxDispatch2ProtocolGuid
)) {
541 Print(L
" SxType=\"%a\"", SxTypeToString(((EFI_SMM_SX_REGISTER_CONTEXT
*)Context
)->Type
));
542 Print(L
" SxPhase=\"%a\"", SxPhaseToString(((EFI_SMM_SX_REGISTER_CONTEXT
*)Context
)->Phase
));
543 } else if (CompareGuid (HandlerType
, &gEfiSmmPowerButtonDispatch2ProtocolGuid
)) {
544 Print(L
" PowerButtonPhase=\"%a\"", PowerButtonPhaseToString(((EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT
*)Context
)->Phase
));
545 } else if (CompareGuid (HandlerType
, &gEfiSmmStandbyButtonDispatch2ProtocolGuid
)) {
546 Print(L
" StandbyButtonPhase=\"%a\"", StandbyButtonPhaseToString(((EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT
*)Context
)->Phase
));
547 } else if (CompareGuid (HandlerType
, &gEfiSmmPeriodicTimerDispatch2ProtocolGuid
)) {
548 Print(L
" PeriodicTimerPeriod=\"%ld\"", ((EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT
*)Context
)->Period
);
549 Print(L
" PeriodicTimerSmiTickInterval=\"%ld\"", ((EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT
*)Context
)->SmiTickInterval
);
550 } else if (CompareGuid (HandlerType
, &gEfiSmmGpiDispatch2ProtocolGuid
)) {
551 Print(L
" GpiNum=\"0x%lx\"", ((EFI_SMM_GPI_REGISTER_CONTEXT
*)Context
)->GpiNum
);
552 } else if (CompareGuid (HandlerType
, &gEfiSmmIoTrapDispatch2ProtocolGuid
)) {
553 Print(L
" IoTrapAddress=\"0x%x\"", ((EFI_SMM_IO_TRAP_REGISTER_CONTEXT
*)Context
)->Address
);
554 Print(L
" IoTrapLength=\"0x%x\"", ((EFI_SMM_IO_TRAP_REGISTER_CONTEXT
*)Context
)->Length
);
555 Print(L
" IoTrapType=\"%a\"", IoTrapTypeToString(((EFI_SMM_IO_TRAP_REGISTER_CONTEXT
*)Context
)->Type
));
556 } else if (CompareGuid (HandlerType
, &gEfiSmmUsbDispatch2ProtocolGuid
)) {
557 Print(L
" UsbType=\"0x%x\"", UsbTypeToString(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT
*)Context
)->Type
));
558 Print(L
" UsbDevicePath=\"%s\"", ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL
*)(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT
*)Context
) + 1), TRUE
, TRUE
));
560 Print(L
" Context=\"");
561 InternalDumpData (Context
, ContextSize
);
567 Dump SMI handler in HandlerCategory.
569 @param HandlerCategory SMI handler category
573 IN UINT32 HandlerCategory
576 SMM_CORE_SMI_DATABASE_STRUCTURE
*SmiStruct
;
577 SMM_CORE_SMI_HANDLER_STRUCTURE
*SmiHandlerStruct
;
579 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
;
582 SmiStruct
= (VOID
*)mSmiHandlerProfileDatabase
;
583 while ((UINTN
)SmiStruct
< (UINTN
)mSmiHandlerProfileDatabase
+ mSmiHandlerProfileDatabaseSize
) {
584 if ((SmiStruct
->Header
.Signature
== SMM_CORE_SMI_DATABASE_SIGNATURE
) && (SmiStruct
->HandlerCategory
== HandlerCategory
)) {
585 SmiHandlerStruct
= (VOID
*)(SmiStruct
+ 1);
586 Print(L
" <SmiEntry");
587 if (!IsZeroGuid (&SmiStruct
->HandlerType
)) {
588 Print(L
" HandlerType=\"%g\"", &SmiStruct
->HandlerType
);
591 for (Index
= 0; Index
< SmiStruct
->HandlerCount
; Index
++) {
592 Print(L
" <SmiHandler");
593 if (SmiHandlerStruct
->ContextBufferSize
!= 0) {
594 DumpSmiChildContext (&SmiStruct
->HandlerType
, (UINT8
*)SmiHandlerStruct
+ SmiHandlerStruct
->ContextBufferOffset
, SmiHandlerStruct
->ContextBufferSize
);
597 ImageStruct
= GetImageFromRef((UINTN
)SmiHandlerStruct
->ImageRef
);
598 NameString
= GetDriverNameString (ImageStruct
);
599 Print(L
" <Module RefId=\"0x%x\" Name=\"%a\">\n", SmiHandlerStruct
->ImageRef
, NameString
);
600 if ((ImageStruct
!= NULL
) && (ImageStruct
->PdbStringOffset
!= 0)) {
601 Print(L
" <Pdb>%a</Pdb>\n", (UINT8
*)ImageStruct
+ ImageStruct
->PdbStringOffset
);
603 Print(L
" </Module>\n");
604 Print(L
" <Handler Address=\"0x%x\">\n", SmiHandlerStruct
->Handler
);
605 if (ImageStruct
!= NULL
) {
606 Print(L
" <RVA>0x%x</RVA>\n", SmiHandlerStruct
->Handler
- ImageStruct
->ImageBase
);
608 Print(L
" </Handler>\n", SmiHandlerStruct
->Handler
);
609 Print(L
" <Caller Address=\"0x%x\">\n", SmiHandlerStruct
->CallerAddr
);
610 if (ImageStruct
!= NULL
) {
611 Print(L
" <RVA>0x%x</RVA>\n", SmiHandlerStruct
->CallerAddr
- ImageStruct
->ImageBase
);
613 Print(L
" </Caller>\n", SmiHandlerStruct
->Handler
);
614 SmiHandlerStruct
= (VOID
*)((UINTN
)SmiHandlerStruct
+ SmiHandlerStruct
->Length
);
615 Print(L
" </SmiHandler>\n");
617 Print(L
" </SmiEntry>\n");
619 SmiStruct
= (VOID
*)((UINTN
)SmiStruct
+ SmiStruct
->Header
.Length
);
626 The Entry Point for SMI handler profile info application.
628 @param ImageHandle The firmware allocated handle for the EFI image.
629 @param SystemTable A pointer to the EFI System Table.
631 @retval EFI_SUCCESS The entry point is executed successfully.
632 @retval Other Some error occurred when executing this entry point.
636 SmiHandlerProfileInfoEntrypoint (
637 IN EFI_HANDLE ImageHandle
,
638 IN EFI_SYSTEM_TABLE
*SystemTable
641 GetSmiHandlerProfileDatabase();
643 if (mSmiHandlerProfileDatabase
== NULL
) {
650 Print(L
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
651 Print(L
"<SmiHandlerProfile>\n");
652 Print(L
"<ImageDatabase>\n");
653 Print(L
" <!-- SMM image loaded -->\n");
654 DumpSmmLoadedImage();
655 Print(L
"</ImageDatabase>\n\n");
660 Print(L
"<SmiHandlerDatabase>\n");
661 Print(L
" <!-- SMI Handler registered -->\n\n");
662 Print(L
" <SmiHandlerCategory Name=\"RootSmi\">\n");
663 Print(L
" <!-- The root SMI Handler registered by SmmCore -->\n");
664 DumpSmiHandler(SmmCoreSmiHandlerCategoryRootHandler
);
665 Print(L
" </SmiHandlerCategory>\n\n");
667 Print(L
" <SmiHandlerCategory Name=\"GuidSmi\">\n");
668 Print(L
" <!-- The GUID SMI Handler registered by SmmCore -->\n");
669 DumpSmiHandler(SmmCoreSmiHandlerCategoryGuidHandler
);
670 Print(L
" </SmiHandlerCategory>\n\n");
672 Print(L
" <SmiHandlerCategory Name=\"HardwareSmi\">\n");
673 Print(L
" <!-- The hardware SMI Handler registered by SmmChildDispatcher -->\n");
674 DumpSmiHandler(SmmCoreSmiHandlerCategoryHardwareHandler
);
675 Print(L
" </SmiHandlerCategory>\n\n");
677 Print(L
"</SmiHandlerDatabase>\n");
678 Print(L
"</SmiHandlerProfile>\n");
680 if (mSmiHandlerProfileDatabase
!= NULL
) {
681 FreePool(mSmiHandlerProfileDatabase
);