]>
Commit | Line | Data |
---|---|---|
07c6a47e ED |
1 | /** @file\r |
2 | Common definitions in the Platform Initialization Specification version 1.5\r | |
3 | VOLUME 4 Management Mode Core Interface version.\r | |
4 | \r | |
5 | Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef _PI_MMCIS_H_\r | |
17 | #define _PI_MMCIS_H_\r | |
18 | \r | |
19 | #include <Protocol/MmCpuIo.h>\r | |
20 | \r | |
21 | typedef struct _EFI_MM_SYSTEM_TABLE EFI_MM_SYSTEM_TABLE;\r | |
22 | \r | |
23 | ///\r | |
24 | /// The Management Mode System Table (MMST) signature\r | |
25 | ///\r | |
26 | #define MM_MMST_SIGNATURE SIGNATURE_32 ('S', 'M', 'S', 'T')\r | |
27 | ///\r | |
28 | /// The Management Mode System Table (MMST) revision is 1.6\r | |
29 | ///\r | |
30 | #define MM_SPECIFICATION_MAJOR_REVISION 1\r | |
31 | #define MM_SPECIFICATION_MINOR_REVISION 60\r | |
32 | #define EFI_MM_SYSTEM_TABLE_REVISION ((MM_SPECIFICATION_MAJOR_REVISION<<16) | (MM_SPECIFICATION_MINOR_REVISION))\r | |
33 | \r | |
34 | /**\r | |
35 | Adds, updates, or removes a configuration table entry from the Management Mode System Table.\r | |
36 | \r | |
37 | The MmInstallConfigurationTable() function is used to maintain the list\r | |
38 | of configuration tables that are stored in the Management Mode System\r | |
39 | Table. The list is stored as an array of (GUID, Pointer) pairs. The list\r | |
40 | must be allocated from pool memory with PoolType set to EfiRuntimeServicesData.\r | |
41 | \r | |
42 | @param[in] SystemTable A pointer to the MM System Table (MMST).\r | |
43 | @param[in] Guid A pointer to the GUID for the entry to add, update, or remove.\r | |
44 | @param[in] Table A pointer to the buffer of the table to add.\r | |
45 | @param[in] TableSize The size of the table to install.\r | |
46 | \r | |
47 | @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.\r | |
48 | @retval EFI_INVALID_PARAMETER Guid is not valid.\r | |
49 | @retval EFI_NOT_FOUND An attempt was made to delete a non-existent entry.\r | |
50 | @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.\r | |
51 | **/\r | |
52 | typedef\r | |
53 | EFI_STATUS\r | |
54 | (EFIAPI *EFI_MM_INSTALL_CONFIGURATION_TABLE)(\r | |
55 | IN CONST EFI_MM_SYSTEM_TABLE *SystemTable,\r | |
56 | IN CONST EFI_GUID *Guid,\r | |
57 | IN VOID *Table,\r | |
58 | IN UINTN TableSize\r | |
59 | );\r | |
60 | \r | |
61 | /**\r | |
62 | This service lets the caller to get one distinct application processor (AP) to execute\r | |
63 | a caller-provided code stream while in MM.\r | |
64 | \r | |
65 | @param[in] Procedure A pointer to the code stream to be run on the designated\r | |
66 | AP of the system.\r | |
67 | @param[in] CpuNumber The zero-based index of the processor number of the AP\r | |
68 | on which the code stream is supposed to run.\r | |
69 | @param[in,out] ProcArguments Allows the caller to pass a list of parameters to the code\r | |
70 | that is run by the AP.\r | |
71 | \r | |
72 | @retval EFI_SUCCESS The call was successful and the return parameters are valid.\r | |
73 | @retval EFI_INVALID_PARAMETER The input arguments are out of range.\r | |
74 | @retval EFI_INVALID_PARAMETER The CPU requested is not available on this SMI invocation.\r | |
75 | @retval EFI_INVALID_PARAMETER The CPU cannot support an additional service invocation.\r | |
76 | **/\r | |
77 | typedef\r | |
78 | EFI_STATUS\r | |
79 | (EFIAPI *EFI_MM_STARTUP_THIS_AP)(\r | |
80 | IN EFI_AP_PROCEDURE Procedure,\r | |
81 | IN UINTN CpuNumber,\r | |
82 | IN OUT VOID *ProcArguments OPTIONAL\r | |
83 | );\r | |
84 | \r | |
85 | /**\r | |
86 | Function prototype for protocol install notification.\r | |
87 | \r | |
88 | @param[in] Protocol Points to the protocol's unique identifier.\r | |
89 | @param[in] Interface Points to the interface instance.\r | |
90 | @param[in] Handle The handle on which the interface was installed.\r | |
91 | \r | |
92 | @return Status Code\r | |
93 | **/\r | |
94 | typedef\r | |
95 | EFI_STATUS\r | |
96 | (EFIAPI *EFI_MM_NOTIFY_FN)(\r | |
97 | IN CONST EFI_GUID *Protocol,\r | |
98 | IN VOID *Interface,\r | |
99 | IN EFI_HANDLE Handle\r | |
100 | );\r | |
101 | \r | |
102 | /**\r | |
103 | Register a callback function be called when a particular protocol interface is installed.\r | |
104 | \r | |
105 | The MmRegisterProtocolNotify() function creates a registration Function that is to be\r | |
106 | called whenever a protocol interface is installed for Protocol by\r | |
107 | MmInstallProtocolInterface().\r | |
108 | If Function == NULL and Registration is an existing registration, then the callback is unhooked.\r | |
109 | \r | |
110 | @param[in] Protocol The unique ID of the protocol for which the event is to be registered.\r | |
111 | @param[in] Function Points to the notification function.\r | |
112 | @param[out] Registration A pointer to a memory location to receive the registration value.\r | |
113 | \r | |
114 | @retval EFI_SUCCESS Successfully returned the registration record\r | |
115 | that has been added or unhooked.\r | |
116 | @retval EFI_INVALID_PARAMETER Protocol is NULL or Registration is NULL.\r | |
117 | @retval EFI_OUT_OF_RESOURCES Not enough memory resource to finish the request.\r | |
118 | @retval EFI_NOT_FOUND If the registration is not found when Function == NULL.\r | |
119 | **/\r | |
120 | typedef\r | |
121 | EFI_STATUS\r | |
122 | (EFIAPI *EFI_MM_REGISTER_PROTOCOL_NOTIFY)(\r | |
123 | IN CONST EFI_GUID *Protocol,\r | |
124 | IN EFI_MM_NOTIFY_FN Function,\r | |
125 | OUT VOID **Registration\r | |
126 | );\r | |
127 | \r | |
128 | /**\r | |
129 | Manage MMI of a particular type.\r | |
130 | \r | |
131 | @param[in] HandlerType Points to the handler type or NULL for root MMI handlers.\r | |
132 | @param[in] Context Points to an optional context buffer.\r | |
133 | @param[in,out] CommBuffer Points to the optional communication buffer.\r | |
134 | @param[in,out] CommBufferSize Points to the size of the optional communication buffer.\r | |
135 | \r | |
136 | @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was processed successfully but not quiesced.\r | |
137 | @retval EFI_INTERRUPT_PENDING One or more SMI sources could not be quiesced.\r | |
138 | @retval EFI_NOT_FOUND Interrupt source was not handled or quiesced.\r | |
139 | @retval EFI_SUCCESS Interrupt source was handled and quiesced.\r | |
140 | **/\r | |
141 | typedef\r | |
142 | EFI_STATUS\r | |
143 | (EFIAPI *EFI_MM_INTERRUPT_MANAGE)(\r | |
144 | IN CONST EFI_GUID *HandlerType,\r | |
145 | IN CONST VOID *Context OPTIONAL,\r | |
146 | IN OUT VOID *CommBuffer OPTIONAL,\r | |
147 | IN OUT UINTN *CommBufferSize OPTIONAL\r | |
148 | );\r | |
149 | \r | |
150 | /**\r | |
151 | Main entry point for an MM handler dispatch or communicate-based callback.\r | |
152 | \r | |
153 | @param[in] DispatchHandle The unique handle assigned to this handler by MmiHandlerRegister().\r | |
154 | @param[in] Context Points to an optional handler context which was specified when the\r | |
155 | handler was registered.\r | |
156 | @param[in,out] CommBuffer A pointer to a collection of data in memory that will\r | |
157 | be conveyed from a non-MM environment into an MM environment.\r | |
158 | @param[in,out] CommBufferSize The size of the CommBuffer.\r | |
159 | \r | |
160 | @retval EFI_SUCCESS The interrupt was handled and quiesced. No other handlers\r | |
161 | should still be called.\r | |
162 | @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quiesced but other handlers should\r | |
163 | still be called.\r | |
164 | @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pending and other handlers should still\r | |
165 | be called.\r | |
166 | @retval EFI_INTERRUPT_PENDING The interrupt could not be quiesced.\r | |
167 | **/\r | |
168 | typedef\r | |
169 | EFI_STATUS\r | |
170 | (EFIAPI *EFI_MM_HANDLER_ENTRY_POINT)(\r | |
171 | IN EFI_HANDLE DispatchHandle,\r | |
172 | IN CONST VOID *Context OPTIONAL,\r | |
173 | IN OUT VOID *CommBuffer OPTIONAL,\r | |
174 | IN OUT UINTN *CommBufferSize OPTIONAL\r | |
175 | );\r | |
176 | \r | |
177 | /**\r | |
178 | Registers a handler to execute within MM.\r | |
179 | \r | |
180 | @param[in] Handler Handler service function pointer.\r | |
181 | @param[in] HandlerType Points to the handler type or NULL for root MMI handlers.\r | |
182 | @param[out] DispatchHandle On return, contains a unique handle which can be used to later\r | |
183 | unregister the handler function.\r | |
184 | \r | |
185 | @retval EFI_SUCCESS MMI handler added successfully.\r | |
186 | @retval EFI_INVALID_PARAMETER Handler is NULL or DispatchHandle is NULL.\r | |
187 | **/\r | |
188 | typedef\r | |
189 | EFI_STATUS\r | |
190 | (EFIAPI *EFI_MM_INTERRUPT_REGISTER)(\r | |
191 | IN EFI_MM_HANDLER_ENTRY_POINT Handler,\r | |
192 | IN CONST EFI_GUID *HandlerType OPTIONAL,\r | |
193 | OUT EFI_HANDLE *DispatchHandle\r | |
194 | );\r | |
195 | \r | |
196 | /**\r | |
197 | Unregister a handler in MM.\r | |
198 | \r | |
199 | @param[in] DispatchHandle The handle that was specified when the handler was registered.\r | |
200 | \r | |
201 | @retval EFI_SUCCESS Handler function was successfully unregistered.\r | |
202 | @retval EFI_INVALID_PARAMETER DispatchHandle does not refer to a valid handle.\r | |
203 | **/\r | |
204 | typedef\r | |
205 | EFI_STATUS\r | |
206 | (EFIAPI *EFI_MM_INTERRUPT_UNREGISTER)(\r | |
207 | IN EFI_HANDLE DispatchHandle\r | |
208 | );\r | |
209 | \r | |
210 | ///\r | |
211 | /// Processor information and functionality needed by MM Foundation.\r | |
212 | ///\r | |
213 | typedef struct _EFI_MM_ENTRY_CONTEXT {\r | |
214 | EFI_MM_STARTUP_THIS_AP MmStartupThisAp;\r | |
215 | ///\r | |
216 | /// A number between zero and the NumberOfCpus field. This field designates which\r | |
217 | /// processor is executing the MM Foundation.\r | |
218 | ///\r | |
219 | UINTN CurrentlyExecutingCpu;\r | |
220 | ///\r | |
221 | /// The number of possible processors in the platform. This is a 1 based\r | |
222 | /// counter. This does not indicate the number of processors that entered MM.\r | |
223 | ///\r | |
224 | UINTN NumberOfCpus;\r | |
225 | ///\r | |
226 | /// Points to an array, where each element describes the number of bytes in the\r | |
227 | /// corresponding save state specified by CpuSaveState. There are always\r | |
228 | /// NumberOfCpus entries in the array.\r | |
229 | ///\r | |
230 | UINTN *CpuSaveStateSize;\r | |
231 | ///\r | |
232 | /// Points to an array, where each element is a pointer to a CPU save state. The\r | |
233 | /// corresponding element in CpuSaveStateSize specifies the number of bytes in the\r | |
234 | /// save state area. There are always NumberOfCpus entries in the array.\r | |
235 | ///\r | |
236 | VOID **CpuSaveState;\r | |
237 | } EFI_MM_ENTRY_CONTEXT;\r | |
238 | \r | |
239 | /**\r | |
240 | This function is the main entry point to the MM Foundation.\r | |
241 | \r | |
242 | @param[in] MmEntryContext Processor information and functionality needed by MM Foundation.\r | |
243 | **/\r | |
244 | typedef\r | |
245 | VOID\r | |
246 | (EFIAPI *EFI_MM_ENTRY_POINT)(\r | |
247 | IN CONST EFI_MM_ENTRY_CONTEXT *MmEntryContext\r | |
248 | );\r | |
249 | \r | |
250 | ///\r | |
251 | /// Management Mode System Table (MMST)\r | |
252 | ///\r | |
253 | /// The Management Mode System Table (MMST) is a table that contains a collection of common\r | |
254 | /// services for managing MMRAM allocation and providing basic I/O services. These services are\r | |
255 | /// intended for both preboot and runtime usage.\r | |
256 | ///\r | |
257 | struct _EFI_MM_SYSTEM_TABLE {\r | |
258 | ///\r | |
259 | /// The table header for the SMST.\r | |
260 | ///\r | |
261 | EFI_TABLE_HEADER Hdr;\r | |
262 | ///\r | |
263 | /// A pointer to a NULL-terminated Unicode string containing the vendor name.\r | |
264 | /// It is permissible for this pointer to be NULL.\r | |
265 | ///\r | |
266 | CHAR16 *MmFirmwareVendor;\r | |
267 | ///\r | |
268 | /// The particular revision of the firmware.\r | |
269 | ///\r | |
270 | UINT32 MmFirmwareRevision;\r | |
271 | \r | |
272 | EFI_MM_INSTALL_CONFIGURATION_TABLE MmInstallConfigurationTable;\r | |
273 | \r | |
274 | ///\r | |
275 | /// I/O Service\r | |
276 | ///\r | |
277 | EFI_MM_CPU_IO_PROTOCOL MmIo;\r | |
278 | \r | |
279 | ///\r | |
280 | /// Runtime memory services\r | |
281 | ///\r | |
282 | EFI_ALLOCATE_POOL MmAllocatePool;\r | |
283 | EFI_FREE_POOL MmFreePool;\r | |
284 | EFI_ALLOCATE_PAGES MmAllocatePages;\r | |
285 | EFI_FREE_PAGES MmFreePages;\r | |
286 | \r | |
287 | ///\r | |
288 | /// MP service\r | |
289 | ///\r | |
290 | EFI_MM_STARTUP_THIS_AP MmStartupThisAp;\r | |
291 | \r | |
292 | ///\r | |
293 | /// CPU information records\r | |
294 | ///\r | |
295 | \r | |
296 | ///\r | |
297 | /// A number between zero and and the NumberOfCpus field. This field designates\r | |
298 | /// which processor is executing the MM infrastructure.\r | |
299 | ///\r | |
300 | UINTN CurrentlyExecutingCpu;\r | |
301 | ///\r | |
302 | /// The number of possible processors in the platform. This is a 1 based counter.\r | |
303 | ///\r | |
304 | UINTN NumberOfCpus;\r | |
305 | ///\r | |
306 | /// Points to an array, where each element describes the number of bytes in the\r | |
307 | /// corresponding save state specified by CpuSaveState. There are always\r | |
308 | /// NumberOfCpus entries in the array.\r | |
309 | ///\r | |
310 | UINTN *CpuSaveStateSize;\r | |
311 | ///\r | |
312 | /// Points to an array, where each element is a pointer to a CPU save state. The\r | |
313 | /// corresponding element in CpuSaveStateSize specifies the number of bytes in the\r | |
314 | /// save state area. There are always NumberOfCpus entries in the array.\r | |
315 | ///\r | |
316 | VOID **CpuSaveState;\r | |
317 | \r | |
318 | ///\r | |
319 | /// Extensibility table\r | |
320 | ///\r | |
321 | \r | |
322 | ///\r | |
323 | /// The number of UEFI Configuration Tables in the buffer MmConfigurationTable.\r | |
324 | ///\r | |
325 | UINTN NumberOfTableEntries;\r | |
326 | ///\r | |
327 | /// A pointer to the UEFI Configuration Tables. The number of entries in the table is\r | |
328 | /// NumberOfTableEntries.\r | |
329 | ///\r | |
330 | EFI_CONFIGURATION_TABLE *MmConfigurationTable;\r | |
331 | \r | |
332 | ///\r | |
333 | /// Protocol services\r | |
334 | ///\r | |
335 | EFI_INSTALL_PROTOCOL_INTERFACE MmInstallProtocolInterface;\r | |
336 | EFI_UNINSTALL_PROTOCOL_INTERFACE MmUninstallProtocolInterface;\r | |
337 | EFI_HANDLE_PROTOCOL MmHandleProtocol;\r | |
338 | EFI_MM_REGISTER_PROTOCOL_NOTIFY MmRegisterProtocolNotify;\r | |
339 | EFI_LOCATE_HANDLE MmLocateHandle;\r | |
340 | EFI_LOCATE_PROTOCOL MmLocateProtocol;\r | |
341 | \r | |
342 | ///\r | |
343 | /// MMI Management functions\r | |
344 | ///\r | |
345 | EFI_MM_INTERRUPT_MANAGE MmiManage;\r | |
346 | EFI_MM_INTERRUPT_REGISTER MmiHandlerRegister;\r | |
347 | EFI_MM_INTERRUPT_UNREGISTER MmiHandlerUnRegister;\r | |
348 | };\r | |
349 | \r | |
350 | #endif\r |