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