]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | SMM Power 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 power button SMI source generator.\r | |
6 | \r | |
7 | Copyright (c) 2009 - 2010, 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.1.\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef _SMM_POWER_BUTTON_DISPATCH2_H_\r | |
22 | #define _SMM_POWER_BUTTON_DISPATCH2_H_\r | |
23 | \r | |
24 | #include <Pi/PiSmmCis.h>\r | |
25 | \r | |
26 | #define EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_GUID \\r | |
27 | { \\r | |
28 | 0x1b1183fa, 0x1823, 0x46a7, {0x88, 0x72, 0x9c, 0x57, 0x87, 0x55, 0x40, 0x9d } \\r | |
29 | }\r | |
30 | \r | |
31 | ///\r | |
32 | /// Power Button phases.\r | |
33 | ///\r | |
34 | typedef enum {\r | |
35 | EfiPowerButtonEntry,\r | |
36 | EfiPowerButtonExit,\r | |
37 | EfiPowerButtonMax\r | |
38 | } EFI_POWER_BUTTON_PHASE;\r | |
39 | \r | |
40 | ///\r | |
41 | /// The dispatch function's context.\r | |
42 | ///\r | |
43 | typedef struct {\r | |
44 | ///\r | |
45 | /// Designates whether this handler should be invoked upon entry or exit.\r | |
46 | ///\r | |
47 | EFI_POWER_BUTTON_PHASE Phase;\r | |
48 | } EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT;\r | |
49 | \r | |
50 | typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL;\r | |
51 | \r | |
52 | /**\r | |
53 | Provides the parent dispatch service for a power button event.\r | |
54 | \r | |
55 | This service registers a function (DispatchFunction) which will be called when an SMI is \r | |
56 | generated because the power button was pressed or released, as specified by RegisterContext. \r | |
57 | On return, DispatchHandle contains a unique handle which may be used later to unregister the \r | |
58 | function using UnRegister().\r | |
59 | The DispatchFunction will be called with Context set to the same value as was passed into \r | |
60 | this function in RegisterContext and with CommBuffer and CommBufferSize set to NULL.\r | |
61 | \r | |
62 | @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL instance.\r | |
63 | @param[in] DispatchFunction Function to register for handler when power button is pressed or released.\r | |
64 | @param[in] RegisterContext Pointer to the dispatch function's context. The caller fills in this context\r | |
65 | before calling the Register() function to indicate to the Register() function\r | |
66 | the power button SMI phase for which the dispatch function should be invoked.\r | |
67 | @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance. \r | |
68 | \r | |
69 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
70 | registered and the SMI source has been enabled.\r | |
71 | @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r | |
72 | @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The power button input value\r | |
73 | is not within valid range.\r | |
74 | @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.\r | |
75 | **/\r | |
76 | typedef\r | |
77 | EFI_STATUS\r | |
78 | (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER2)(\r | |
79 | IN CONST EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL *This,\r | |
80 | IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,\r | |
81 | IN EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT *RegisterContext,\r | |
82 | OUT EFI_HANDLE *DispatchHandle\r | |
83 | );\r | |
84 | \r | |
85 | /**\r | |
86 | Unregisters a power-button service.\r | |
87 | \r | |
88 | This service removes the handler associated with DispatchHandle so that it will no longer be \r | |
89 | called when the standby button is pressed or released. \r | |
90 | \r | |
91 | @param[in] This Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL instance.\r | |
92 | @param[in] DispatchHandle Handle of the service to remove.\r | |
93 | \r | |
94 | @retval EFI_SUCCESS The service has been successfully removed.\r | |
95 | @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r | |
96 | **/\r | |
97 | typedef\r | |
98 | EFI_STATUS\r | |
99 | (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER2)(\r | |
100 | IN CONST EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL *This,\r | |
101 | IN EFI_HANDLE DispatchHandle\r | |
102 | );\r | |
103 | \r | |
104 | ///\r | |
105 | /// Interface structure for the SMM Power Button Dispatch2 Protocol.\r | |
106 | ///\r | |
107 | /// This protocol provides the parent dispatch service for the power button SMI source generator.\r | |
108 | ///\r | |
109 | struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL {\r | |
110 | EFI_SMM_POWER_BUTTON_REGISTER2 Register;\r | |
111 | EFI_SMM_POWER_BUTTON_UNREGISTER2 UnRegister;\r | |
112 | };\r | |
113 | \r | |
114 | extern EFI_GUID gEfiSmmPowerButtonDispatch2ProtocolGuid;\r | |
115 | \r | |
116 | #endif\r | |
117 | \r |