]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/SmmStandbyButtonDispatch2.h
Rename PI SMM definitions which has same name with those of Framework SMM spec but...
[mirror_edk2.git] / MdePkg / Include / Protocol / SmmStandbyButtonDispatch2.h
CommitLineData
acee7e74 1/** @file\r
2 SMM Standby Button Dispatch2 Protocol as defined in PI 1.1 Specification\r
3 Volume 4 System Management Mode Core Interface.\r
4\r
5 This protocol provides the parent dispatch service for the standby button SMI source generator.\r
6\r
7 Copyright (c) 2009, Intel Corporation\r
8 All rights reserved. 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.1.\r
18\r
19**/\r
20\r
21#ifndef _SMM_STANDBY_BUTTON_DISPATCH2_H_\r
22#define _SMM_STANDBY_BUTTON_DISPATCH2_H_\r
23\r
24#include <Pi/PiSmmCis.h>\r
25\r
a2bb197e 26///\r
27/// Note:\r
28/// To avoid name conflict between PI and Framework SMM spec, the following names defined\r
29/// in PI 1.2 SMM spec are renamed. These renamings are not yet in a public PI spec and errta.\r
30///\r
31/// EFI_SMM_STANDBY_BUTTON_REGISTER -> EFI_SMM_STANDBY_BUTTON_REGISTER2\r
32/// EFI_SMM_STANDBY_BUTTON_UNREGISTER -> EFI_SMM_STANDBY_BUTTON_UNREGISTER2\r
33///\r
34\r
acee7e74 35#define EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_GUID \\r
36 { \\r
37 0x7300c4a1, 0x43f2, 0x4017, {0xa5, 0x1b, 0xc8, 0x1a, 0x7f, 0x40, 0x58, 0x5b } \\r
38 }\r
39\r
40///\r
41/// Standby Button phases\r
42///\r
43typedef enum {\r
44 EfiStandbyButtonEntry,\r
45 EfiStandbyButtonExit,\r
46 EfiStandbyButtonMax\r
47} EFI_STANDBY_BUTTON_PHASE;\r
48\r
49///\r
50/// The dispatch function's context.\r
51///\r
52typedef struct {\r
53 ///\r
54 /// Describes whether the child handler should be invoked upon the entry to the button \r
55 /// activation or upon exit.\r
56 ///\r
57 EFI_STANDBY_BUTTON_PHASE Phase;\r
58} EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT;\r
59\r
60typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL;\r
61\r
62/**\r
63 Provides the parent dispatch service for a standby button event.\r
64\r
65 This service registers a function (DispatchFunction) which will be called when an SMI is \r
66 generated because the standby button was pressed or released, as specified by \r
67 RegisterContext. On return, DispatchHandle contains a unique handle which may be used \r
68 later to unregister the function using UnRegister().\r
69 The DispatchFunction will be called with Context set to the same value as was passed into \r
70 this function in RegisterContext and with CommBuffer and CommBufferSize set to NULL. \r
71\r
72 @param[in] This Pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL instance.\r
73 @param[in] DispatchFunction Function to register for handler when the standby button is pressed or released.\r
fa3e7746 74 @param[in] RegisterContext Pointer to the dispatch function's context. The caller fills in this context\r
acee7e74 75 before calling the register function to indicate to the register function the \r
76 standby button SMI source for which the dispatch function should be invoked.\r
77 @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance. \r
78\r
79 @retval EFI_SUCCESS The dispatch function has been successfully\r
80 registered and the SMI source has been enabled.\r
81 @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
82 @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The standby button input value\r
83 is not within valid range.\r
84 @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.\r
85**/\r
86typedef\r
87EFI_STATUS\r
a2bb197e 88(EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER2)(\r
acee7e74 89 IN CONST EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL *This,\r
90 IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,\r
91 IN EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT *RegisterContext,\r
92 OUT EFI_HANDLE *DispatchHandle\r
93 );\r
94\r
95/**\r
96 Unregisters a child SMI source dispatch function with a parent SMM driver.\r
97\r
98 This service removes the handler associated with DispatchHandle so that it will no longer be \r
99 called when the standby button is pressed or released.\r
100\r
101 @param[in] This Pointer to the EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL instance.\r
102 @param[in] DispatchHandle Handle of the service to remove.\r
103\r
104 @retval EFI_SUCCESS The service has been successfully removed.\r
105 @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r
106**/\r
107typedef\r
108EFI_STATUS\r
a2bb197e 109(EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER2)(\r
acee7e74 110 IN CONST EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL *This,\r
111 IN EFI_HANDLE DispatchHandle\r
112 );\r
113\r
114///\r
115/// Interface structure for the SMM Standby Button Dispatch2 Protocol.\r
116///\r
117/// This protocol provides the parent dispatch service for the standby\r
118/// button SMI source generator.\r
119///\r
120struct _EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL {\r
a2bb197e 121 EFI_SMM_STANDBY_BUTTON_REGISTER2 Register;\r
122 EFI_SMM_STANDBY_BUTTON_UNREGISTER2 UnRegister;\r
acee7e74 123};\r
124\r
125extern EFI_GUID gEfiSmmStandbyButtonDispatch2ProtocolGuid;\r
126\r
127#endif\r
128\r