]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - IntelFrameworkPkg/Include/Protocol/SmmPowerButtonDispatch.h
Refine SMM USB Dispatch Protocol definition.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmPowerButtonDispatch.h
... / ...
CommitLineData
1/** @file\r
2 Provides the parent dispatch service for the power button SMI source generator.\r
3\r
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
8Copyright (c) 2007, Intel Corporation\r
9All rights reserved. This program and the accompanying materials\r
10are licensed and made available under the terms and conditions of the BSD License\r
11which accompanies this distribution. The full text of the license may be found at\r
12http://opensource.org/licenses/bsd-license.php\r
13\r
14THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\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
22#include <PiDxe.h>\r
23\r
24//\r
25// Global ID for the Power Button SMI Protocol\r
26//\r
27#define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \\r
28 { \\r
29 0xb709efa0, 0x47a6, 0x4b41, {0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 } \\r
30 }\r
31\r
32typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL;\r
33\r
34//\r
35// Related Definitions\r
36//\r
37//\r
38// Power Button. Example, Use for changing LEDs before ACPI OS is on.\r
39// - DXE/BDS Phase\r
40// - OS Install Phase\r
41//\r
42typedef enum {\r
43 PowerButtonEntry,\r
44 PowerButtonExit\r
45} EFI_POWER_BUTTON_PHASE;\r
46\r
47typedef struct {\r
48 EFI_POWER_BUTTON_PHASE Phase;\r
49} EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT;\r
50\r
51//\r
52// Member functions\r
53//\r
54/**\r
55 Dispatch function for a Power Button SMI handler.\r
56\r
57 @param[in] DispatchHandle Handle of this dispatch function.\r
58 @param[in] DispatchContext Pointer to the dispatch function's context.\r
59 The DispatchContext fields are filled in\r
60 by the dispatching driver prior to\r
61 invoking this dispatch function.\r
62\r
63**/\r
64typedef\r
65VOID\r
66(EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH)(\r
67 IN EFI_HANDLE DispatchHandle,\r
68 IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext\r
69 );\r
70\r
71/**\r
72 Provides the parent dispatch service for a given SMI source generator\r
73\r
74 @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.\r
75 @param[in] DispatchFunction Function to install.\r
76 @param[in] DispatchContext Pointer to the dispatch function's context.\r
77 The caller fills this context in before calling\r
78 the register function to indicate to the register\r
79 function the Power Button SMI phase for which the dispatch\r
80 function should be invoked.\r
81 @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.\r
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
90\r
91**/\r
92typedef\r
93EFI_STATUS\r
94(EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER)(\r
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
99 );\r
100\r
101/**\r
102 Unregisters a power-button service.\r
103\r
104 @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL instance.\r
105 @param[in] DispatchHandle Handle of the service to remove.\r
106\r
107 @retval EFI_SUCCESS The dispatch function has been successfully\r
108 unregistered and the SMI source has been\r
109 disabled if there are no other registered\r
110 child dispatch functions for this SMI\r
111 source.\r
112 @retval EFI_INVALID_PARAMETER Handle is invalid.\r
113\r
114**/\r
115typedef\r
116EFI_STATUS\r
117(EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER)(\r
118 IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,\r
119 IN EFI_HANDLE DispatchHandle\r
120 );\r
121\r
122/**\r
123 @par Protocol Description:\r
124 Provides the parent dispatch service for the SMM power button SMI source generator.\r
125\r
126**/\r
127struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {\r
128 ///\r
129 /// Installs a child service to be dispatched by this protocol.\r
130 ///\r
131 EFI_SMM_POWER_BUTTON_REGISTER Register;\r
132\r
133 ///\r
134 /// Removes a child service dispatched by this protocol.\r
135 ///\r
136 EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;\r
137};\r
138\r
139extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;\r
140\r
141#endif\r