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