]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/SmiHandlerProfileLib.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Library / SmiHandlerProfileLib.h
1 /** @file
2 Provides services to log the SMI handler registration.
3
4 This API provides services for the SMM Child Dispatch Protocols provider,
5 to register SMI handler information to SmmCore.
6
7 NOTE:
8 There is no need to update the consumers of SMST->SmiHandlerRegister() or
9 the consumers of SMM Child Dispatch Protocols.
10 The SmmCore (who produces SMST) should have ability to register such
11 information directly.
12 The SmmChildDispatcher (who produces SMM Child Dispatch Protocols) should
13 be responsible to call the services to register information to SMM Core.
14
15 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
16 SPDX-License-Identifier: BSD-2-Clause-Patent
17
18 **/
19
20 #ifndef __SMI_HANDLER_PROFILE_LIB_H__
21 #define __SMI_HANDLER_PROFILE_LIB_H__
22
23 #include <PiSmm.h>
24
25 /**
26 This function is called by SmmChildDispatcher module to report
27 a new SMI handler is registered, to SmmCore.
28
29 @param HandlerGuid The GUID to identify the type of the handler.
30 For the SmmChildDispatch protocol, the HandlerGuid
31 must be the GUID of SmmChildDispatch protocol.
32 @param Handler The SMI handler.
33 @param CallerAddress The address of the module who registers the SMI handler.
34 @param Context The context of the SMI handler.
35 For the SmmChildDispatch protocol, the Context
36 must match the one defined for SmmChildDispatch protocol.
37 @param ContextSize The size of the context in bytes.
38 For the SmmChildDispatch protocol, the Context
39 must match the one defined for SmmChildDispatch protocol.
40
41 @retval EFI_SUCCESS The information is recorded.
42 @retval EFI_UNSUPPORTED The feature is unsupported.
43 @retval EFI_OUT_OF_RESOURCES There is no enough resource to record the information.
44 **/
45 EFI_STATUS
46 EFIAPI
47 SmiHandlerProfileRegisterHandler (
48 IN EFI_GUID *HandlerGuid,
49 IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,
50 IN PHYSICAL_ADDRESS CallerAddress,
51 IN VOID *Context, OPTIONAL
52 IN UINTN ContextSize OPTIONAL
53 );
54
55 /**
56 This function is called by SmmChildDispatcher module to report
57 an existing SMI handler is unregistered, to SmmCore.
58
59 @param HandlerGuid The GUID to identify the type of the handler.
60 For the SmmChildDispatch protocol, the HandlerGuid
61 must be the GUID of SmmChildDispatch protocol.
62 @param Handler The SMI handler.
63 @param Context The context of the SMI handler.
64 If it is NOT NULL, it will be used to check what is registered.
65 @param ContextSize The size of the context in bytes.
66 If Context is NOT NULL, it will be used to check what is registered.
67
68 @retval EFI_SUCCESS The original record is removed.
69 @retval EFI_UNSUPPORTED The feature is unsupported.
70 @retval EFI_NOT_FOUND There is no record for the HandlerGuid and handler.
71 **/
72 EFI_STATUS
73 EFIAPI
74 SmiHandlerProfileUnregisterHandler (
75 IN EFI_GUID *HandlerGuid,
76 IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,
77 IN VOID *Context, OPTIONAL
78 IN UINTN ContextSize OPTIONAL
79 );
80
81 #endif