79964ac8 |
1 | /** @file\r |
8411f1c0 |
2 | Provides the parent dispatch service for the power button SMI source generator.\r |
79964ac8 |
3 | \r |
f7590642 |
4 | Copyright (c) 2007 - 2009, Intel Corporation\r |
5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r |
8 | http://opensource.org/licenses/bsd-license.php\r |
9 | \r |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r |
12 | \r |
79964ac8 |
13 | @par Revision Reference:\r |
14 | This Protocol is defined in Framework of EFI SMM Core Interface Spec\r |
15 | Version 0.9.\r |
16 | \r |
17 | **/\r |
18 | \r |
19 | #ifndef _EFI_SMM_POWER_BUTTON_DISPATCH_H_\r |
20 | #define _EFI_SMM_POWER_BUTTON_DISPATCH_H_\r |
21 | \r |
b80fbe85 |
22 | \r |
79964ac8 |
23 | //\r |
24 | // Global ID for the Power Button SMI Protocol\r |
25 | //\r |
26 | #define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \\r |
27 | { \\r |
28 | 0xb709efa0, 0x47a6, 0x4b41, {0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 } \\r |
29 | }\r |
30 | \r |
31 | typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL;\r |
32 | \r |
33 | //\r |
34 | // Related Definitions\r |
35 | //\r |
36 | //\r |
37 | // Power Button. Example, Use for changing LEDs before ACPI OS is on.\r |
38 | // - DXE/BDS Phase\r |
39 | // - OS Install Phase\r |
40 | //\r |
41 | typedef enum {\r |
42 | PowerButtonEntry,\r |
43 | PowerButtonExit\r |
44 | } EFI_POWER_BUTTON_PHASE;\r |
45 | \r |
46 | typedef struct {\r |
47 | EFI_POWER_BUTTON_PHASE Phase;\r |
48 | } EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT;\r |
49 | \r |
50 | //\r |
51 | // Member functions\r |
52 | //\r |
53 | /**\r |
54 | Dispatch function for a Power Button SMI handler.\r |
55 | \r |
ac9868ec |
56 | @param[in] DispatchHandle Handle of this dispatch function.\r |
57 | @param[in] DispatchContext Pointer to the dispatch function's context.\r |
58 | The DispatchContext fields are filled in\r |
59 | by the dispatching driver prior to\r |
60 | invoking this dispatch function.\r |
79964ac8 |
61 | \r |
62 | **/\r |
63 | typedef\r |
64 | VOID\r |
69686d56 |
65 | (EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH)(\r |
79964ac8 |
66 | IN EFI_HANDLE DispatchHandle,\r |
67 | IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext\r |
68 | );\r |
69 | \r |
70 | /**\r |
700a7869 |
71 | Provides the parent dispatch service for a given SMI source generator\r |
79964ac8 |
72 | \r |
ac9868ec |
73 | @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.\r |
74 | @param[in] DispatchFunction Function to install.\r |
75 | @param[in] DispatchContext Pointer to the dispatch function's context.\r |
5259c97d |
76 | Indicates to the register\r |
77 | function the Power Button SMI phase for which to invoke the dispatch\r |
78 | function.\r |
ac9868ec |
79 | @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.\r |
80 | \r |
81 | @retval EFI_SUCCESS The dispatch function has been successfully\r |
82 | registered and the SMI source has been enabled.\r |
83 | @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r |
84 | @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r |
85 | child.\r |
86 | @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Power Button SMI\r |
87 | phase is not within valid range.\r |
79964ac8 |
88 | \r |
89 | **/\r |
90 | typedef\r |
91 | EFI_STATUS\r |
69686d56 |
92 | (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER)(\r |
700a7869 |
93 | IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,\r |
94 | IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction,\r |
95 | IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext,\r |
96 | OUT EFI_HANDLE *DispatchHandle\r |
79964ac8 |
97 | );\r |
98 | \r |
99 | /**\r |
700a7869 |
100 | Unregisters a power-button service.\r |
79964ac8 |
101 | \r |
ac9868ec |
102 | @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.\r |
103 | @param[in] DispatchHandle Handle of the service to remove.\r |
79964ac8 |
104 | \r |
ac9868ec |
105 | @retval EFI_SUCCESS The dispatch function has been successfully\r |
106 | unregistered and the SMI source has been\r |
107 | disabled if there are no other registered\r |
108 | child dispatch functions for this SMI\r |
109 | source.\r |
110 | @retval EFI_INVALID_PARAMETER Handle is invalid.\r |
79964ac8 |
111 | \r |
112 | **/\r |
113 | typedef\r |
114 | EFI_STATUS\r |
69686d56 |
115 | (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER)(\r |
700a7869 |
116 | IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,\r |
117 | IN EFI_HANDLE DispatchHandle\r |
79964ac8 |
118 | );\r |
119 | \r |
79964ac8 |
120 | /**\r |
121 | @par Protocol Description:\r |
122 | Provides the parent dispatch service for the SMM power button SMI source generator.\r |
123 | \r |
79964ac8 |
124 | **/\r |
125 | struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {\r |
ac9868ec |
126 | ///\r |
127 | /// Installs a child service to be dispatched by this protocol.\r |
128 | ///\r |
79964ac8 |
129 | EFI_SMM_POWER_BUTTON_REGISTER Register;\r |
ac9868ec |
130 | \r |
131 | ///\r |
132 | /// Removes a child service dispatched by this protocol.\r |
133 | ///\r |
79964ac8 |
134 | EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;\r |
135 | };\r |
136 | \r |
137 | extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;\r |
138 | \r |
139 | #endif\r |