]>
Commit | Line | Data |
---|---|---|
76ab2dc3 | 1 | /** @file\r |
2 | SMM Sx Dispatch Protocol as defined in PI 1.2 Specification\r | |
3 | Volume 4 System Management Mode Core Interface.\r | |
4 | \r | |
5 | Provides the parent dispatch service for a given Sx-state 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 | **/\r | |
17 | \r | |
18 | #ifndef _SMM_SX_DISPATCH2_H_\r | |
19 | #define _SMM_SX_DISPATCH2_H_\r | |
20 | \r | |
21 | #include <Pi/PiSmmCis.h>\r | |
22 | \r | |
23 | #define EFI_SMM_SX_DISPATCH2_PROTOCOL_GUID \\r | |
24 | { \\r | |
25 | 0x456d2859, 0xa84b, 0x4e47, {0xa2, 0xee, 0x32, 0x76, 0xd8, 0x86, 0x99, 0x7d } \\r | |
26 | }\r | |
27 | \r | |
28 | ///\r | |
29 | /// Sleep states S0-S5\r | |
30 | ///\r | |
31 | typedef enum {\r | |
32 | SxS0,\r | |
33 | SxS1,\r | |
34 | SxS2,\r | |
35 | SxS3,\r | |
36 | SxS4,\r | |
37 | SxS5,\r | |
38 | EfiMaximumSleepType\r | |
39 | } EFI_SLEEP_TYPE;\r | |
40 | \r | |
41 | ///\r | |
42 | /// Sleep state phase: entry or exit\r | |
43 | ///\r | |
44 | typedef enum {\r | |
45 | SxEntry,\r | |
46 | SxExit,\r | |
47 | EfiMaximumPhase\r | |
48 | } EFI_SLEEP_PHASE;\r | |
49 | \r | |
50 | ///\r | |
51 | /// The dispatch function's context\r | |
52 | ///\r | |
53 | typedef struct {\r | |
54 | EFI_SLEEP_TYPE Type;\r | |
55 | EFI_SLEEP_PHASE Phase;\r | |
56 | } EFI_SMM_SX_REGISTER_CONTEXT;\r | |
57 | \r | |
58 | typedef struct _EFI_SMM_SX_DISPATCH2_PROTOCOL EFI_SMM_SX_DISPATCH2_PROTOCOL;\r | |
59 | \r | |
60 | /**\r | |
61 | Provides the parent dispatch service for a given Sx source generator.\r | |
62 | \r | |
63 | This service registers a function (DispatchFunction) which will be called when the sleep state \r | |
64 | event specified by RegisterContext is detected. On return, DispatchHandle contains a \r | |
65 | unique handle which may be used later to unregister the function using UnRegister().\r | |
66 | The DispatchFunction will be called with Context set to the same value as was passed into \r | |
67 | this function in RegisterContext and with CommBuffer and CommBufferSize set to \r | |
68 | NULL and 0 respectively.\r | |
69 | \r | |
70 | @param[in] This Pointer to the EFI_SMM_SX_DISPATCH2_PROTOCOL instance.\r | |
71 | @param[in] DispatchFunction Function to register for handler when the specified sleep state event occurs.\r | |
72 | @param[in] RegisterContext Pointer to the dispatch function's context.\r | |
73 | The caller fills this context in before calling\r | |
74 | the register function to indicate to the register\r | |
75 | function which Sx state type and phase the caller\r | |
76 | wishes to be called back on. For this intertace,\r | |
77 | the Sx driver will call the registered handlers for\r | |
78 | all Sx type and phases, so the Sx state handler(s)\r | |
79 | must check the Type and Phase field of the Dispatch\r | |
80 | context and act accordingly.\r | |
81 | @param[out] DispatchHandle Handle of dispatch function, for when interfacing\r | |
82 | with the parent Sx state SMM driver.\r | |
83 | \r | |
84 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
85 | registered and the SMI source has been enabled.\r | |
86 | @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that\r | |
87 | Sx Type/Phase.\r | |
88 | @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.\r | |
89 | @retval EFI_INVALID_PARAMETER RegisterContext is invalid. Type & Phase are not\r | |
90 | within valid range.\r | |
91 | @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this\r | |
92 | child.\r | |
93 | **/\r | |
94 | typedef\r | |
95 | EFI_STATUS\r | |
96 | (EFIAPI *EFI_SMM_SX_REGISTER)(\r | |
97 | IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL *This,\r | |
98 | IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,\r | |
99 | IN CONST EFI_SMM_SX_REGISTER_CONTEXT *RegisterContext,\r | |
100 | OUT EFI_HANDLE *DispatchHandle\r | |
101 | );\r | |
102 | \r | |
103 | /**\r | |
104 | Unregisters an Sx-state service.\r | |
105 | \r | |
106 | This service removes the handler associated with DispatchHandle so that it will no longer be \r | |
107 | called in response to sleep event.\r | |
108 | \r | |
109 | @param[in] This Pointer to the EFI_SMM_SX_DISPATCH2_PROTOCOL instance.\r | |
110 | @param[in] DispatchHandle Handle of the service to remove. \r | |
111 | \r | |
112 | @retval EFI_SUCCESS The service has been successfully removed.\r | |
113 | @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.\r | |
114 | **/\r | |
115 | typedef\r | |
116 | EFI_STATUS\r | |
117 | (EFIAPI *EFI_SMM_SX_UNREGISTER)(\r | |
118 | IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL *This,\r | |
119 | IN EFI_HANDLE DispatchHandle\r | |
120 | );\r | |
121 | \r | |
122 | ///\r | |
123 | /// Interface structure for the SMM Sx Dispatch Protocol\r | |
124 | ///\r | |
125 | /// The EFI_SMM_SX_DISPATCH2_PROTOCOL provides the ability to install child handlers to \r | |
126 | /// respond to sleep state related events.\r | |
127 | ///\r | |
128 | struct _EFI_SMM_SX_DISPATCH2_PROTOCOL {\r | |
129 | EFI_SMM_SX_REGISTER Register;\r | |
130 | EFI_SMM_SX_UNREGISTER UnRegister;\r | |
131 | };\r | |
132 | \r | |
133 | extern EFI_GUID gEfiSmmSxDispatch2ProtocolGuid;\r | |
134 | \r | |
135 | #endif\r |