]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | This file declares EFI Smm Sx Smi Child Protocol\r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation \r | |
5 | All rights reserved. This program and the accompanying materials \r | |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | Module Name: SmmSxDispatch.h\r | |
14 | \r | |
15 | @par Revision Reference:\r | |
16 | This Protocol is defined in Framework of EFI SMM Core Interface Spec\r | |
17 | Version 0.9.\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef _EFI_SMM_SX_DISPATCH_H_\r | |
22 | #define _EFI_SMM_SX_DISPATCH_H_\r | |
23 | \r | |
24 | //\r | |
25 | // Global ID for the Sx SMI Protocol\r | |
26 | //\r | |
27 | #define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \\r | |
28 | { \\r | |
29 | 0x14fc52be, 0x1dc, 0x426c, {0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8 } \\r | |
30 | }\r | |
31 | \r | |
32 | typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH_PROTOCOL;\r | |
33 | //\r | |
34 | // Related Definitions\r | |
35 | //\r | |
36 | typedef enum {\r | |
37 | SxS0,\r | |
38 | SxS1,\r | |
39 | SxS2,\r | |
40 | SxS3,\r | |
41 | SxS4,\r | |
42 | SxS5,\r | |
43 | EfiMaximumSleepType\r | |
44 | } EFI_SLEEP_TYPE;\r | |
45 | \r | |
46 | typedef enum {\r | |
47 | SxEntry,\r | |
48 | SxExit,\r | |
49 | EfiMaximumPhase\r | |
50 | } EFI_SLEEP_PHASE;\r | |
51 | \r | |
52 | typedef struct {\r | |
53 | EFI_SLEEP_TYPE Type;\r | |
54 | EFI_SLEEP_PHASE Phase;\r | |
55 | } EFI_SMM_SX_DISPATCH_CONTEXT;\r | |
56 | \r | |
57 | //\r | |
58 | // Member functions\r | |
59 | //\r | |
60 | /**\r | |
61 | Dispatch function for a Sx state SMI handler.\r | |
62 | \r | |
0647c9ad | 63 | @param DispatchHandle Handle of this dispatch function.\r |
511710d6 | 64 | @param DispatchContext Pointer to the dispatch function's context.\r |
0647c9ad LG |
65 | The Type and Phase fields are filled in by the Sx dispatch driver\r |
66 | prior to invoking this dispatch function. For this interface,\r | |
67 | the Sx driver will call the dispatch function for all Sx type\r | |
68 | and phases, so the Sx state handler(s) must check the Type and\r | |
69 | Phase field of EFI_SMM_SX_DISPATCH_CONTEXT and act accordingly.\r | |
878ddf1f | 70 | \r |
71 | Nothing\r | |
72 | \r | |
73 | **/\r | |
74 | typedef\r | |
75 | VOID\r | |
76 | (EFIAPI *EFI_SMM_SX_DISPATCH) (\r | |
77 | IN EFI_HANDLE DispatchHandle,\r | |
78 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext\r | |
79 | );\r | |
80 | \r | |
81 | /**\r | |
82 | Register a child SMI source dispatch function with a parent SMM driver\r | |
83 | \r | |
0647c9ad LG |
84 | @param This Protocol instance pointer.\r |
85 | @param DispatchFunction Pointer to dispatch function to be invoked for\r | |
86 | this SMI source\r | |
87 | @param DispatchContext Pointer to the dispatch function's context.\r | |
88 | The caller fills this context in before calling\r | |
89 | the register function to indicate to the register\r | |
90 | function which Sx state type and phase the caller\r | |
91 | wishes to be called back on. For this intertace,\r | |
92 | the Sx driver will call the registered handlers for\r | |
93 | all Sx type and phases, so the Sx state handler(s)\r | |
94 | must check the Type and Phase field of the Dispatch\r | |
95 | context and act accordingly.\r | |
96 | @param DispatchHandle Handle of dispatch function, for when interfacing\r | |
97 | with the parent Sx state SMM driver.\r | |
98 | \r | |
99 | @retval EFI_SUCCESS The dispatch function has been successfully\r | |
100 | registered and the SMI source has been enabled.\r | |
101 | @retval EFI_UNSUPPORTED The Sx driver or hardware does not support that\r | |
102 | Sx Type/Phase.\r | |
103 | @retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.\r | |
104 | @retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r | |
105 | child.\r | |
106 | @retval EFI_INVALID_PARAMETER DispatchContext is invalid. Type & Phase are not\r | |
107 | within valid range.\r | |
878ddf1f | 108 | \r |
109 | **/\r | |
110 | typedef\r | |
111 | EFI_STATUS\r | |
112 | (EFIAPI *EFI_SMM_SX_REGISTER) (\r | |
113 | IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r | |
114 | IN EFI_SMM_SX_DISPATCH DispatchFunction,\r | |
115 | IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext,\r | |
116 | OUT EFI_HANDLE *DispatchHandle\r | |
117 | );\r | |
118 | \r | |
119 | /**\r | |
120 | Unregister a child SMI source dispatch function with a parent SMM driver\r | |
121 | \r | |
0647c9ad LG |
122 | @param This Protocol instance pointer.\r |
123 | @param DispatchHandle Handle of dispatch function to deregister.\r | |
878ddf1f | 124 | \r |
0647c9ad LG |
125 | @retval EFI_SUCCESS The dispatch function has been successfully unregistered and the\r |
126 | SMI source has been disabled if there are no other registered child\r | |
127 | dispatch functions for this SMI source.\r | |
128 | @retval EFI_INVALID_PARAMETER Handle is invalid.\r | |
129 | @retval other TBD\r | |
878ddf1f | 130 | \r |
131 | **/\r | |
132 | typedef\r | |
133 | EFI_STATUS\r | |
134 | (EFIAPI *EFI_SMM_SX_UNREGISTER) (\r | |
135 | IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,\r | |
136 | IN EFI_HANDLE DispatchHandle\r | |
137 | );\r | |
138 | \r | |
139 | //\r | |
140 | // Interface structure for the SMM Child Dispatch Protocol\r | |
141 | //\r | |
142 | /**\r | |
143 | @par Protocol Description:\r | |
144 | Provides the parent dispatch service for a given Sx-state source generator.\r | |
145 | \r | |
146 | @param Register\r | |
147 | Installs a child service to be dispatched by this protocol.\r | |
148 | \r | |
149 | @param UnRegister\r | |
150 | Removes a child service dispatched by this protocol.\r | |
151 | \r | |
152 | **/\r | |
153 | struct _EFI_SMM_SX_DISPATCH_PROTOCOL {\r | |
154 | EFI_SMM_SX_REGISTER Register;\r | |
155 | EFI_SMM_SX_UNREGISTER UnRegister;\r | |
156 | };\r | |
157 | \r | |
158 | extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;\r | |
159 | \r | |
160 | #endif\r |