]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/SmmPowerButtonDispatch.h
Grammatical and disclaimer changes (does not follow internal C coding stds.)
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmPowerButtonDispatch.h
CommitLineData
79964ac8 1/** @file\r
8411f1c0 2 Provides the parent dispatch service for the power button SMI source generator.\r
79964ac8 3\r
f22f941e 4Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved<BR>\r
5This program and the accompanying materials are licensed and made available under \r
6the terms and conditions of the BSD License that accompanies this distribution. \r
7The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php. \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
f7590642 12\r
79964ac8 13 @par Revision Reference:\r
14 This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
15 Version 0.9.\r
16\r
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
31typedef 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
41typedef enum {\r
42 PowerButtonEntry,\r
43 PowerButtonExit\r
44} EFI_POWER_BUTTON_PHASE;\r
45\r
46typedef 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
f22f941e 56 @param[in] DispatchHandle The handle of this dispatch function.\r
57 @param[in] DispatchContext The pointer to the dispatch function's context.\r
ac9868ec 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
63typedef\r
64VOID\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
f22f941e 73 @param[in] This The pointer to the \r
74 EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.\r
75 @param[in] DispatchFunction The function to install.\r
76 @param[in] DispatchContext The pointer to the dispatch function's context.\r
5259c97d 77 Indicates to the register\r
f22f941e 78 function the Power Button SMI phase for which \r
79 to invoke the dispatch function.\r
80 @param[out] DispatchHandle Handle generated by the dispatcher to track \r
81 the function instance.\r
ac9868ec 82\r
83 @retval EFI_SUCCESS The dispatch function has been successfully\r
84 registered and the SMI source has been enabled.\r
85 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
86 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
87 child.\r
88 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Power Button SMI\r
89 phase is not within valid range.\r
79964ac8 90\r
91**/\r
92typedef\r
93EFI_STATUS\r
69686d56 94(EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER)(\r
700a7869 95 IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,\r
96 IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction,\r
97 IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext,\r
98 OUT EFI_HANDLE *DispatchHandle\r
79964ac8 99 );\r
100\r
101/**\r
700a7869 102 Unregisters a power-button service.\r
79964ac8 103\r
f22f941e 104 @param[in] This The pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.\r
105 @param[in] DispatchHandle The handle of the service to remove.\r
79964ac8 106\r
ac9868ec 107 @retval EFI_SUCCESS The dispatch function has been successfully\r
f22f941e 108 unregistered, and the SMI source has been\r
109 disabled, if there are no other registered\r
ac9868ec 110 child dispatch functions for this SMI\r
111 source.\r
f22f941e 112 @retval EFI_INVALID_PARAMETER The handle is invalid.\r
79964ac8 113\r
114**/\r
115typedef\r
116EFI_STATUS\r
69686d56 117(EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER)(\r
700a7869 118 IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,\r
119 IN EFI_HANDLE DispatchHandle\r
79964ac8 120 );\r
121\r
79964ac8 122/**\r
123 @par Protocol Description:\r
124 Provides the parent dispatch service for the SMM power button SMI source generator.\r
125\r
79964ac8 126**/\r
127struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {\r
ac9868ec 128 ///\r
129 /// Installs a child service to be dispatched by this protocol.\r
130 ///\r
79964ac8 131 EFI_SMM_POWER_BUTTON_REGISTER Register;\r
ac9868ec 132\r
133 ///\r
134 /// Removes a child service dispatched by this protocol.\r
135 ///\r
79964ac8 136 EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;\r
137};\r
138\r
139extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;\r
140\r
141#endif\r