]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmStandbyButtonDispatch.h
ae2ed464eb2fdbbad72a4354d19a41c35f544aca
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmStandbyButtonDispatch.h
1 /** @file
2 Provides the parent dispatch service for the standby button SMI source generator.
3
4 The SMM Standby Button Dispatch Protocol is defined in
5 the Intel Platform Innovation Framework for EFI SMM Core Interface Specification
6 (SMM CIS) Version 0.9.
7
8 Copyright (c) 2007, 2009 Intel Corporation
9 All rights reserved. This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17 @par Revision Reference:
18 This Protocol is defined in Framework of EFI SMM Core Interface Spec
19 Version 0.9.
20
21 **/
22
23 #ifndef _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_
24 #define _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_
25
26 #include <FrameworkSmm.h>
27
28 //
29 // Global ID for the Standby Button SMI Protocol
30 //
31 #define EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \
32 { \
33 0x78965b98, 0xb0bf, 0x449e, {0x8b, 0x22, 0xd2, 0x91, 0x4e, 0x49, 0x8a, 0x98 } \
34 }
35
36 typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL;
37
38 //
39 // Related Definitions
40 //
41
42 ///
43 /// Standby Button. Example, Use for changing LEDs before ACPI OS is on.
44 /// - DXE/BDS Phase
45 /// - OS Install Phase
46 ///
47 typedef enum {
48 EfiStandbyButtonEntry,
49 EfiStandbyButtonExit
50 } EFI_STANDBY_BUTTON_PHASE;
51
52 typedef struct {
53 /// Describes whether the child handler should be invoked upon the entry to the button
54 /// activation or upon exit (i.e., upon receipt of the button press event or upon release of
55 /// the event).
56 EFI_STANDBY_BUTTON_PHASE Phase;
57 } EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT;
58
59 //
60 // Member functions
61 //
62
63 /**
64 Dispatch function for a Standby Button SMI handler.
65
66 @param DispatchHandle Handle of this dispatch function.
67 @param DispatchContext Pointer to the dispatch function's context.
68 The DispatchContext fields are filled in
69 by the dispatching driver prior to
70 invoking this dispatch function.
71
72 **/
73 typedef
74 VOID
75 (EFIAPI *EFI_SMM_STANDBY_BUTTON_DISPATCH)(
76 IN EFI_HANDLE DispatchHandle,
77 IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext
78 );
79
80 /**
81 Provides the parent dispatch service for a given SMI source generator
82
83 @param This Pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
84 @param DispatchFunction Function to install.
85 @param DispatchContext Pointer to the dispatch function's context.
86 The caller fills this context in before calling
87 the register function to indicate to the register
88 function the Standby Button SMI phase for which the dispatch
89 function should be invoked.
90 @param DispatchHandle Handle generated by the dispatcher to track the function instance.
91
92 @retval EFI_SUCCESS The dispatch function has been successfully
93 registered and the SMI source has been enabled.
94 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
95 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
96 child.
97 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Standby Button SMI
98 phase is not within valid range.
99
100 **/
101 typedef
102 EFI_STATUS
103 (EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER)(
104 IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
105 IN EFI_SMM_STANDBY_BUTTON_DISPATCH DispatchFunction,
106 IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext,
107 OUT EFI_HANDLE *DispatchHandle
108 );
109
110 /**
111 Unregister a child SMI source dispatch function with a parent SMM driver
112
113 @param This Pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
114 @param DispatchHandle Handle of the service to remove.
115
116 @retval EFI_SUCCESS The dispatch function has been successfully
117 unregistered and the SMI source has been disabled
118 if there are no other registered child dispatch
119 functions for this SMI source.
120 @retval EFI_INVALID_PARAMETER Handle is invalid.
121
122 **/
123 typedef
124 EFI_STATUS
125 (EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER)(
126 IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
127 IN EFI_HANDLE DispatchHandle
128 );
129
130 //
131 // Interface structure for the SMM Standby Button SMI Dispatch Protocol
132 //
133 /**
134 This protocol provices the parent dispatch service for the standby button SMI source generator.
135 Provides the ability to install child handlers for the given event types.
136 **/
137 struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL {
138 ///
139 /// Installs a child service to be dispatched by this protocol.
140 ///
141 EFI_SMM_STANDBY_BUTTON_REGISTER Register;\
142 ///
143 /// Removes a child service dispatched by this protocol.
144 ///
145 EFI_SMM_STANDBY_BUTTON_UNREGISTER UnRegister;
146 };
147
148 extern EFI_GUID gEfiSmmStandbyButtonDispatchProtocolGuid;
149
150 #endif