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