TianoCore EDK2 master
Loading...
Searching...
No Matches
SmiHandlerProfile.h
Go to the documentation of this file.
1
9#ifndef _SMI_HANDLER_PROFILE_H_
10#define _SMI_HANDLER_PROFILE_H_
11
12#include <PiSmm.h>
21
22typedef struct {
23 UINT32 Signature;
24 UINT32 Length;
25 UINT32 Revision;
26 UINT8 Reserved[4];
28
29#define SMM_CORE_IMAGE_DATABASE_SIGNATURE SIGNATURE_32 ('S','C','I','D')
30#define SMM_CORE_IMAGE_DATABASE_REVISION 0x0001
31
32typedef struct {
34 EFI_GUID FileGuid;
35 PHYSICAL_ADDRESS EntryPoint;
36 PHYSICAL_ADDRESS ImageBase;
37 UINT64 ImageSize;
38 UINT32 ImageRef;
39 UINT16 PdbStringOffset;
40 UINT8 Reserved[2];
41 // CHAR8 PdbString[];
43
44#define SMM_CORE_SMI_DATABASE_SIGNATURE SIGNATURE_32 ('S','C','S','D')
45#define SMM_CORE_SMI_DATABASE_REVISION 0x0001
46
47typedef enum {
48 SmmCoreSmiHandlerCategoryRootHandler,
49 SmmCoreSmiHandlerCategoryGuidHandler,
50 SmmCoreSmiHandlerCategoryHardwareHandler,
51} SMM_CORE_SMI_HANDLER_CATEGORY;
52
53//
54// Context for SmmCoreSmiHandlerCategoryRootHandler:
55// NULL
56// Context for SmmCoreSmiHandlerCategoryGuidHandler:
57// NULL
58// Context for SmmCoreSmiHandlerCategoryHardwareHandler:
59// (NOTE: The context field should NOT include any data pointer.)
60// gEfiSmmSwDispatch2ProtocolGuid: (EFI_SMM_SW_REGISTER_CONTEXT => SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT)
61// gEfiSmmSxDispatch2ProtocolGuid: EFI_SMM_SX_REGISTER_CONTEXT
62// gEfiSmmPowerButtonDispatch2ProtocolGuid: EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT
63// gEfiSmmStandbyButtonDispatch2ProtocolGuid: EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT
64// gEfiSmmPeriodicTimerDispatch2ProtocolGuid: EFI_SMM_PERIODIC_TIMER_CONTEXT
65// gEfiSmmGpiDispatch2ProtocolGuid: EFI_SMM_GPI_REGISTER_CONTEXT
66// gEfiSmmIoTrapDispatch2ProtocolGuid: EFI_SMM_IO_TRAP_REGISTER_CONTEXT
67// gEfiSmmUsbDispatch2ProtocolGuid: (EFI_SMM_USB_REGISTER_CONTEXT => SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT)
68// Other: GUID specific
69
70typedef struct {
72 UINT32 DevicePathSize;
73 // UINT8 DevicePath[DevicePathSize];
75
76typedef struct {
77 UINT64 SwSmiInputValue;
79
80typedef struct {
81 UINT32 Length;
82 UINT32 ImageRef;
83 PHYSICAL_ADDRESS CallerAddr;
84 PHYSICAL_ADDRESS Handler;
85 UINT16 ContextBufferOffset;
86 UINT8 Reserved[2];
87 UINT32 ContextBufferSize;
88 // UINT8 ContextBuffer[];
90
91typedef struct {
93 EFI_GUID HandlerType;
94 UINT32 HandlerCategory;
95 UINT32 HandlerCount;
96 // SMM_CORE_SMI_HANDLER_STRUCTURE Handler[HandlerCount];
98
99//
100// Layout:
101// +-------------------------------------+
102// | SMM_CORE_IMAGE_DATABASE_STRUCTURE |
103// +-------------------------------------+
104// | SMM_CORE_SMI_DATABASE_STRUCTURE |
105// +-------------------------------------+
106//
107
108//
109// SMM_CORE dump command
110//
111#define SMI_HANDLER_PROFILE_COMMAND_GET_INFO 0x1
112#define SMI_HANDLER_PROFILE_COMMAND_GET_DATA_BY_OFFSET 0x2
113
114typedef struct {
115 UINT32 Command;
116 UINT32 DataLength;
117 UINT64 ReturnStatus;
119
120typedef struct {
122 UINT64 DataSize;
124
125typedef struct {
127 //
128 // On input, data buffer size.
129 // On output, actual data buffer size copied.
130 //
131 UINT64 DataSize;
132 PHYSICAL_ADDRESS DataBuffer;
133 //
134 // On input, data buffer offset to copy.
135 // On output, next time data buffer offset to copy.
136 //
137 UINT64 DataOffset;
139
140#define SMI_HANDLER_PROFILE_GUID {0x49174342, 0x7108, 0x409b, {0x8b, 0xbe, 0x65, 0xfd, 0xa8, 0x53, 0x89, 0xf5}}
141
142extern EFI_GUID gSmiHandlerProfileGuid;
143
145
166typedef
170 IN EFI_GUID *HandlerGuid,
171 IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,
172 IN PHYSICAL_ADDRESS CallerAddress,
173 IN VOID *Context OPTIONAL,
174 IN UINTN ContextSize OPTIONAL
175 );
176
194typedef
198 IN EFI_GUID *HandlerGuid,
199 IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,
200 IN VOID *Context OPTIONAL,
201 IN UINTN ContextSize OPTIONAL
202 );
203
207};
208
209#endif
UINT64 UINTN
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
EFI_USB_MMI_TYPE
Definition: MmUsbDispatch.h:28
EFI_STATUS(EFIAPI * SMI_HANDLER_PROFILE_REGISTER_HANDLER)(IN SMI_HANDLER_PROFILE_PROTOCOL *This, IN EFI_GUID *HandlerGuid, IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler, IN PHYSICAL_ADDRESS CallerAddress, IN VOID *Context OPTIONAL, IN UINTN ContextSize OPTIONAL)
EFI_STATUS(EFIAPI * SMI_HANDLER_PROFILE_UNREGISTER_HANDLER)(IN SMI_HANDLER_PROFILE_PROTOCOL *This, IN EFI_GUID *HandlerGuid, IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler, IN VOID *Context OPTIONAL, IN UINTN ContextSize OPTIONAL)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213