2 Shell application to dump SMI handler profile information.
4 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/BaseLib.h>
11 #include <Library/BaseMemoryLib.h>
12 #include <Library/MemoryAllocationLib.h>
13 #include <Library/UefiBootServicesTableLib.h>
14 #include <Library/UefiRuntimeServicesTableLib.h>
15 #include <Library/DebugLib.h>
16 #include <Library/PrintLib.h>
17 #include <Library/UefiLib.h>
18 #include <Library/DevicePathLib.h>
19 #include <Library/DxeServicesLib.h>
20 #include <Protocol/SmmCommunication.h>
21 #include <Guid/PiSmmCommunicationRegionTable.h>
23 #include <Guid/SmiHandlerProfile.h>
25 #define PROFILE_NAME_STRING_LENGTH 64
26 CHAR8 mNameString
[PROFILE_NAME_STRING_LENGTH
+ 1];
28 VOID
*mSmiHandlerProfileDatabase
;
29 UINTN mSmiHandlerProfileDatabaseSize
;
32 This function dump raw data.
35 @param Size raw data size
45 for (Index
= 0; Index
< Size
; Index
++) {
46 Print (L
"%02x", (UINTN
)Data
[Index
]);
47 if ((Index
+ 1) != Size
) {
54 Get SMI handler profile database.
57 GetSmiHandlerProfileDatabase (
64 EFI_SMM_COMMUNICATE_HEADER
*CommHeader
;
65 SMI_HANDLER_PROFILE_PARAMETER_GET_INFO
*CommGetInfo
;
66 SMI_HANDLER_PROFILE_PARAMETER_GET_DATA_BY_OFFSET
*CommGetData
;
67 EFI_SMM_COMMUNICATION_PROTOCOL
*SmmCommunication
;
68 UINTN MinimalSizeNeeded
;
69 EDKII_PI_SMM_COMMUNICATION_REGION_TABLE
*PiSmmCommunicationRegionTable
;
71 EFI_MEMORY_DESCRIPTOR
*Entry
;
76 Status
= gBS
->LocateProtocol (&gEfiSmmCommunicationProtocolGuid
, NULL
, (VOID
**)&SmmCommunication
);
77 if (EFI_ERROR (Status
)) {
78 Print (L
"SmiHandlerProfile: Locate SmmCommunication protocol - %r\n", Status
);
82 MinimalSizeNeeded
= EFI_PAGE_SIZE
;
84 Status
= EfiGetSystemConfigurationTable (
85 &gEdkiiPiSmmCommunicationRegionTableGuid
,
86 (VOID
**)&PiSmmCommunicationRegionTable
88 if (EFI_ERROR (Status
)) {
89 Print (L
"SmiHandlerProfile: Get PiSmmCommunicationRegionTable - %r\n", Status
);
93 ASSERT (PiSmmCommunicationRegionTable
!= NULL
);
94 Entry
= (EFI_MEMORY_DESCRIPTOR
*)(PiSmmCommunicationRegionTable
+ 1);
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
) {
104 Entry
= (EFI_MEMORY_DESCRIPTOR
*)((UINT8
*)Entry
+ PiSmmCommunicationRegionTable
->DescriptorSize
);
107 ASSERT (Index
< PiSmmCommunicationRegionTable
->NumberOfEntries
);
108 CommBuffer
= (UINT8
*)(UINTN
)Entry
->PhysicalStart
;
113 CommHeader
= (EFI_SMM_COMMUNICATE_HEADER
*)&CommBuffer
[0];
114 CopyMem (&CommHeader
->HeaderGuid
, &gSmiHandlerProfileGuid
, sizeof (gSmiHandlerProfileGuid
));
115 CommHeader
->MessageLength
= sizeof (SMI_HANDLER_PROFILE_PARAMETER_GET_INFO
);
117 CommGetInfo
= (SMI_HANDLER_PROFILE_PARAMETER_GET_INFO
*)&CommBuffer
[OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER
, Data
)];
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;
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
);
130 if (CommGetInfo
->Header
.ReturnStatus
!= 0) {
131 Print (L
"SmiHandlerProfile: GetInfo - 0x%0x\n", CommGetInfo
->Header
.ReturnStatus
);
135 mSmiHandlerProfileDatabaseSize
= (UINTN
)CommGetInfo
->DataSize
;
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
);
147 CommHeader
= (EFI_SMM_COMMUNICATE_HEADER
*)&CommBuffer
[0];
148 CopyMem (&CommHeader
->HeaderGuid
, &gSmiHandlerProfileGuid
, sizeof (gSmiHandlerProfileGuid
));
149 CommHeader
->MessageLength
= sizeof (SMI_HANDLER_PROFILE_PARAMETER_GET_DATA_BY_OFFSET
);
151 CommGetData
= (SMI_HANDLER_PROFILE_PARAMETER_GET_DATA_BY_OFFSET
*)&CommBuffer
[OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER
, Data
)];
152 CommGetData
->Header
.Command
= SMI_HANDLER_PROFILE_COMMAND_GET_DATA_BY_OFFSET
;
153 CommGetData
->Header
.DataLength
= sizeof (*CommGetData
);
154 CommGetData
->Header
.ReturnStatus
= (UINT64
)-1;
156 CommSize
= sizeof (EFI_GUID
) + sizeof (UINTN
) + CommHeader
->MessageLength
;
157 Buffer
= (UINT8
*)CommHeader
+ CommSize
;
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
;
167 CommGetData
->DataSize
= (UINT64
)(mSmiHandlerProfileDatabaseSize
- CommGetData
->DataOffset
);
170 Status
= SmmCommunication
->Communicate (SmmCommunication
, CommBuffer
, &CommSize
);
171 ASSERT_EFI_ERROR (Status
);
173 if (CommGetData
->Header
.ReturnStatus
!= 0) {
174 FreePool (mSmiHandlerProfileDatabase
);
175 mSmiHandlerProfileDatabase
= NULL
;
176 Print (L
"SmiHandlerProfile: GetData - 0x%x\n", CommGetData
->Header
.ReturnStatus
);
180 CopyMem ((UINT8
*)mSmiHandlerProfileDatabase
+ Offset
, (VOID
*)(UINTN
)CommGetData
->DataBuffer
, (UINTN
)CommGetData
->DataSize
);
183 DEBUG ((DEBUG_INFO
, "SmiHandlerProfileSize - 0x%x\n", mSmiHandlerProfileDatabaseSize
));
189 Get the file name portion of the Pdb File Name.
191 The portion of the Pdb File Name between the last backslash and
192 either a following period or the end of the string is copied into
193 AsciiBuffer. The name is truncated, if necessary, to ensure that
194 AsciiBuffer is not overrun.
196 @param[in] PdbFileName Pdb file name.
197 @param[out] AsciiBuffer The resultant Ascii File Name.
201 GetShortPdbFileName (
202 IN CHAR8
*PdbFileName
,
203 OUT CHAR8
*AsciiBuffer
206 UINTN IndexPdb
; // Current work location within a Pdb string.
207 UINTN IndexBuffer
; // Current work location within a Buffer string.
211 ZeroMem (AsciiBuffer
, PROFILE_NAME_STRING_LENGTH
+ 1);
213 if (PdbFileName
== NULL
) {
214 AsciiStrnCpyS (AsciiBuffer
, PROFILE_NAME_STRING_LENGTH
+ 1, " ", 1);
217 for (EndIndex
= 0; PdbFileName
[EndIndex
] != 0; EndIndex
++) {
220 for (IndexPdb
= 0; PdbFileName
[IndexPdb
] != 0; IndexPdb
++) {
221 if ((PdbFileName
[IndexPdb
] == '\\') || (PdbFileName
[IndexPdb
] == '/')) {
222 StartIndex
= IndexPdb
+ 1;
225 if (PdbFileName
[IndexPdb
] == '.') {
231 for (IndexPdb
= StartIndex
; IndexPdb
< EndIndex
; IndexPdb
++) {
232 AsciiBuffer
[IndexBuffer
] = PdbFileName
[IndexPdb
];
234 if (IndexBuffer
>= PROFILE_NAME_STRING_LENGTH
) {
235 AsciiBuffer
[PROFILE_NAME_STRING_LENGTH
] = 0;
243 Get a human readable name for an image.
244 The following methods will be tried orderly:
249 @param[in] ImageStruct Point to the image structure.
251 @return The resulting Ascii name string is stored in the mNameString global array.
255 GetDriverNameString (
256 IN SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
263 if (ImageStruct
== NULL
) {
268 // Method 1: Get the name string from image PDB
270 if (ImageStruct
->PdbStringOffset
!= 0) {
271 GetShortPdbFileName ((CHAR8
*)((UINTN
)ImageStruct
+ ImageStruct
->PdbStringOffset
), mNameString
);
275 if (!IsZeroGuid (&ImageStruct
->FileGuid
)) {
277 // Try to get the image's FFS UI section by image GUID
281 Status
= GetSectionFromAnyFv (
282 &ImageStruct
->FileGuid
,
283 EFI_SECTION_USER_INTERFACE
,
285 (VOID
**)&NameString
,
288 if (!EFI_ERROR (Status
)) {
290 // Method 2: Get the name string from FFS UI section
292 if (StrLen (NameString
) > PROFILE_NAME_STRING_LENGTH
) {
293 NameString
[PROFILE_NAME_STRING_LENGTH
] = 0;
296 UnicodeStrToAsciiStrS (NameString
, mNameString
, sizeof (mNameString
));
297 FreePool (NameString
);
303 // Method 3: Get the name string from image GUID
305 AsciiSPrint (mNameString
, sizeof (mNameString
), "%g", &ImageStruct
->FileGuid
);
310 Get image structure from reference index.
312 @param ImageRef the image reference index
314 @return image structure
316 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*
321 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
;
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
) {
331 ImageStruct
= (VOID
*)((UINTN
)ImageStruct
+ ImageStruct
->Header
.Length
);
338 Dump SMM loaded image information.
345 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
;
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
);
359 Print (L
" FvFile=\"%g\"", &ImageStruct
->FileGuid
);
360 Print (L
" RefId=\"0x%x\"", ImageStruct
->ImageRef
);
362 if (ImageStruct
->PdbStringOffset
!= 0) {
363 PdbString
= (CHAR8
*)((UINTN
)ImageStruct
+ ImageStruct
->PdbStringOffset
);
364 Print (L
" <Pdb>%a</Pdb>\n", PdbString
);
367 Print (L
" </Image>\n");
370 ImageStruct
= (VOID
*)((UINTN
)ImageStruct
+ ImageStruct
->Header
.Length
);
376 CHAR8
*mSxTypeString
[] = {
386 Convert SxType to a string.
390 @return SxType string
394 IN EFI_SLEEP_TYPE Type
397 if ((Type
>= 0) && (Type
< ARRAY_SIZE (mSxTypeString
))) {
398 return mSxTypeString
[Type
];
400 AsciiSPrint (mNameString
, sizeof (mNameString
), "0x%x", Type
);
405 CHAR8
*mSxPhaseString
[] = {
411 Convert SxPhase to a string.
415 @return SxPhase string
419 IN EFI_SLEEP_PHASE Phase
422 if ((Phase
>= 0) && (Phase
< ARRAY_SIZE (mSxPhaseString
))) {
423 return mSxPhaseString
[Phase
];
425 AsciiSPrint (mNameString
, sizeof (mNameString
), "0x%x", Phase
);
430 CHAR8
*mPowerButtonPhaseString
[] = {
436 Convert PowerButtonPhase to a string.
438 @param Phase PowerButtonPhase
440 @return PowerButtonPhase string
443 PowerButtonPhaseToString (
444 IN EFI_POWER_BUTTON_PHASE Phase
447 if ((Phase
>= 0) && (Phase
< ARRAY_SIZE (mPowerButtonPhaseString
))) {
448 return mPowerButtonPhaseString
[Phase
];
450 AsciiSPrint (mNameString
, sizeof (mNameString
), "0x%x", Phase
);
455 CHAR8
*mStandbyButtonPhaseString
[] = {
456 "StandbyButtonEntry",
461 Convert StandbyButtonPhase to a string.
463 @param Phase StandbyButtonPhase
465 @return StandbyButtonPhase string
468 StandbyButtonPhaseToString (
469 IN EFI_STANDBY_BUTTON_PHASE Phase
472 if ((Phase
>= 0) && (Phase
< ARRAY_SIZE (mStandbyButtonPhaseString
))) {
473 return mStandbyButtonPhaseString
[Phase
];
475 AsciiSPrint (mNameString
, sizeof (mNameString
), "0x%x", Phase
);
480 CHAR8
*mIoTrapTypeString
[] = {
487 Convert IoTrapType to a string.
489 @param Type IoTrapType
491 @return IoTrapType string
495 IN EFI_SMM_IO_TRAP_DISPATCH_TYPE Type
498 if ((Type
>= 0) && (Type
< ARRAY_SIZE (mIoTrapTypeString
))) {
499 return mIoTrapTypeString
[Type
];
501 AsciiSPrint (mNameString
, sizeof (mNameString
), "0x%x", Type
);
506 CHAR8
*mUsbTypeString
[] = {
512 Convert UsbType to a string.
516 @return UsbType string
520 IN EFI_USB_SMI_TYPE Type
523 if ((Type
>= 0) && (Type
< ARRAY_SIZE (mUsbTypeString
))) {
524 return mUsbTypeString
[Type
];
526 AsciiSPrint (mNameString
, sizeof (mNameString
), "0x%x", Type
);
532 Dump SMI child context.
534 @param HandlerType the handler type
535 @param Context the handler context
536 @param ContextSize the handler context size
539 DumpSmiChildContext (
540 IN EFI_GUID
*HandlerType
,
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
));
567 Str
= ConvertDevicePathToText ((EFI_DEVICE_PATH_PROTOCOL
*)(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT
*)Context
) + 1), TRUE
, TRUE
);
568 Print (L
" UsbDevicePath=\"%s\"", Str
);
573 Print (L
" Context=\"");
574 InternalDumpData (Context
, ContextSize
);
580 Dump SMI handler in HandlerCategory.
582 @param HandlerCategory SMI handler category
586 IN UINT32 HandlerCategory
589 SMM_CORE_SMI_DATABASE_STRUCTURE
*SmiStruct
;
590 SMM_CORE_SMI_HANDLER_STRUCTURE
*SmiHandlerStruct
;
592 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
;
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
);
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
);
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
);
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
));
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
));
631 Print (L
" </Caller>\n", SmiHandlerStruct
->Handler
);
632 SmiHandlerStruct
= (VOID
*)((UINTN
)SmiHandlerStruct
+ SmiHandlerStruct
->Length
);
633 Print (L
" </SmiHandler>\n");
636 Print (L
" </SmiEntry>\n");
639 SmiStruct
= (VOID
*)((UINTN
)SmiStruct
+ SmiStruct
->Header
.Length
);
646 The Entry Point for SMI handler profile info application.
648 @param ImageHandle The firmware allocated handle for the EFI image.
649 @param SystemTable A pointer to the EFI System Table.
651 @retval EFI_SUCCESS The entry point is executed successfully.
652 @retval Other Some error occurred when executing this entry point.
656 SmiHandlerProfileInfoEntrypoint (
657 IN EFI_HANDLE ImageHandle
,
658 IN EFI_SYSTEM_TABLE
*SystemTable
661 GetSmiHandlerProfileDatabase ();
663 if (mSmiHandlerProfileDatabase
== NULL
) {
670 Print (L
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
671 Print (L
"<SmiHandlerProfile>\n");
672 Print (L
"<ImageDatabase>\n");
673 Print (L
" <!-- SMM image loaded -->\n");
674 DumpSmmLoadedImage ();
675 Print (L
"</ImageDatabase>\n\n");
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");
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");
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");
697 Print (L
"</SmiHandlerDatabase>\n");
698 Print (L
"</SmiHandlerProfile>\n");
700 if (mSmiHandlerProfileDatabase
!= NULL
) {
701 FreePool (mSmiHandlerProfileDatabase
);