]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/MmStandbyButtonDispatch.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[mirror_edk2.git] / MdePkg / Include / Protocol / MmStandbyButtonDispatch.h
1 /** @file
2 MM Standby Button Dispatch Protocol as defined in PI 1.5 Specification
3 Volume 4 Management Mode Core Interface.
4
5 This protocol provides the parent dispatch service for the standby button MMI source generator.
6
7 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 @par Revision Reference:
17 This protocol is from PI Version 1.5.
18
19 **/
20
21 #ifndef _MM_STANDBY_BUTTON_DISPATCH_H_
22 #define _MM_STANDBY_BUTTON_DISPATCH_H_
23
24 #include <Pi/PiMmCis.h>
25
26 #define EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \
27 { \
28 0x7300c4a1, 0x43f2, 0x4017, {0xa5, 0x1b, 0xc8, 0x1a, 0x7f, 0x40, 0x58, 0x5b } \
29 }
30
31 ///
32 /// Standby Button phases
33 ///
34 typedef enum {
35 EfiStandbyButtonEntry,
36 EfiStandbyButtonExit,
37 EfiStandbyButtonMax
38 } EFI_STANDBY_BUTTON_PHASE;
39
40 ///
41 /// The dispatch function's context.
42 ///
43 typedef struct {
44 ///
45 /// Describes whether the child handler should be invoked upon the entry to the button
46 /// activation or upon exit.
47 ///
48 EFI_STANDBY_BUTTON_PHASE Phase;
49 } EFI_MM_STANDBY_BUTTON_REGISTER_CONTEXT;
50
51 typedef struct _EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL;
52
53 /**
54 Provides the parent dispatch service for a standby button event.
55
56 This service registers a function (DispatchFunction) which will be called when an MMI is
57 generated because the standby button was pressed or released, as specified by
58 RegisterContext. On return, DispatchHandle contains a unique handle which may be used
59 later to unregister the function using UnRegister().
60 The DispatchFunction will be called with Context set to the same value as was passed into
61 this function in RegisterContext and with CommBuffer and CommBufferSize set to NULL.
62
63 @param[in] This Pointer to the EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
64 @param[in] DispatchFunction Function to register for handler when the standby button is pressed or released.
65 @param[in] RegisterContext Pointer to the dispatch function's context. The caller fills in this context
66 before calling the register function to indicate to the register function the
67 standby button MMI source for which the dispatch function should be invoked.
68 @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
69
70 @retval EFI_SUCCESS The dispatch function has been successfully
71 registered and the MMI source has been enabled.
72 @retval EFI_DEVICE_ERROR The driver was unable to enable the MMI source.
73 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The standby button input value
74 is not within valid range.
75 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or MM) to manage this child.
76 **/
77 typedef
78 EFI_STATUS
79 (EFIAPI *EFI_MM_STANDBY_BUTTON_REGISTER)(
80 IN CONST EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
81 IN EFI_MM_HANDLER_ENTRY_POINT DispatchFunction,
82 IN EFI_MM_STANDBY_BUTTON_REGISTER_CONTEXT *RegisterContext,
83 OUT EFI_HANDLE *DispatchHandle
84 );
85
86 /**
87 Unregisters a child MMI source dispatch function with a parent MM driver.
88
89 This service removes the handler associated with DispatchHandle so that it will no longer be
90 called when the standby button is pressed or released.
91
92 @param[in] This Pointer to the EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL instance.
93 @param[in] DispatchHandle Handle of the service to remove.
94
95 @retval EFI_SUCCESS The service has been successfully removed.
96 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
97 **/
98 typedef
99 EFI_STATUS
100 (EFIAPI *EFI_MM_STANDBY_BUTTON_UNREGISTER)(
101 IN CONST EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
102 IN EFI_HANDLE DispatchHandle
103 );
104
105 ///
106 /// Interface structure for the MM Standby Button Dispatch Protocol.
107 ///
108 /// This protocol provides the parent dispatch service for the standby
109 /// button MMI source generator.
110 ///
111 struct _EFI_MM_STANDBY_BUTTON_DISPATCH_PROTOCOL {
112 EFI_MM_STANDBY_BUTTON_REGISTER Register;
113 EFI_MM_STANDBY_BUTTON_UNREGISTER UnRegister;
114 };
115
116 extern EFI_GUID gEfiMmStandbyButtonDispatchProtocolGuid;
117
118 #endif
119