]>
Commit | Line | Data |
---|---|---|
79964ac8 | 1 | /** @file\r |
8411f1c0 | 2 | Provides the parent dispatch service for the power button SMI source generator.\r |
79964ac8 | 3 | \r |
79964ac8 | 4 | @par Revision Reference:\r |
5 | This Protocol is defined in Framework of EFI SMM Core Interface Spec\r | |
6 | Version 0.9.\r | |
7 | \r | |
ac9868ec | 8 | Copyright (c) 2007, Intel Corporation\r |
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 | |
79964ac8 | 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 | |
76 | The caller fills this context in before calling\r | |
77 | the register function to indicate to the register\r | |
78 | function the Power Button SMI phase for which the dispatch\r | |
79 | function should be invoked.\r | |
80 | @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.\r | |
81 | \r | |
82 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
83 | registered and the SMI source has been enabled.\r | |
84 | @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r | |
85 | @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r | |
86 | child.\r | |
87 | @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Power Button SMI\r | |
88 | phase is not within valid range.\r | |
79964ac8 | 89 | \r |
90 | **/\r | |
91 | typedef\r | |
92 | EFI_STATUS\r | |
69686d56 | 93 | (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER)(\r |
700a7869 | 94 | IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,\r |
95 | IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction,\r | |
96 | IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext,\r | |
97 | OUT EFI_HANDLE *DispatchHandle\r | |
79964ac8 | 98 | );\r |
99 | \r | |
100 | /**\r | |
700a7869 | 101 | Unregisters a power-button service.\r |
79964ac8 | 102 | \r |
ac9868ec | 103 | @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.\r |
104 | @param[in] DispatchHandle Handle of the service to remove.\r | |
79964ac8 | 105 | \r |
ac9868ec | 106 | @retval EFI_SUCCESS The dispatch function has been successfully\r |
107 | unregistered and the SMI source has been\r | |
108 | disabled if there are no other registered\r | |
109 | child dispatch functions for this SMI\r | |
110 | source.\r | |
111 | @retval EFI_INVALID_PARAMETER Handle is invalid.\r | |
79964ac8 | 112 | \r |
113 | **/\r | |
114 | typedef\r | |
115 | EFI_STATUS\r | |
69686d56 | 116 | (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER)(\r |
700a7869 | 117 | IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,\r |
118 | IN EFI_HANDLE DispatchHandle\r | |
79964ac8 | 119 | );\r |
120 | \r | |
79964ac8 | 121 | /**\r |
122 | @par Protocol Description:\r | |
123 | Provides the parent dispatch service for the SMM power button SMI source generator.\r | |
124 | \r | |
79964ac8 | 125 | **/\r |
126 | struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {\r | |
ac9868ec | 127 | ///\r |
128 | /// Installs a child service to be dispatched by this protocol.\r | |
129 | ///\r | |
79964ac8 | 130 | EFI_SMM_POWER_BUTTON_REGISTER Register;\r |
ac9868ec | 131 | \r |
132 | ///\r | |
133 | /// Removes a child service dispatched by this protocol.\r | |
134 | ///\r | |
79964ac8 | 135 | EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;\r |
136 | };\r | |
137 | \r | |
138 | extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;\r | |
139 | \r | |
140 | #endif\r |