]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmStandbyButtonDispatch.h
1b5a98861b737d7ec037e2880a625b8cccd66502
[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 - 2018, Intel Corporation. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10
11 @par Revision Reference:
12 This Protocol is defined in Framework of EFI SMM Core Interface Spec
13 Version 0.9.
14
15 **/
16
17 #ifndef _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_
18 #define _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_
19
20 //
21 // Share some common definitions with PI SMM
22 //
23 #include <Protocol/SmmStandbyButtonDispatch2.h>
24
25 //
26 // Global ID for the Standby Button SMI Protocol
27 //
28 #define EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \
29 { \
30 0x78965b98, 0xb0bf, 0x449e, {0x8b, 0x22, 0xd2, 0x91, 0x4e, 0x49, 0x8a, 0x98 } \
31 }
32
33 typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL;
34
35 //
36 // Related Definitions
37 //
38
39 typedef struct {
40 /// Describes whether the child handler should be invoked upon the entry to the button
41 /// activation or upon exit (i.e., upon receipt of the button press event or upon release of
42 /// the event).
43 EFI_STANDBY_BUTTON_PHASE Phase;
44 } EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT;
45
46 //
47 // Member functions
48 //
49
50 /**
51 Dispatch function for a Standby Button SMI handler.
52
53 @param DispatchHandle The handle of this dispatch function.
54 @param DispatchContext The pointer to the dispatch function's context.
55 The DispatchContext fields are filled in
56 by the dispatching driver prior to
57 invoking this dispatch function.
58
59 **/
60 typedef
61 VOID
62 (EFIAPI *EFI_SMM_STANDBY_BUTTON_DISPATCH)(
63 IN EFI_HANDLE DispatchHandle,
64 IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext
65 );
66
67 /**
68 Provides the parent dispatch service for a given SMI source generator
69
70 @param This The pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
71 @param DispatchFunction The function to install.
72 @param DispatchContext The pointer to the dispatch function's context.
73 Indicates to the register function the Standby
74 Button SMI phase for which to invoke the dispatch
75 function.
76 @param DispatchHandle The handle generated by the dispatcher to track the
77 function instance.
78
79 @retval EFI_SUCCESS The dispatch function has been successfully
80 registered, and the SMI source has been enabled.
81 @retval EFI_DEVICE_ERROR The driver could not enable the SMI source.
82 @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
83 child.
84 @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Standby Button SMI
85 phase is not within valid range.
86
87 **/
88 typedef
89 EFI_STATUS
90 (EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER)(
91 IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
92 IN EFI_SMM_STANDBY_BUTTON_DISPATCH DispatchFunction,
93 IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext,
94 OUT EFI_HANDLE *DispatchHandle
95 );
96
97 /**
98 Unregister a child SMI source dispatch function with a parent SMM driver.
99
100 @param This The pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
101 @param DispatchHandle The handle of the service to remove.
102
103 @retval EFI_SUCCESS The dispatch function has been successfully
104 unregistered, and the SMI source has been disabled,
105 if there are no other registered child dispatch
106 functions for this SMI source.
107 @retval EFI_INVALID_PARAMETER The handle is invalid.
108
109 **/
110 typedef
111 EFI_STATUS
112 (EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER)(
113 IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
114 IN EFI_HANDLE DispatchHandle
115 );
116
117 //
118 // Interface structure for the SMM Standby Button SMI Dispatch Protocol
119 //
120 /**
121 This protocol provices the parent dispatch service for the standby button SMI source generator.
122 Provides the ability to install child handlers for the given event types.
123 **/
124 struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL {
125 ///
126 /// Installs a child service to be dispatched by this protocol.
127 ///
128 EFI_SMM_STANDBY_BUTTON_REGISTER Register;\
129 ///
130 /// Removes a child service dispatched by this protocol.
131 ///
132 EFI_SMM_STANDBY_BUTTON_UNREGISTER UnRegister;
133 };
134
135 extern EFI_GUID gEfiSmmStandbyButtonDispatchProtocolGuid;
136
137 #endif