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
44 for (Index
= 0; Index
< Size
; Index
++) {
45 Print (L
"%02x", (UINTN
)Data
[Index
]);
46 if ((Index
+ 1) != Size
) {
53 Get SMI handler profile database.
56 GetSmiHandlerProfileDatabase(
63 EFI_SMM_COMMUNICATE_HEADER
*CommHeader
;
64 SMI_HANDLER_PROFILE_PARAMETER_GET_INFO
*CommGetInfo
;
65 SMI_HANDLER_PROFILE_PARAMETER_GET_DATA_BY_OFFSET
*CommGetData
;
66 EFI_SMM_COMMUNICATION_PROTOCOL
*SmmCommunication
;
67 UINTN MinimalSizeNeeded
;
68 EDKII_PI_SMM_COMMUNICATION_REGION_TABLE
*PiSmmCommunicationRegionTable
;
70 EFI_MEMORY_DESCRIPTOR
*Entry
;
75 Status
= gBS
->LocateProtocol(&gEfiSmmCommunicationProtocolGuid
, NULL
, (VOID
**)&SmmCommunication
);
76 if (EFI_ERROR(Status
)) {
77 Print(L
"SmiHandlerProfile: Locate SmmCommunication protocol - %r\n", Status
);
81 MinimalSizeNeeded
= EFI_PAGE_SIZE
;
83 Status
= EfiGetSystemConfigurationTable(
84 &gEdkiiPiSmmCommunicationRegionTableGuid
,
85 (VOID
**)&PiSmmCommunicationRegionTable
87 if (EFI_ERROR(Status
)) {
88 Print(L
"SmiHandlerProfile: Get PiSmmCommunicationRegionTable - %r\n", Status
);
91 ASSERT(PiSmmCommunicationRegionTable
!= NULL
);
92 Entry
= (EFI_MEMORY_DESCRIPTOR
*)(PiSmmCommunicationRegionTable
+ 1);
94 for (Index
= 0; Index
< PiSmmCommunicationRegionTable
->NumberOfEntries
; Index
++) {
95 if (Entry
->Type
== EfiConventionalMemory
) {
96 Size
= EFI_PAGES_TO_SIZE((UINTN
)Entry
->NumberOfPages
);
97 if (Size
>= MinimalSizeNeeded
) {
101 Entry
= (EFI_MEMORY_DESCRIPTOR
*)((UINT8
*)Entry
+ PiSmmCommunicationRegionTable
->DescriptorSize
);
103 ASSERT(Index
< PiSmmCommunicationRegionTable
->NumberOfEntries
);
104 CommBuffer
= (UINT8
*)(UINTN
)Entry
->PhysicalStart
;
109 CommHeader
= (EFI_SMM_COMMUNICATE_HEADER
*)&CommBuffer
[0];
110 CopyMem(&CommHeader
->HeaderGuid
, &gSmiHandlerProfileGuid
, sizeof(gSmiHandlerProfileGuid
));
111 CommHeader
->MessageLength
= sizeof(SMI_HANDLER_PROFILE_PARAMETER_GET_INFO
);
113 CommGetInfo
= (SMI_HANDLER_PROFILE_PARAMETER_GET_INFO
*)&CommBuffer
[OFFSET_OF(EFI_SMM_COMMUNICATE_HEADER
, Data
)];
114 CommGetInfo
->Header
.Command
= SMI_HANDLER_PROFILE_COMMAND_GET_INFO
;
115 CommGetInfo
->Header
.DataLength
= sizeof(*CommGetInfo
);
116 CommGetInfo
->Header
.ReturnStatus
= (UINT64
)-1;
117 CommGetInfo
->DataSize
= 0;
119 CommSize
= sizeof(EFI_GUID
) + sizeof(UINTN
) + CommHeader
->MessageLength
;
120 Status
= SmmCommunication
->Communicate(SmmCommunication
, CommBuffer
, &CommSize
);
121 if (EFI_ERROR(Status
)) {
122 Print(L
"SmiHandlerProfile: SmmCommunication - %r\n", Status
);
126 if (CommGetInfo
->Header
.ReturnStatus
!= 0) {
127 Print(L
"SmiHandlerProfile: GetInfo - 0x%0x\n", CommGetInfo
->Header
.ReturnStatus
);
131 mSmiHandlerProfileDatabaseSize
= (UINTN
)CommGetInfo
->DataSize
;
136 mSmiHandlerProfileDatabase
= AllocateZeroPool(mSmiHandlerProfileDatabaseSize
);
137 if (mSmiHandlerProfileDatabase
== NULL
) {
138 Status
= EFI_OUT_OF_RESOURCES
;
139 Print(L
"SmiHandlerProfile: AllocateZeroPool (0x%x) for dump buffer - %r\n", mSmiHandlerProfileDatabaseSize
, Status
);
143 CommHeader
= (EFI_SMM_COMMUNICATE_HEADER
*)&CommBuffer
[0];
144 CopyMem(&CommHeader
->HeaderGuid
, &gSmiHandlerProfileGuid
, sizeof(gSmiHandlerProfileGuid
));
145 CommHeader
->MessageLength
= sizeof(SMI_HANDLER_PROFILE_PARAMETER_GET_DATA_BY_OFFSET
);
147 CommGetData
= (SMI_HANDLER_PROFILE_PARAMETER_GET_DATA_BY_OFFSET
*)&CommBuffer
[OFFSET_OF(EFI_SMM_COMMUNICATE_HEADER
, Data
)];
148 CommGetData
->Header
.Command
= SMI_HANDLER_PROFILE_COMMAND_GET_DATA_BY_OFFSET
;
149 CommGetData
->Header
.DataLength
= sizeof(*CommGetData
);
150 CommGetData
->Header
.ReturnStatus
= (UINT64
)-1;
152 CommSize
= sizeof(EFI_GUID
) + sizeof(UINTN
) + CommHeader
->MessageLength
;
153 Buffer
= (UINT8
*)CommHeader
+ CommSize
;
156 CommGetData
->DataBuffer
= (PHYSICAL_ADDRESS
)(UINTN
)Buffer
;
157 CommGetData
->DataOffset
= 0;
158 while (CommGetData
->DataOffset
< mSmiHandlerProfileDatabaseSize
) {
159 Offset
= (UINTN
)CommGetData
->DataOffset
;
160 if (Size
<= (mSmiHandlerProfileDatabaseSize
- CommGetData
->DataOffset
)) {
161 CommGetData
->DataSize
= (UINT64
)Size
;
163 CommGetData
->DataSize
= (UINT64
)(mSmiHandlerProfileDatabaseSize
- CommGetData
->DataOffset
);
165 Status
= SmmCommunication
->Communicate(SmmCommunication
, CommBuffer
, &CommSize
);
166 ASSERT_EFI_ERROR(Status
);
168 if (CommGetData
->Header
.ReturnStatus
!= 0) {
169 FreePool(mSmiHandlerProfileDatabase
);
170 mSmiHandlerProfileDatabase
= NULL
;
171 Print(L
"SmiHandlerProfile: GetData - 0x%x\n", CommGetData
->Header
.ReturnStatus
);
174 CopyMem((UINT8
*)mSmiHandlerProfileDatabase
+ Offset
, (VOID
*)(UINTN
)CommGetData
->DataBuffer
, (UINTN
)CommGetData
->DataSize
);
177 DEBUG ((DEBUG_INFO
, "SmiHandlerProfileSize - 0x%x\n", mSmiHandlerProfileDatabaseSize
));
183 Get the file name portion of the Pdb File Name.
185 The portion of the Pdb File Name between the last backslash and
186 either a following period or the end of the string is copied into
187 AsciiBuffer. The name is truncated, if necessary, to ensure that
188 AsciiBuffer is not overrun.
190 @param[in] PdbFileName Pdb file name.
191 @param[out] AsciiBuffer The resultant Ascii File Name.
195 GetShortPdbFileName (
196 IN CHAR8
*PdbFileName
,
197 OUT CHAR8
*AsciiBuffer
200 UINTN IndexPdb
; // Current work location within a Pdb string.
201 UINTN IndexBuffer
; // Current work location within a Buffer string.
205 ZeroMem (AsciiBuffer
, PROFILE_NAME_STRING_LENGTH
+ 1);
207 if (PdbFileName
== NULL
) {
208 AsciiStrnCpyS (AsciiBuffer
, PROFILE_NAME_STRING_LENGTH
+ 1, " ", 1);
211 for (EndIndex
= 0; PdbFileName
[EndIndex
] != 0; EndIndex
++);
212 for (IndexPdb
= 0; PdbFileName
[IndexPdb
] != 0; IndexPdb
++) {
213 if ((PdbFileName
[IndexPdb
] == '\\') || (PdbFileName
[IndexPdb
] == '/')) {
214 StartIndex
= IndexPdb
+ 1;
217 if (PdbFileName
[IndexPdb
] == '.') {
223 for (IndexPdb
= StartIndex
; IndexPdb
< EndIndex
; IndexPdb
++) {
224 AsciiBuffer
[IndexBuffer
] = PdbFileName
[IndexPdb
];
226 if (IndexBuffer
>= PROFILE_NAME_STRING_LENGTH
) {
227 AsciiBuffer
[PROFILE_NAME_STRING_LENGTH
] = 0;
235 Get a human readable name for an image.
236 The following methods will be tried orderly:
241 @param[in] ImageStruct Point to the image structure.
243 @return The resulting Ascii name string is stored in the mNameString global array.
247 GetDriverNameString (
248 IN SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
255 if (ImageStruct
== NULL
) {
260 // Method 1: Get the name string from image PDB
262 if (ImageStruct
->PdbStringOffset
!= 0) {
263 GetShortPdbFileName ((CHAR8
*) ((UINTN
) ImageStruct
+ ImageStruct
->PdbStringOffset
), mNameString
);
267 if (!IsZeroGuid (&ImageStruct
->FileGuid
)) {
269 // Try to get the image's FFS UI section by image GUID
273 Status
= GetSectionFromAnyFv (
274 &ImageStruct
->FileGuid
,
275 EFI_SECTION_USER_INTERFACE
,
277 (VOID
**) &NameString
,
280 if (!EFI_ERROR (Status
)) {
282 // Method 2: Get the name string from FFS UI section
284 if (StrLen (NameString
) > PROFILE_NAME_STRING_LENGTH
) {
285 NameString
[PROFILE_NAME_STRING_LENGTH
] = 0;
287 UnicodeStrToAsciiStrS (NameString
, mNameString
, sizeof (mNameString
));
288 FreePool (NameString
);
294 // Method 3: Get the name string from image GUID
296 AsciiSPrint (mNameString
, sizeof (mNameString
), "%g", &ImageStruct
->FileGuid
);
301 Get image structure from reference index.
303 @param ImageRef the image reference index
305 @return image structure
307 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*
312 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
;
314 ImageStruct
= (VOID
*)mSmiHandlerProfileDatabase
;
315 while ((UINTN
)ImageStruct
< (UINTN
)mSmiHandlerProfileDatabase
+ mSmiHandlerProfileDatabaseSize
) {
316 if (ImageStruct
->Header
.Signature
== SMM_CORE_IMAGE_DATABASE_SIGNATURE
) {
317 if (ImageStruct
->ImageRef
== ImageRef
) {
321 ImageStruct
= (VOID
*)((UINTN
)ImageStruct
+ ImageStruct
->Header
.Length
);
328 Dump SMM loaded image information.
335 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
;
339 ImageStruct
= (VOID
*)mSmiHandlerProfileDatabase
;
340 while ((UINTN
)ImageStruct
< (UINTN
)mSmiHandlerProfileDatabase
+ mSmiHandlerProfileDatabaseSize
) {
341 if (ImageStruct
->Header
.Signature
== SMM_CORE_IMAGE_DATABASE_SIGNATURE
) {
342 NameString
= GetDriverNameString (ImageStruct
);
343 Print(L
" <Image Name=\"%a\"", NameString
);
344 Print(L
" Base=\"0x%lx\" Size=\"0x%lx\"", ImageStruct
->ImageBase
, ImageStruct
->ImageSize
);
345 if (ImageStruct
->EntryPoint
!= 0) {
346 Print(L
" EntryPoint=\"0x%lx\"", ImageStruct
->EntryPoint
);
348 Print(L
" FvFile=\"%g\"", &ImageStruct
->FileGuid
);
349 Print(L
" RefId=\"0x%x\"", ImageStruct
->ImageRef
);
351 if (ImageStruct
->PdbStringOffset
!= 0) {
352 PdbString
= (CHAR8
*)((UINTN
)ImageStruct
+ ImageStruct
->PdbStringOffset
);
353 Print(L
" <Pdb>%a</Pdb>\n", PdbString
);
355 Print(L
" </Image>\n");
358 ImageStruct
= (VOID
*)((UINTN
)ImageStruct
+ ImageStruct
->Header
.Length
);
364 CHAR8
*mSxTypeString
[] = {
374 Convert SxType to a string.
378 @return SxType string
382 IN EFI_SLEEP_TYPE Type
385 if (Type
>= 0 && Type
<= ARRAY_SIZE(mSxTypeString
)) {
386 return mSxTypeString
[Type
];
388 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Type
);
393 CHAR8
*mSxPhaseString
[] = {
399 Convert SxPhase to a string.
403 @return SxPhase string
407 IN EFI_SLEEP_PHASE Phase
410 if (Phase
>= 0 && Phase
<= ARRAY_SIZE(mSxPhaseString
)) {
411 return mSxPhaseString
[Phase
];
413 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Phase
);
418 CHAR8
*mPowerButtonPhaseString
[] = {
424 Convert PowerButtonPhase to a string.
426 @param Phase PowerButtonPhase
428 @return PowerButtonPhase string
431 PowerButtonPhaseToString (
432 IN EFI_POWER_BUTTON_PHASE Phase
435 if (Phase
>= 0 && Phase
<= ARRAY_SIZE(mPowerButtonPhaseString
)) {
436 return mPowerButtonPhaseString
[Phase
];
438 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Phase
);
443 CHAR8
*mStandbyButtonPhaseString
[] = {
444 "StandbyButtonEntry",
449 Convert StandbyButtonPhase to a string.
451 @param Phase StandbyButtonPhase
453 @return StandbyButtonPhase string
456 StandbyButtonPhaseToString (
457 IN EFI_STANDBY_BUTTON_PHASE Phase
460 if (Phase
>= 0 && Phase
<= ARRAY_SIZE(mStandbyButtonPhaseString
)) {
461 return mStandbyButtonPhaseString
[Phase
];
463 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Phase
);
468 CHAR8
*mIoTrapTypeString
[] = {
475 Convert IoTrapType to a string.
477 @param Type IoTrapType
479 @return IoTrapType string
483 IN EFI_SMM_IO_TRAP_DISPATCH_TYPE Type
486 if (Type
>= 0 && Type
<= ARRAY_SIZE(mIoTrapTypeString
)) {
487 return mIoTrapTypeString
[Type
];
489 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Type
);
494 CHAR8
*mUsbTypeString
[] = {
500 Convert UsbType to a string.
504 @return UsbType string
508 IN EFI_USB_SMI_TYPE Type
511 if (Type
>= 0 && Type
<= ARRAY_SIZE(mUsbTypeString
)) {
512 return mUsbTypeString
[Type
];
514 AsciiSPrint (mNameString
, sizeof(mNameString
), "0x%x", Type
);
520 Dump SMI child context.
522 @param HandlerType the handler type
523 @param Context the handler context
524 @param ContextSize the handler context size
527 DumpSmiChildContext (
528 IN EFI_GUID
*HandlerType
,
535 if (CompareGuid (HandlerType
, &gEfiSmmSwDispatch2ProtocolGuid
)) {
536 Print(L
" SwSmi=\"0x%lx\"", ((SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT
*)Context
)->SwSmiInputValue
);
537 } else if (CompareGuid (HandlerType
, &gEfiSmmSxDispatch2ProtocolGuid
)) {
538 Print(L
" SxType=\"%a\"", SxTypeToString(((EFI_SMM_SX_REGISTER_CONTEXT
*)Context
)->Type
));
539 Print(L
" SxPhase=\"%a\"", SxPhaseToString(((EFI_SMM_SX_REGISTER_CONTEXT
*)Context
)->Phase
));
540 } else if (CompareGuid (HandlerType
, &gEfiSmmPowerButtonDispatch2ProtocolGuid
)) {
541 Print(L
" PowerButtonPhase=\"%a\"", PowerButtonPhaseToString(((EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT
*)Context
)->Phase
));
542 } else if (CompareGuid (HandlerType
, &gEfiSmmStandbyButtonDispatch2ProtocolGuid
)) {
543 Print(L
" StandbyButtonPhase=\"%a\"", StandbyButtonPhaseToString(((EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT
*)Context
)->Phase
));
544 } else if (CompareGuid (HandlerType
, &gEfiSmmPeriodicTimerDispatch2ProtocolGuid
)) {
545 Print(L
" PeriodicTimerPeriod=\"%ld\"", ((EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT
*)Context
)->Period
);
546 Print(L
" PeriodicTimerSmiTickInterval=\"%ld\"", ((EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT
*)Context
)->SmiTickInterval
);
547 } else if (CompareGuid (HandlerType
, &gEfiSmmGpiDispatch2ProtocolGuid
)) {
548 Print(L
" GpiNum=\"0x%lx\"", ((EFI_SMM_GPI_REGISTER_CONTEXT
*)Context
)->GpiNum
);
549 } else if (CompareGuid (HandlerType
, &gEfiSmmIoTrapDispatch2ProtocolGuid
)) {
550 Print(L
" IoTrapAddress=\"0x%x\"", ((EFI_SMM_IO_TRAP_REGISTER_CONTEXT
*)Context
)->Address
);
551 Print(L
" IoTrapLength=\"0x%x\"", ((EFI_SMM_IO_TRAP_REGISTER_CONTEXT
*)Context
)->Length
);
552 Print(L
" IoTrapType=\"%a\"", IoTrapTypeToString(((EFI_SMM_IO_TRAP_REGISTER_CONTEXT
*)Context
)->Type
));
553 } else if (CompareGuid (HandlerType
, &gEfiSmmUsbDispatch2ProtocolGuid
)) {
554 Print(L
" UsbType=\"0x%x\"", UsbTypeToString(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT
*)Context
)->Type
));
555 Str
= ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL
*)(((SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT
*)Context
) + 1), TRUE
, TRUE
);
556 Print(L
" UsbDevicePath=\"%s\"", Str
);
561 Print(L
" Context=\"");
562 InternalDumpData (Context
, ContextSize
);
568 Dump SMI handler in HandlerCategory.
570 @param HandlerCategory SMI handler category
574 IN UINT32 HandlerCategory
577 SMM_CORE_SMI_DATABASE_STRUCTURE
*SmiStruct
;
578 SMM_CORE_SMI_HANDLER_STRUCTURE
*SmiHandlerStruct
;
580 SMM_CORE_IMAGE_DATABASE_STRUCTURE
*ImageStruct
;
583 SmiStruct
= (VOID
*)mSmiHandlerProfileDatabase
;
584 while ((UINTN
)SmiStruct
< (UINTN
)mSmiHandlerProfileDatabase
+ mSmiHandlerProfileDatabaseSize
) {
585 if ((SmiStruct
->Header
.Signature
== SMM_CORE_SMI_DATABASE_SIGNATURE
) && (SmiStruct
->HandlerCategory
== HandlerCategory
)) {
586 SmiHandlerStruct
= (VOID
*)(SmiStruct
+ 1);
587 Print(L
" <SmiEntry");
588 if (!IsZeroGuid (&SmiStruct
->HandlerType
)) {
589 Print(L
" HandlerType=\"%g\"", &SmiStruct
->HandlerType
);
592 for (Index
= 0; Index
< SmiStruct
->HandlerCount
; Index
++) {
593 Print(L
" <SmiHandler");
594 if (SmiHandlerStruct
->ContextBufferSize
!= 0) {
595 DumpSmiChildContext (&SmiStruct
->HandlerType
, (UINT8
*)SmiHandlerStruct
+ SmiHandlerStruct
->ContextBufferOffset
, SmiHandlerStruct
->ContextBufferSize
);
598 ImageStruct
= GetImageFromRef((UINTN
)SmiHandlerStruct
->ImageRef
);
599 NameString
= GetDriverNameString (ImageStruct
);
600 Print(L
" <Module RefId=\"0x%x\" Name=\"%a\">\n", SmiHandlerStruct
->ImageRef
, NameString
);
601 if ((ImageStruct
!= NULL
) && (ImageStruct
->PdbStringOffset
!= 0)) {
602 Print(L
" <Pdb>%a</Pdb>\n", (UINT8
*)ImageStruct
+ ImageStruct
->PdbStringOffset
);
604 Print(L
" </Module>\n");
605 Print(L
" <Handler Address=\"0x%lx\">\n", SmiHandlerStruct
->Handler
);
606 if (ImageStruct
!= NULL
) {
607 Print(L
" <RVA>0x%x</RVA>\n", (UINTN
) (SmiHandlerStruct
->Handler
- ImageStruct
->ImageBase
));
609 Print(L
" </Handler>\n", SmiHandlerStruct
->Handler
);
610 Print(L
" <Caller Address=\"0x%lx\">\n", SmiHandlerStruct
->CallerAddr
);
611 if (ImageStruct
!= NULL
) {
612 Print(L
" <RVA>0x%x</RVA>\n", (UINTN
) (SmiHandlerStruct
->CallerAddr
- ImageStruct
->ImageBase
));
614 Print(L
" </Caller>\n", SmiHandlerStruct
->Handler
);
615 SmiHandlerStruct
= (VOID
*)((UINTN
)SmiHandlerStruct
+ SmiHandlerStruct
->Length
);
616 Print(L
" </SmiHandler>\n");
618 Print(L
" </SmiEntry>\n");
620 SmiStruct
= (VOID
*)((UINTN
)SmiStruct
+ SmiStruct
->Header
.Length
);
627 The Entry Point for SMI handler profile info application.
629 @param ImageHandle The firmware allocated handle for the EFI image.
630 @param SystemTable A pointer to the EFI System Table.
632 @retval EFI_SUCCESS The entry point is executed successfully.
633 @retval Other Some error occurred when executing this entry point.
637 SmiHandlerProfileInfoEntrypoint (
638 IN EFI_HANDLE ImageHandle
,
639 IN EFI_SYSTEM_TABLE
*SystemTable
642 GetSmiHandlerProfileDatabase();
644 if (mSmiHandlerProfileDatabase
== NULL
) {
651 Print(L
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
652 Print(L
"<SmiHandlerProfile>\n");
653 Print(L
"<ImageDatabase>\n");
654 Print(L
" <!-- SMM image loaded -->\n");
655 DumpSmmLoadedImage();
656 Print(L
"</ImageDatabase>\n\n");
661 Print(L
"<SmiHandlerDatabase>\n");
662 Print(L
" <!-- SMI Handler registered -->\n\n");
663 Print(L
" <SmiHandlerCategory Name=\"RootSmi\">\n");
664 Print(L
" <!-- The root SMI Handler registered by SmmCore -->\n");
665 DumpSmiHandler(SmmCoreSmiHandlerCategoryRootHandler
);
666 Print(L
" </SmiHandlerCategory>\n\n");
668 Print(L
" <SmiHandlerCategory Name=\"GuidSmi\">\n");
669 Print(L
" <!-- The GUID SMI Handler registered by SmmCore -->\n");
670 DumpSmiHandler(SmmCoreSmiHandlerCategoryGuidHandler
);
671 Print(L
" </SmiHandlerCategory>\n\n");
673 Print(L
" <SmiHandlerCategory Name=\"HardwareSmi\">\n");
674 Print(L
" <!-- The hardware SMI Handler registered by SmmChildDispatcher -->\n");
675 DumpSmiHandler(SmmCoreSmiHandlerCategoryHardwareHandler
);
676 Print(L
" </SmiHandlerCategory>\n\n");
678 Print(L
"</SmiHandlerDatabase>\n");
679 Print(L
"</SmiHandlerProfile>\n");
681 if (mSmiHandlerProfileDatabase
!= NULL
) {
682 FreePool(mSmiHandlerProfileDatabase
);