79964ac8 |
1 | /** @file\r |
8411f1c0 |
2 | Provides the parent dispatch service for the standby button SMI source generator.\r |
79964ac8 |
3 | \r |
79a0adf3 |
4 | The SMM Standby Button Dispatch Protocol is defined in \r |
5 | the Intel Platform Innovation Framework for EFI SMM Core Interface Specification\r |
6 | (SMM CIS) Version 0.9.\r |
7 | \r |
c3b35b60 |
8 | Copyright (c) 2007, 2009 Intel Corporation\r |
79964ac8 |
9 | All rights reserved. This program and the accompanying materials\r |
10 | are licensed and made available under the terms and conditions of the BSD License\r |
11 | which accompanies this distribution. The full text of the license may be found at\r |
12 | http://opensource.org/licenses/bsd-license.php\r |
13 | \r |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
15 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r |
16 | \r |
c3b35b60 |
17 | @par Revision Reference:\r |
18 | This Protocol is defined in Framework of EFI SMM Core Interface Spec\r |
19 | Version 0.9.\r |
20 | \r |
79964ac8 |
21 | **/\r |
22 | \r |
23 | #ifndef _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_\r |
24 | #define _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_\r |
25 | \r |
a2bb197e |
26 | //\r |
27 | // Share some common definitions with PI SMM\r |
28 | //\r |
29 | #include <Protocol/SmmStandbyButtonDispatch2.h>\r |
30 | \r |
79964ac8 |
31 | //\r |
32 | // Global ID for the Standby Button SMI Protocol\r |
33 | //\r |
34 | #define EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \\r |
35 | { \\r |
36 | 0x78965b98, 0xb0bf, 0x449e, {0x8b, 0x22, 0xd2, 0x91, 0x4e, 0x49, 0x8a, 0x98 } \\r |
37 | }\r |
38 | \r |
39 | typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL;\r |
40 | \r |
41 | //\r |
42 | // Related Definitions\r |
43 | //\r |
79a0adf3 |
44 | \r |
79964ac8 |
45 | typedef struct {\r |
c3b35b60 |
46 | /// Describes whether the child handler should be invoked upon the entry to the button\r |
47 | /// activation or upon exit (i.e., upon receipt of the button press event or upon release of\r |
48 | /// the event).\r |
79964ac8 |
49 | EFI_STANDBY_BUTTON_PHASE Phase;\r |
50 | } EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT;\r |
51 | \r |
52 | //\r |
53 | // Member functions\r |
54 | //\r |
79a0adf3 |
55 | \r |
79964ac8 |
56 | /**\r |
57 | Dispatch function for a Standby Button SMI handler.\r |
58 | \r |
59 | @param DispatchHandle Handle of this dispatch function.\r |
60 | @param DispatchContext Pointer to the dispatch function's context.\r |
61 | The DispatchContext fields are filled in\r |
62 | by the dispatching driver prior to\r |
63 | invoking this dispatch function.\r |
64 | \r |
79964ac8 |
65 | **/\r |
66 | typedef\r |
67 | VOID\r |
69686d56 |
68 | (EFIAPI *EFI_SMM_STANDBY_BUTTON_DISPATCH)(\r |
79964ac8 |
69 | IN EFI_HANDLE DispatchHandle,\r |
70 | IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext\r |
71 | );\r |
72 | \r |
73 | /**\r |
700a7869 |
74 | Provides the parent dispatch service for a given SMI source generator\r |
79964ac8 |
75 | \r |
700a7869 |
76 | @param This Pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.\r |
77 | @param DispatchFunction Function to install.\r |
79964ac8 |
78 | @param DispatchContext Pointer to the dispatch function's context.\r |
5259c97d |
79 | Indicates to the register\r |
80 | function the Standby Button SMI phase for which to invoke the dispatch\r |
81 | function.\r |
700a7869 |
82 | @param DispatchHandle Handle generated by the dispatcher to track the function instance.\r |
79964ac8 |
83 | \r |
84 | @retval EFI_SUCCESS The dispatch function has been successfully\r |
85 | registered and the SMI source has been enabled.\r |
5259c97d |
86 | @retval EFI_DEVICE_ERROR The driver could not enable the SMI source.\r |
79964ac8 |
87 | @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r |
88 | child.\r |
89 | @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Standby Button SMI\r |
90 | phase is not within valid range.\r |
91 | \r |
92 | **/\r |
93 | typedef\r |
94 | EFI_STATUS\r |
69686d56 |
95 | (EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER)(\r |
700a7869 |
96 | IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,\r |
97 | IN EFI_SMM_STANDBY_BUTTON_DISPATCH DispatchFunction,\r |
98 | IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext,\r |
99 | OUT EFI_HANDLE *DispatchHandle\r |
79964ac8 |
100 | );\r |
101 | \r |
102 | /**\r |
103 | Unregister a child SMI source dispatch function with a parent SMM driver\r |
104 | \r |
79a0adf3 |
105 | @param This Pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.\r |
106 | @param DispatchHandle Handle of the service to remove.\r |
79964ac8 |
107 | \r |
79a0adf3 |
108 | @retval EFI_SUCCESS The dispatch function has been successfully\r |
109 | unregistered and the SMI source has been disabled\r |
110 | if there are no other registered child dispatch\r |
111 | functions for this SMI source.\r |
112 | @retval EFI_INVALID_PARAMETER Handle is invalid.\r |
79964ac8 |
113 | \r |
114 | **/\r |
115 | typedef\r |
116 | EFI_STATUS\r |
69686d56 |
117 | (EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER)(\r |
79a0adf3 |
118 | IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,\r |
119 | IN EFI_HANDLE DispatchHandle\r |
79964ac8 |
120 | );\r |
121 | \r |
122 | //\r |
123 | // Interface structure for the SMM Standby Button SMI Dispatch Protocol\r |
124 | //\r |
c3b35b60 |
125 | /**\r |
412fb9ef |
126 | This protocol provices the parent dispatch service for the standby button SMI source generator.\r |
127 | Provides the ability to install child handlers for the given event types.\r |
c3b35b60 |
128 | **/\r |
79964ac8 |
129 | struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL {\r |
412fb9ef |
130 | /// \r |
c3b35b60 |
131 | /// Installs a child service to be dispatched by this protocol.\r |
132 | ///\r |
133 | EFI_SMM_STANDBY_BUTTON_REGISTER Register;\\r |
412fb9ef |
134 | ///\r |
135 | /// Removes a child service dispatched by this protocol.\r |
136 | ///\r |
79964ac8 |
137 | EFI_SMM_STANDBY_BUTTON_UNREGISTER UnRegister;\r |
138 | };\r |
139 | \r |
140 | extern EFI_GUID gEfiSmmStandbyButtonDispatchProtocolGuid;\r |
141 | \r |
142 | #endif\r |