79964ac8 |
1 | /** @file\r |
2 | This file declares EFI Smm Power Button Smi Child Protocol\r |
3 | \r |
4 | Copyright (c) 2007, 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 |
13 | Module Name: SmmPowerButtonDispatch.h\r |
14 | \r |
15 | @par Revision Reference:\r |
16 | This Protocol is defined in Framework of EFI SMM Core Interface Spec\r |
17 | Version 0.9.\r |
18 | \r |
19 | **/\r |
20 | \r |
21 | #ifndef _EFI_SMM_POWER_BUTTON_DISPATCH_H_\r |
22 | #define _EFI_SMM_POWER_BUTTON_DISPATCH_H_\r |
23 | \r |
24 | //\r |
25 | // Global ID for the Power Button SMI Protocol\r |
26 | //\r |
27 | #define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \\r |
28 | { \\r |
29 | 0xb709efa0, 0x47a6, 0x4b41, {0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 } \\r |
30 | }\r |
31 | \r |
32 | typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL;\r |
33 | \r |
34 | //\r |
35 | // Related Definitions\r |
36 | //\r |
37 | //\r |
38 | // Power Button. Example, Use for changing LEDs before ACPI OS is on.\r |
39 | // - DXE/BDS Phase\r |
40 | // - OS Install Phase\r |
41 | //\r |
42 | typedef enum {\r |
43 | PowerButtonEntry,\r |
44 | PowerButtonExit\r |
45 | } EFI_POWER_BUTTON_PHASE;\r |
46 | \r |
47 | typedef struct {\r |
48 | EFI_POWER_BUTTON_PHASE Phase;\r |
49 | } EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT;\r |
50 | \r |
51 | //\r |
52 | // Member functions\r |
53 | //\r |
54 | /**\r |
55 | Dispatch function for a Power Button SMI handler.\r |
56 | \r |
57 | @param DispatchHandle Handle of this dispatch function.\r |
58 | @param DispatchContext Pointer to the dispatch function's context.\r |
59 | The DispatchContext fields are filled in\r |
60 | by the dispatching driver prior to\r |
61 | invoking this dispatch function.\r |
62 | \r |
63 | Nothing\r |
64 | \r |
65 | **/\r |
66 | typedef\r |
67 | VOID\r |
68 | (EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH) (\r |
69 | IN EFI_HANDLE DispatchHandle,\r |
70 | IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext\r |
71 | );\r |
72 | \r |
73 | /**\r |
74 | Register a child SMI source dispatch function with a parent SMM driver\r |
75 | \r |
76 | @param This Protocol instance pointer.\r |
77 | @param DispatchFunction Pointer to dispatch function to be invoked for\r |
78 | this SMI source\r |
79 | @param DispatchContext Pointer to the dispatch function's context.\r |
80 | The caller fills this context in before calling\r |
81 | the register function to indicate to the register\r |
82 | function the Power Button SMI phase for which the dispatch\r |
83 | function should be invoked.\r |
84 | @param DispatchHandle Handle of dispatch function, for when interfacing\r |
85 | with the parent Sx state SMM driver.\r |
86 | \r |
87 | @retval EFI_SUCCESS The dispatch function has been successfully\r |
88 | registered and the SMI source has been enabled.\r |
89 | @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r |
90 | @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r |
91 | child.\r |
92 | @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Power Button SMI\r |
93 | phase is not within valid range.\r |
94 | \r |
95 | **/\r |
96 | typedef\r |
97 | EFI_STATUS\r |
98 | (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER) (\r |
99 | IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,\r |
100 | IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction,\r |
101 | IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext,\r |
102 | OUT EFI_HANDLE *DispatchHandle\r |
103 | );\r |
104 | \r |
105 | /**\r |
106 | Unregister a child SMI source dispatch function with a parent SMM driver\r |
107 | \r |
108 | @param This Protocol instance pointer.\r |
109 | @param DispatchHandle Handle of dispatch function to deregister.\r |
110 | \r |
111 | @retval EFI_SUCCESS The dispatch function has been successfully\r |
112 | unregistered and the SMI source has been disabled\r |
113 | if there are no other registered child dispatch\r |
114 | functions for this SMI source.\r |
115 | @retval EFI_INVALID_PARAMETER Handle is invalid.\r |
116 | @retval other TBD\r |
117 | \r |
118 | **/\r |
119 | typedef\r |
120 | EFI_STATUS\r |
121 | (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER) (\r |
122 | IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,\r |
123 | IN EFI_HANDLE DispatchHandle\r |
124 | );\r |
125 | \r |
126 | //\r |
127 | // Interface structure for the SMM Power Button SMI Dispatch Protocol\r |
128 | //\r |
129 | /**\r |
130 | @par Protocol Description:\r |
131 | Provides the parent dispatch service for the SMM power button SMI source generator.\r |
132 | \r |
133 | @param Register\r |
134 | Installs a child service to be dispatched by this protocol.\r |
135 | \r |
136 | @param UnRegister\r |
137 | Removes a child service dispatched by this protocol.\r |
138 | \r |
139 | **/\r |
140 | struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {\r |
141 | EFI_SMM_POWER_BUTTON_REGISTER Register;\r |
142 | EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;\r |
143 | };\r |
144 | \r |
145 | extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;\r |
146 | \r |
147 | #endif\r |