]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
f57387d5 HT |
3 | Copyright (c) 1999 - 2002, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials\r | |
3eb9473e | 5 | are licensed and made available under the terms and conditions of the BSD License\r |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | SmmPowerButtonDispatch.h\r | |
16 | \r | |
17 | Abstract:\r | |
18 | \r | |
19 | EFI Smm Power Button Smi Child Protocol\r | |
20 | \r | |
21 | Revision History\r | |
22 | \r | |
23 | --*/\r | |
24 | \r | |
25 | #ifndef _EFI_SMM_POWER_BUTTON_DISPATCH_H_\r | |
26 | #define _EFI_SMM_POWER_BUTTON_DISPATCH_H_\r | |
27 | \r | |
28 | //\r | |
29 | // Global ID for the Power Button SMI Protocol\r | |
30 | //\r | |
31 | #define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \\r | |
32 | { \\r | |
7ccf38a3 | 33 | 0xb709efa0, 0x47a6, 0x4b41, {0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56} \\r |
3eb9473e | 34 | }\r |
35 | \r | |
36 | EFI_FORWARD_DECLARATION (EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL);\r | |
37 | \r | |
38 | //\r | |
39 | // Related Definitions\r | |
40 | //\r | |
41 | //\r | |
42 | // Power Button. Example, Use for changing LEDs before ACPI OS is on.\r | |
43 | // - DXE/BDS Phase\r | |
44 | // - OS Install Phase\r | |
45 | //\r | |
46 | typedef enum {\r | |
47 | PowerButtonEntry,\r | |
48 | PowerButtonExit\r | |
49 | } EFI_POWER_BUTTON_PHASE;\r | |
50 | \r | |
51 | typedef struct {\r | |
52 | EFI_POWER_BUTTON_PHASE Phase;\r | |
53 | } EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT;\r | |
54 | \r | |
55 | //\r | |
56 | // Member functions\r | |
57 | //\r | |
58 | typedef\r | |
59 | VOID\r | |
60 | (EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH) (\r | |
61 | IN EFI_HANDLE DispatchHandle,\r | |
62 | IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT * DispatchContext\r | |
63 | );\r | |
64 | \r | |
65 | /*++\r | |
66 | \r | |
67 | Routine Description:\r | |
68 | Dispatch function for a Power Button SMI handler.\r | |
69 | \r | |
70 | Arguments:\r | |
71 | DispatchHandle - Handle of this dispatch function.\r | |
72 | DispatchContext - Pointer to the dispatch function's context.\r | |
73 | The DispatchContext fields are filled in\r | |
74 | by the dispatching driver prior to\r | |
75 | invoking this dispatch function.\r | |
76 | \r | |
77 | Returns:\r | |
78 | Nothing\r | |
79 | \r | |
80 | --*/\r | |
81 | typedef\r | |
82 | EFI_STATUS\r | |
83 | (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER) (\r | |
84 | IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL * This,\r | |
85 | IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction,\r | |
86 | IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT * DispatchContext,\r | |
87 | OUT EFI_HANDLE * DispatchHandle\r | |
88 | );\r | |
89 | \r | |
90 | /*++\r | |
91 | \r | |
92 | Routine Description:\r | |
93 | Register a child SMI source dispatch function with a parent SMM driver\r | |
94 | \r | |
95 | Arguments:\r | |
96 | This - Protocol instance pointer.\r | |
97 | DispatchFunction - Pointer to dispatch function to be invoked for\r | |
98 | this SMI source\r | |
99 | DispatchContext - Pointer to the dispatch function's context.\r | |
100 | The caller fills this context in before calling\r | |
101 | the register function to indicate to the register\r | |
102 | function the Power Button SMI phase for which the dispatch\r | |
103 | function should be invoked.\r | |
104 | DispatchHandle - Handle of dispatch function, for when interfacing\r | |
105 | with the parent Sx state SMM driver.\r | |
106 | \r | |
107 | Returns:\r | |
108 | EFI_SUCCESS - The dispatch function has been successfully\r | |
109 | registered and the SMI source has been enabled.\r | |
110 | EFI_DEVICE_ERROR - The driver was unable to enable the SMI source.\r | |
111 | EFI_OUT_OF_RESOURCES - Not enough memory (system or SMM) to manage this\r | |
112 | child.\r | |
113 | EFI_INVALID_PARAMETER - DispatchContext is invalid. The Power Button SMI\r | |
114 | phase is not within valid range.\r | |
115 | \r | |
116 | --*/\r | |
117 | typedef\r | |
118 | EFI_STATUS\r | |
119 | (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER) (\r | |
120 | IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL * This,\r | |
121 | IN EFI_HANDLE DispatchHandle\r | |
122 | );\r | |
123 | \r | |
124 | /*++\r | |
125 | \r | |
126 | Routine Description:\r | |
127 | Unregister a child SMI source dispatch function with a parent SMM driver\r | |
128 | \r | |
129 | Arguments:\r | |
130 | This - Protocol instance pointer.\r | |
131 | DispatchHandle - Handle of dispatch function to deregister.\r | |
132 | \r | |
133 | Returns:\r | |
134 | EFI_SUCCESS - The dispatch function has been successfully \r | |
135 | unregistered and the SMI source has been disabled\r | |
136 | if there are no other registered child dispatch\r | |
137 | functions for this SMI source.\r | |
138 | EFI_INVALID_PARAMETER - Handle is invalid.\r | |
139 | other - TBD\r | |
140 | \r | |
141 | --*/\r | |
142 | \r | |
143 | //\r | |
144 | // Interface structure for the SMM Power Button SMI Dispatch Protocol\r | |
145 | //\r | |
5d46191d | 146 | struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {\r |
3eb9473e | 147 | EFI_SMM_POWER_BUTTON_REGISTER Register;\r |
148 | EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;\r | |
5d46191d | 149 | };\r |
3eb9473e | 150 | \r |
151 | extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;\r | |
152 | \r | |
153 | #endif\r |