X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FInclude%2FGuid%2FSmiHandlerProfile.h;h=ba41393cf2e2f5b3593f4e04983bb9ad90149185;hp=b81631dcf4a504003625253e222911c2d9d69174;hb=f248539538efd522a71c1e9bf63c622e02d443f4;hpb=65fb940adb68fdc0108daf33036b5bebe6169f4b diff --git a/MdeModulePkg/Include/Guid/SmiHandlerProfile.h b/MdeModulePkg/Include/Guid/SmiHandlerProfile.h index b81631dcf4..ba41393cf2 100644 --- a/MdeModulePkg/Include/Guid/SmiHandlerProfile.h +++ b/MdeModulePkg/Include/Guid/SmiHandlerProfile.h @@ -25,12 +25,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include -#pragma pack(1) - typedef struct { UINT32 Signature; UINT32 Length; UINT32 Revision; + UINT8 Reserved[4]; } SMM_CORE_DATABASE_COMMON_HEADER; #define SMM_CORE_IMAGE_DATABASE_SIGNATURE SIGNATURE_32 ('S','C','I','D') @@ -39,12 +38,12 @@ typedef struct { typedef struct { SMM_CORE_DATABASE_COMMON_HEADER Header; EFI_GUID FileGuid; - UINTN ImageRef; - UINTN EntryPoint; - UINTN ImageBase; - UINTN ImageSize; + PHYSICAL_ADDRESS EntryPoint; + PHYSICAL_ADDRESS ImageBase; + UINT64 ImageSize; + UINT32 ImageRef; UINT16 PdbStringOffset; - UINT8 Reserved2[6]; + UINT8 Reserved[2]; //CHAR8 PdbString[]; } SMM_CORE_IMAGE_DATABASE_STRUCTURE; @@ -64,7 +63,7 @@ typedef enum { // NULL // Context for SmmCoreSmiHandlerCategoryHardwareHandler: // (NOTE: The context field should NOT include any data pointer.) -// gEfiSmmSwDispatch2ProtocolGuid: EFI_SMM_SW_REGISTER_CONTEXT +// gEfiSmmSwDispatch2ProtocolGuid: (EFI_SMM_SW_REGISTER_CONTEXT => SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT) // gEfiSmmSxDispatch2ProtocolGuid: EFI_SMM_SX_REGISTER_CONTEXT // gEfiSmmPowerButtonDispatch2ProtocolGuid: EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT // gEfiSmmStandbyButtonDispatch2ProtocolGuid: EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT @@ -81,21 +80,25 @@ typedef struct { } SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT; typedef struct { - UINT32 Length; - UINTN CallerAddr; - UINTN Handler; - UINTN ImageRef; - UINT16 ContextBufferOffset; - UINT8 Reserved2[2]; - UINT32 ContextBufferSize; -//UINT8 ContextBuffer[]; + UINT64 SwSmiInputValue; +} SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT; + +typedef struct { + UINT32 Length; + UINT32 ImageRef; + PHYSICAL_ADDRESS CallerAddr; + PHYSICAL_ADDRESS Handler; + UINT16 ContextBufferOffset; + UINT8 Reserved[2]; + UINT32 ContextBufferSize; +//UINT8 ContextBuffer[]; } SMM_CORE_SMI_HANDLER_STRUCTURE; typedef struct { SMM_CORE_DATABASE_COMMON_HEADER Header; - UINT32 HandlerCategory; EFI_GUID HandlerType; - UINTN HandlerCount; + UINT32 HandlerCategory; + UINT32 HandlerCount; //SMM_CORE_SMI_HANDLER_STRUCTURE Handler[HandlerCount]; } SMM_CORE_SMI_DATABASE_STRUCTURE; @@ -144,12 +147,30 @@ typedef struct { #define SMI_HANDLER_PROFILE_GUID {0x49174342, 0x7108, 0x409b, {0x8b, 0xbe, 0x65, 0xfd, 0xa8, 0x53, 0x89, 0xf5}} -#pragma pack() - extern EFI_GUID gSmiHandlerProfileGuid; typedef struct _SMI_HANDLER_PROFILE_PROTOCOL SMI_HANDLER_PROFILE_PROTOCOL; +/** + This function is called by SmmChildDispatcher module to report + a new SMI handler is registered, to SmmCore. + + @param This The protocol instance + @param HandlerGuid The GUID to identify the type of the handler. + For the SmmChildDispatch protocol, the HandlerGuid + must be the GUID of SmmChildDispatch protocol. + @param Handler The SMI handler. + @param CallerAddress The address of the module who registers the SMI handler. + @param Context The context of the SMI handler. + For the SmmChildDispatch protocol, the Context + must match the one defined for SmmChildDispatch protocol. + @param ContextSize The size of the context in bytes. + For the SmmChildDispatch protocol, the Context + must match the one defined for SmmChildDispatch protocol. + + @retval EFI_SUCCESS The information is recorded. + @retval EFI_OUT_OF_RESOURCES There is no enough resource to record the information. +**/ typedef EFI_STATUS (EFIAPI *SMI_HANDLER_PROFILE_REGISTER_HANDLER) ( @@ -161,12 +182,31 @@ EFI_STATUS IN UINTN ContextSize OPTIONAL ); +/** + This function is called by SmmChildDispatcher module to report + an existing SMI handler is unregistered, to SmmCore. + + @param This The protocol instance + @param HandlerGuid The GUID to identify the type of the handler. + For the SmmChildDispatch protocol, the HandlerGuid + must be the GUID of SmmChildDispatch protocol. + @param Handler The SMI handler. + @param Context The context of the SMI handler. + If it is NOT NULL, it will be used to check what is registered. + @param ContextSize The size of the context in bytes. + If Context is NOT NULL, it will be used to check what is registered. + + @retval EFI_SUCCESS The original record is removed. + @retval EFI_NOT_FOUND There is no record for the HandlerGuid and handler. +**/ typedef 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 EFI_SMM_HANDLER_ENTRY_POINT2 Handler, + IN VOID *Context, OPTIONAL + IN UINTN ContextSize OPTIONAL ); struct _SMI_HANDLER_PROFILE_PROTOCOL {