]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/SmmSxDispatch.h
IntelFrameworkPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmSxDispatch.h
CommitLineData
79964ac8 1/** @file\r
8411f1c0 2 Provides the parent dispatch service for a given Sx-state source generator.\r
79964ac8 3\r
1c2f052d 4Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
22a69a5e 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
79964ac8 6\r
79964ac8 7 @par Revision Reference:\r
8 This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
9 Version 0.9.\r
10\r
11**/\r
12\r
13#ifndef _EFI_SMM_SX_DISPATCH_H_\r
14#define _EFI_SMM_SX_DISPATCH_H_\r
15\r
a2bb197e 16//\r
17// Share some common definitions with PI SMM\r
18//\r
19#include <Protocol/SmmSxDispatch2.h>\r
b80fbe85 20\r
79964ac8 21//\r
22// Global ID for the Sx SMI Protocol\r
23//\r
24#define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \\r
25 { \\r
26 0x14fc52be, 0x1dc, 0x426c, {0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8 } \\r
27 }\r
28\r
29typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH_PROTOCOL;\r
79964ac8 30\r
31typedef struct {\r
32 EFI_SLEEP_TYPE Type;\r
33 EFI_SLEEP_PHASE Phase;\r
34} EFI_SMM_SX_DISPATCH_CONTEXT;\r
35\r
36//\r
37// Member functions\r
38//\r
39/**\r
40 Dispatch function for a Sx state SMI handler.\r
41\r
f22f941e 42 @param DispatchHandle The handle of this dispatch function.\r
43 @param DispatchContext The pointer to the dispatch function's context.\r
79964ac8 44 The Type and Phase fields are filled in by the Sx dispatch driver\r
45 prior to invoking this dispatch function. For this interface,\r
46 the Sx driver will call the dispatch function for all Sx type\r
47 and phases, so the Sx state handler(s) must check the Type and\r
f22f941e 48 Phase field of EFI_SMM_SX_DISPATCH_CONTEXT, and act accordingly.\r
79964ac8 49\r
700a7869 50 @return None\r
79964ac8 51\r
52**/\r
53typedef\r
54VOID\r
69686d56 55(EFIAPI *EFI_SMM_SX_DISPATCH)(\r
79964ac8 56 IN EFI_HANDLE DispatchHandle,\r
57 IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext\r
58 );\r
59\r
60/**\r
f22f941e 61 Register a child SMI source dispatch function with a parent SMM driver.\r
79964ac8 62\r
f22f941e 63 @param This The pointer to the EFI_SMM_SX_DISPATCH_PROTOCOL instance.\r
64 @param DispatchFunction The function to install.\r
65 @param DispatchContext The pointer to the dispatch function's context.\r
5259c97d 66 The caller fills in this context before calling\r
67 the register function to indicates to the register\r
79964ac8 68 function which Sx state type and phase the caller\r
5259c97d 69 wishes to be called back on. For this interface,\r
79964ac8 70 the Sx driver will call the registered handlers for\r
71 all Sx type and phases, so the Sx state handler(s)\r
72 must check the Type and Phase field of the Dispatch\r
f22f941e 73 context, and act accordingly.\r
74 @param DispatchHandle The handle of dispatch function, for interfacing\r
79964ac8 75 with the parent Sx state SMM driver.\r
76\r
77 @retval EFI_SUCCESS The dispatch function has been successfully\r
78 registered and the SMI source has been enabled.\r
79 @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that\r
80 Sx Type/Phase.\r
81 @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.\r
82 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
83 child.\r
84 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. Type & Phase are not\r
f22f941e 85 within a valid range.\r
79964ac8 86\r
87**/\r
88typedef\r
89EFI_STATUS\r
69686d56 90(EFIAPI *EFI_SMM_SX_REGISTER)(\r
700a7869 91 IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r
92 IN EFI_SMM_SX_DISPATCH DispatchFunction,\r
93 IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext,\r
94 OUT EFI_HANDLE *DispatchHandle\r
79964ac8 95 );\r
96\r
97/**\r
700a7869 98 Unregisters an Sx-state service\r
79964ac8 99\r
f22f941e 100 @param This The pointer to the EFI_SMM_SX_DISPATCH_PROTOCOL instance.\r
101 @param DispatchHandle The handle of the service to remove.\r
79964ac8 102\r
f22f941e 103 @retval EFI_SUCCESS The dispatch function has been successfully unregistered, and the\r
104 SMI source has been disabled, if there are no other registered child\r
79964ac8 105 dispatch functions for this SMI source.\r
106 @retval EFI_INVALID_PARAMETER Handle is invalid.\r
79964ac8 107\r
108**/\r
109typedef\r
110EFI_STATUS\r
5593fdd8 111(EFIAPI *EFI_SMM_SX_UNREGISTER)(\r
700a7869 112 IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r
113 IN EFI_HANDLE DispatchHandle\r
79964ac8 114 );\r
115\r
116//\r
117// Interface structure for the SMM Child Dispatch Protocol\r
118//\r
119/**\r
79964ac8 120 Provides the parent dispatch service for a given Sx-state source generator.\r
79964ac8 121**/\r
122struct _EFI_SMM_SX_DISPATCH_PROTOCOL {\r
2bbaeb0d 123 EFI_SMM_SX_REGISTER Register; ///< Installs a child service to be dispatched by this protocol.\r
124 EFI_SMM_SX_UNREGISTER UnRegister; ///< Removes a child service dispatched by this protocol.\r
79964ac8 125};\r
126\r
127extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;\r
128\r
129#endif\r