]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | SMM Base Protocol on SMM Base2 Protocol Thunk driver.\r | |
3 | \r | |
4 | This driver co-operates with SMM Base Helper SMM driver to provide SMM Base Protocol\r | |
5 | based on SMM Base2 Protocol.\r | |
6 | \r | |
7 | This thunk driver is expected to be loaded before PI SMM IPL driver so that\r | |
8 | SMM BASE Protocol can be published immediately after SMM Base2 Protocol is installed to\r | |
9 | make SMM Base Protocol.InSmm() as early as possible.\r | |
10 | \r | |
11 | Copyright (c) 2009 Intel Corporation\r | |
12 | All rights reserved. This program and the accompanying materials\r | |
13 | are licensed and made available under the terms and conditions of the BSD License\r | |
14 | which accompanies this distribution. The full text of the license may be found at\r | |
15 | http://opensource.org/licenses/bsd-license.php\r | |
16 | \r | |
17 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
18 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
19 | \r | |
20 | **/\r | |
21 | \r | |
22 | #include "SmmBaseOnSmmBase2Thunk.h"\r | |
23 | \r | |
24 | EFI_SMM_BASE_PROTOCOL gSmmBase = {\r | |
25 | SmmBaseRegister,\r | |
26 | SmmBaseUnregister,\r | |
27 | SmmBaseCommunicate,\r | |
28 | SmmBaseRegisterCallback,\r | |
29 | SmmBaseInSmm,\r | |
30 | SmmBaseSmmAllocatePool,\r | |
31 | SmmBaseSmmFreePool,\r | |
32 | SmmBaseGetSmstLocation\r | |
33 | };\r | |
34 | \r | |
35 | SMMBASETHUNK_COMMUNICATION_DATA gCommunicationData = {\r | |
36 | EFI_SMM_BASE_THUNK_COMMUNICATION_GUID,\r | |
37 | sizeof (SMMBASE_FUNCTION_DATA)\r | |
38 | };\r | |
39 | \r | |
40 | EFI_HANDLE mImageHandle;\r | |
41 | EFI_SMM_BASE2_PROTOCOL *mSmmBase2 = NULL;\r | |
42 | EFI_SMM_COMMUNICATION_PROTOCOL *mSmmCommunication = NULL;\r | |
43 | EFI_SMM_BASE_HELPER_READY_PROTOCOL *mSmmBaseHelperReady = NULL;\r | |
44 | \r | |
45 | /**\r | |
46 | Determine if in SMM mode.\r | |
47 | \r | |
48 | @retval TRUE In SMM mode.\r | |
49 | @retval FALSE Not in SMM mode.\r | |
50 | **/\r | |
51 | BOOLEAN\r | |
52 | IsInSmm (\r | |
53 | VOID\r | |
54 | )\r | |
55 | {\r | |
56 | EFI_STATUS Status;\r | |
57 | BOOLEAN InSmm;\r | |
58 | \r | |
59 | Status = mSmmBase2->InSmm (mSmmBase2, &InSmm);\r | |
60 | ASSERT_EFI_ERROR (Status);\r | |
61 | return InSmm;\r | |
62 | }\r | |
63 | \r | |
64 | /**\r | |
65 | Invoke services provided by SMM Base Helper SMM driver.\r | |
66 | **/\r | |
67 | VOID\r | |
68 | SmmBaseHelperService (\r | |
69 | VOID\r | |
70 | )\r | |
71 | {\r | |
72 | UINTN DataSize;\r | |
73 | \r | |
74 | gCommunicationData.FunctionData.Status = EFI_UNSUPPORTED;\r | |
75 | \r | |
76 | if (IsInSmm()) {\r | |
77 | ///\r | |
78 | /// If in SMM mode, directly call services in SMM Base Helper.\r | |
79 | ///\r | |
80 | if (mSmmBaseHelperReady == NULL) {\r | |
81 | ASSERT (FALSE);\r | |
82 | return;\r | |
83 | }\r | |
84 | \r | |
85 | DataSize = (UINTN)(sizeof (SMMBASE_FUNCTION_DATA));\r | |
86 | mSmmBaseHelperReady->ServiceEntry (\r | |
87 | NULL,\r | |
88 | NULL,\r | |
89 | &gCommunicationData.FunctionData,\r | |
90 | &DataSize\r | |
91 | );\r | |
92 | } else {\r | |
93 | ///\r | |
94 | /// If in non-SMM mode, call services in SMM Base Helper via SMM Communication Protocol.\r | |
95 | ///\r | |
96 | if (mSmmCommunication == NULL) {\r | |
97 | ASSERT (FALSE);\r | |
98 | return;\r | |
99 | }\r | |
100 | \r | |
101 | DataSize = (UINTN)(sizeof (gCommunicationData));\r | |
102 | mSmmCommunication->Communicate (\r | |
103 | mSmmCommunication,\r | |
104 | &gCommunicationData,\r | |
105 | &DataSize\r | |
106 | );\r | |
107 | }\r | |
108 | }\r | |
109 | \r | |
110 | /**\r | |
111 | Register a given driver into SMRAM. This is the equivalent of performing\r | |
112 | the LoadImage/StartImage into System Management Mode.\r | |
113 | \r | |
114 | @param[in] This Protocol instance pointer.\r | |
115 | @param[in] FilePath Location of the image to be installed as the handler.\r | |
116 | @param[in] SourceBuffer Optional source buffer in case the image file\r | |
117 | is in memory.\r | |
118 | @param[in] SourceSize Size of the source image file, if in memory.\r | |
119 | @param[out] ImageHandle The handle that the base driver uses to decode \r | |
120 | the handler. Unique among SMM handlers only, \r | |
121 | not unique across DXE/EFI.\r | |
122 | @param[in] LegacyIA32Binary An optional parameter specifying that the associated \r | |
123 | file is a real-mode IA-32 binary.\r | |
124 | \r | |
125 | @retval EFI_SUCCESS The operation was successful.\r | |
126 | @retval EFI_OUT_OF_RESOURCES There were no additional SMRAM resources to load the handler\r | |
127 | @retval EFI_UNSUPPORTED This platform does not support 16-bit handlers.\r | |
128 | @retval EFI_UNSUPPORTED Platform is in runtime.\r | |
129 | @retval EFI_INVALID_PARAMETER The handlers was not the correct image type\r | |
130 | **/\r | |
131 | EFI_STATUS\r | |
132 | EFIAPI\r | |
133 | SmmBaseRegister (\r | |
134 | IN EFI_SMM_BASE_PROTOCOL *This,\r | |
135 | IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r | |
136 | IN VOID *SourceBuffer,\r | |
137 | IN UINTN SourceSize,\r | |
138 | OUT EFI_HANDLE *ImageHandle,\r | |
139 | IN BOOLEAN LegacyIA32Binary\r | |
140 | )\r | |
141 | {\r | |
142 | if (LegacyIA32Binary) {\r | |
143 | return EFI_UNSUPPORTED;\r | |
144 | }\r | |
145 | \r | |
146 | gCommunicationData.FunctionData.Function = SMMBASE_REGISTER;\r | |
147 | gCommunicationData.FunctionData.Args.Register.FilePath = FilePath;\r | |
148 | gCommunicationData.FunctionData.Args.Register.SourceBuffer = SourceBuffer;\r | |
149 | gCommunicationData.FunctionData.Args.Register.SourceSize = SourceSize;\r | |
150 | gCommunicationData.FunctionData.Args.Register.ImageHandle = ImageHandle;\r | |
151 | gCommunicationData.FunctionData.Args.Register.LegacyIA32Binary = LegacyIA32Binary;\r | |
152 | \r | |
153 | SmmBaseHelperService ();\r | |
154 | return gCommunicationData.FunctionData.Status;\r | |
155 | }\r | |
156 | \r | |
157 | /**\r | |
158 | Removes a handler from execution within SMRAM. This is the equivalent of performing\r | |
159 | the UnloadImage in System Management Mode.\r | |
160 | \r | |
161 | @param[in] This Protocol instance pointer.\r | |
162 | @param[in] ImageHandle The handler to be removed.\r | |
163 | \r | |
164 | @retval EFI_SUCCESS The operation was successful\r | |
165 | @retval EFI_INVALID_PARAMETER The handler did not exist\r | |
166 | @retval EFI_UNSUPPORTED Platform is in runtime.\r | |
167 | **/\r | |
168 | EFI_STATUS\r | |
169 | EFIAPI\r | |
170 | SmmBaseUnregister (\r | |
171 | IN EFI_SMM_BASE_PROTOCOL *This,\r | |
172 | IN EFI_HANDLE ImageHandle\r | |
173 | )\r | |
174 | {\r | |
175 | gCommunicationData.FunctionData.Function = SMMBASE_UNREGISTER;\r | |
176 | gCommunicationData.FunctionData.Args.UnRegister.ImageHandle = ImageHandle;\r | |
177 | \r | |
178 | SmmBaseHelperService ();\r | |
179 | return gCommunicationData.FunctionData.Status;\r | |
180 | }\r | |
181 | \r | |
182 | /**\r | |
183 | The SMM Inter-module Communicate Service Communicate() function\r | |
184 | provides a service to send/receive messages from a registered\r | |
185 | EFI service. The BASE protocol driver is responsible for doing\r | |
186 | any of the copies such that the data lives in boot-service-accessible RAM.\r | |
187 | \r | |
188 | @param[in] This Protocol instance pointer.\r | |
189 | @param[in] ImageHandle The handle of the registered driver.\r | |
190 | @param[in,out] CommunicationBuffer Pointer to the buffer to convey into SMRAM.\r | |
191 | @param[in,out] BufferSize The size of the data buffer being passed in.\r | |
192 | On exit, the size of data being returned.\r | |
193 | Zero if the handler does not wish to reply with any data.\r | |
194 | \r | |
195 | @retval EFI_SUCCESS The message was successfully posted\r | |
196 | @retval EFI_INVALID_PARAMETER The buffer was NULL\r | |
197 | **/\r | |
198 | EFI_STATUS\r | |
199 | EFIAPI\r | |
200 | SmmBaseCommunicate (\r | |
201 | IN EFI_SMM_BASE_PROTOCOL *This,\r | |
202 | IN EFI_HANDLE ImageHandle,\r | |
203 | IN OUT VOID *CommunicationBuffer,\r | |
204 | IN OUT UINTN *BufferSize\r | |
205 | )\r | |
206 | {\r | |
207 | if (mSmmCommunication == NULL) {\r | |
208 | ASSERT (FALSE);\r | |
209 | return EFI_UNSUPPORTED;\r | |
210 | }\r | |
211 | \r | |
212 | return mSmmCommunication->Communicate (\r | |
213 | mSmmCommunication,\r | |
214 | CommunicationBuffer,\r | |
215 | BufferSize\r | |
216 | );\r | |
217 | }\r | |
218 | \r | |
219 | /**\r | |
220 | Register a callback to execute within SMM.\r | |
221 | This allows receipt of messages created with EFI_SMM_BASE_PROTOCOL.Communicate().\r | |
222 | \r | |
223 | @param[in] This Protocol instance pointer.\r | |
224 | @param[in] SmmImageHandle Handle of the callback service.\r | |
225 | @param[in] CallbackAddress Address of the callback service.\r | |
226 | @param[in] MakeLast If present, will stipulate that the handler is posted to \r | |
227 | be executed last in the dispatch table.\r | |
228 | @param[in] FloatingPointSave An optional parameter that informs the\r | |
229 | EFI_SMM_ACCESS_PROTOCOL Driver core if it needs to save\r | |
230 | the floating point register state. If any handler\r | |
231 | require this, the state will be saved for all handlers.\r | |
232 | \r | |
233 | @retval EFI_SUCCESS The operation was successful\r | |
234 | @retval EFI_OUT_OF_RESOURCES Not enough space in the dispatch queue\r | |
235 | @retval EFI_UNSUPPORTED Platform is in runtime.\r | |
236 | @retval EFI_UNSUPPORTED The caller is not in SMM.\r | |
237 | **/\r | |
238 | EFI_STATUS\r | |
239 | EFIAPI\r | |
240 | SmmBaseRegisterCallback (\r | |
241 | IN EFI_SMM_BASE_PROTOCOL *This,\r | |
242 | IN EFI_HANDLE SmmImageHandle,\r | |
243 | IN EFI_SMM_CALLBACK_ENTRY_POINT CallbackAddress,\r | |
244 | IN BOOLEAN MakeLast,\r | |
245 | IN BOOLEAN FloatingPointSave\r | |
246 | )\r | |
247 | {\r | |
248 | if (!IsInSmm()) {\r | |
249 | return EFI_UNSUPPORTED;\r | |
250 | }\r | |
251 | \r | |
252 | gCommunicationData.FunctionData.Function = SMMBASE_REGISTER_CALLBACK;\r | |
253 | gCommunicationData.FunctionData.Args.RegisterCallback.SmmImageHandle = SmmImageHandle;\r | |
254 | gCommunicationData.FunctionData.Args.RegisterCallback.CallbackAddress = CallbackAddress;\r | |
255 | gCommunicationData.FunctionData.Args.RegisterCallback.MakeLast = MakeLast;\r | |
256 | gCommunicationData.FunctionData.Args.RegisterCallback.FloatingPointSave = FloatingPointSave;\r | |
257 | \r | |
258 | SmmBaseHelperService();\r | |
259 | return gCommunicationData.FunctionData.Status;\r | |
260 | }\r | |
261 | \r | |
262 | /**\r | |
263 | This routine tells caller if execution context is SMM or not.\r | |
264 | \r | |
265 | @param[in] This Protocol instance pointer.\r | |
266 | @param[out] InSmm Whether the caller is inside SMM for IA-32\r | |
267 | or servicing a PMI for the Itanium processor\r | |
268 | family.\r | |
269 | \r | |
270 | @retval EFI_SUCCESS The operation was successful\r | |
271 | @retval EFI_INVALID_PARAMETER InSmm was NULL.\r | |
272 | **/\r | |
273 | EFI_STATUS\r | |
274 | EFIAPI\r | |
275 | SmmBaseInSmm (\r | |
276 | IN EFI_SMM_BASE_PROTOCOL *This,\r | |
277 | OUT BOOLEAN *InSmm\r | |
278 | )\r | |
279 | {\r | |
280 | return mSmmBase2->InSmm (mSmmBase2, InSmm);\r | |
281 | }\r | |
282 | \r | |
283 | /**\r | |
284 | The SmmAllocatePool() function allocates a memory region of Size bytes from memory of\r | |
285 | type PoolType and returns the address of the allocated memory in the location referenced\r | |
286 | by Buffer. This function allocates pages from EFI SMRAM Memory as needed to grow the\r | |
287 | requested pool type. All allocations are eight-byte aligned.\r | |
288 | \r | |
289 | @param[in] This Protocol instance pointer.\r | |
290 | @param[in] PoolType The type of pool to allocate.\r | |
291 | The only supported type is EfiRuntimeServicesData;\r | |
292 | the interface will internally map this runtime request to \r | |
293 | SMRAM for IA-32 and leave as this type for the Itanium \r | |
294 | processor family. Other types can be ignored.\r | |
295 | @param[in] Size The number of bytes to allocate from the pool.\r | |
296 | @param[out] Buffer A pointer to a pointer to the allocated buffer if the call\r | |
297 | succeeds; undefined otherwise.\r | |
298 | \r | |
299 | @retval EFI_SUCCESS The requested number of bytes was allocated.\r | |
300 | @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated.\r | |
301 | @retval EFI_UNSUPPORTED Platform is in runtime.\r | |
302 | **/\r | |
303 | EFI_STATUS\r | |
304 | EFIAPI\r | |
305 | SmmBaseSmmAllocatePool (\r | |
306 | IN EFI_SMM_BASE_PROTOCOL *This,\r | |
307 | IN EFI_MEMORY_TYPE PoolType,\r | |
308 | IN UINTN Size,\r | |
309 | OUT VOID **Buffer\r | |
310 | )\r | |
311 | {\r | |
312 | gCommunicationData.FunctionData.Function = SMMBASE_ALLOCATE_POOL;\r | |
313 | gCommunicationData.FunctionData.Args.AllocatePool.PoolType = PoolType;\r | |
314 | gCommunicationData.FunctionData.Args.AllocatePool.Size = Size;\r | |
315 | gCommunicationData.FunctionData.Args.AllocatePool.Buffer = Buffer;\r | |
316 | \r | |
317 | SmmBaseHelperService ();\r | |
318 | return gCommunicationData.FunctionData.Status;\r | |
319 | }\r | |
320 | \r | |
321 | /**\r | |
322 | The SmmFreePool() function returns the memory specified by Buffer to the system.\r | |
323 | On return, the memory's type is EFI SMRAM Memory. The Buffer that is freed must\r | |
324 | have been allocated by SmmAllocatePool().\r | |
325 | \r | |
326 | @param[in] This Protocol instance pointer.\r | |
327 | @param[in] Buffer Pointer to the buffer allocation.\r | |
328 | \r | |
329 | @retval EFI_SUCCESS The memory was returned to the system.\r | |
330 | @retval EFI_INVALID_PARAMETER Buffer was invalid.\r | |
331 | @retval EFI_UNSUPPORTED Platform is in runtime.\r | |
332 | **/\r | |
333 | EFI_STATUS\r | |
334 | EFIAPI\r | |
335 | SmmBaseSmmFreePool (\r | |
336 | IN EFI_SMM_BASE_PROTOCOL *This,\r | |
337 | IN VOID *Buffer\r | |
338 | )\r | |
339 | {\r | |
340 | gCommunicationData.FunctionData.Function = SMMBASE_FREE_POOL;\r | |
341 | gCommunicationData.FunctionData.Args.FreePool.Buffer = Buffer;\r | |
342 | \r | |
343 | SmmBaseHelperService ();\r | |
344 | return gCommunicationData.FunctionData.Status;\r | |
345 | }\r | |
346 | \r | |
347 | /**\r | |
348 | The GetSmstLocation() function returns the location of the System Management\r | |
349 | Service Table. The use of the API is such that a driver can discover the\r | |
350 | location of the SMST in its entry point and then cache it in some driver\r | |
351 | global variable so that the SMST can be invoked in subsequent callbacks.\r | |
352 | \r | |
353 | @param[in] This Protocol instance pointer.\r | |
354 | @param[in] Smst Pointer to the SMST.\r | |
355 | \r | |
356 | @retval EFI_SUCCESS The operation was successful\r | |
357 | @retval EFI_INVALID_PARAMETER Smst was invalid.\r | |
358 | @retval EFI_UNSUPPORTED Not in SMM.\r | |
359 | **/\r | |
360 | EFI_STATUS\r | |
361 | EFIAPI\r | |
362 | SmmBaseGetSmstLocation (\r | |
363 | IN EFI_SMM_BASE_PROTOCOL *This,\r | |
364 | OUT EFI_SMM_SYSTEM_TABLE **Smst\r | |
365 | )\r | |
366 | {\r | |
367 | if (mSmmBaseHelperReady == NULL) {\r | |
368 | ASSERT (FALSE);\r | |
369 | return EFI_UNSUPPORTED;\r | |
370 | }\r | |
371 | \r | |
372 | if (!IsInSmm ()) {\r | |
373 | return EFI_UNSUPPORTED;\r | |
374 | }\r | |
375 | \r | |
376 | if (Smst == NULL) {\r | |
377 | return EFI_INVALID_PARAMETER;\r | |
378 | }\r | |
379 | \r | |
380 | *Smst = mSmmBaseHelperReady->FrameworkSmst;\r | |
381 | return EFI_SUCCESS;\r | |
382 | }\r | |
383 | \r | |
384 | /**\r | |
385 | SMM Base Protocol notification event handler.\r | |
386 | \r | |
387 | @param[in] Event Event whose notification function is being invoked.\r | |
388 | @param[in] Context Pointer to the notification function's context.\r | |
389 | **/\r | |
390 | VOID\r | |
391 | EFIAPI\r | |
392 | SmmBaseProtocolNotification (\r | |
393 | IN EFI_EVENT Event,\r | |
394 | IN VOID *Context\r | |
395 | )\r | |
396 | {\r | |
397 | EFI_STATUS Status;\r | |
398 | \r | |
399 | ///\r | |
400 | /// Assume only one instance of SMM Base2 Protocol in the system\r | |
401 | /// Locate SMM Base2 Protocol\r | |
402 | ///\r | |
403 | Status = gBS->LocateProtocol (&gEfiSmmBase2ProtocolGuid, NULL, (VOID **) &mSmmBase2);\r | |
404 | if (!EFI_ERROR (Status)) {\r | |
405 | ///\r | |
406 | /// Publish Framework SMM BASE Protocol immediately after SMM Base2 Protocol is installed to\r | |
407 | /// make SMM Base Protocol.InSmm() available as early as possible.\r | |
408 | ///\r | |
409 | Status = gBS->InstallProtocolInterface (\r | |
410 | &mImageHandle,\r | |
411 | &gEfiSmmBaseProtocolGuid,\r | |
412 | EFI_NATIVE_INTERFACE,\r | |
413 | &gSmmBase\r | |
414 | );\r | |
415 | ASSERT_EFI_ERROR (Status);\r | |
416 | }\r | |
417 | }\r | |
418 | \r | |
419 | /**\r | |
420 | SMM Communication Protocol notification event handler.\r | |
421 | \r | |
422 | @param[in] Event Event whose notification function is being invoked.\r | |
423 | @param[in] Context Pointer to the notification function's context.\r | |
424 | **/\r | |
425 | VOID\r | |
426 | EFIAPI\r | |
427 | SmmCommunicationProtocolNotification (\r | |
428 | IN EFI_EVENT Event,\r | |
429 | IN VOID *Context\r | |
430 | )\r | |
431 | {\r | |
432 | ///\r | |
433 | /// Assume only one instance of SMM Communication Protocol in the system\r | |
434 | /// Locate SMM Communication Protocol\r | |
435 | ///\r | |
436 | gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &mSmmCommunication);\r | |
437 | }\r | |
438 | \r | |
439 | /**\r | |
440 | SMM Base Helper Ready Protocol notification event handler.\r | |
441 | \r | |
442 | @param[in] Event Event whose notification function is being invoked.\r | |
443 | @param[in] Context Pointer to the notification function's context.\r | |
444 | **/\r | |
445 | VOID\r | |
446 | EFIAPI\r | |
447 | SmmBaseHelperReadyProtocolNotification (\r | |
448 | IN EFI_EVENT Event,\r | |
449 | IN VOID *Context\r | |
450 | )\r | |
451 | {\r | |
452 | ///\r | |
453 | /// Assume only one instance of SMM Base Helper Ready Protocol in the system\r | |
454 | /// Locate SMM Base Helper Ready Protocol\r | |
455 | ///\r | |
456 | gBS->LocateProtocol (&gEfiSmmBaseHelperReadyProtocolGuid, NULL, (VOID **) &mSmmBaseHelperReady);\r | |
457 | }\r | |
458 | \r | |
459 | /**\r | |
460 | Entry Point for SMM Base Protocol on SMM Base2 Protocol Thunk driver.\r | |
461 | \r | |
462 | @param[in] ImageHandle Image handle of this driver.\r | |
463 | @param[in] SystemTable A Pointer to the EFI System Table.\r | |
464 | \r | |
465 | @retval EFI_SUCCESS The entry point is executed successfully.\r | |
466 | **/\r | |
467 | EFI_STATUS\r | |
468 | EFIAPI\r | |
469 | SmmBaseThunkMain (\r | |
470 | IN EFI_HANDLE ImageHandle,\r | |
471 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
472 | )\r | |
473 | {\r | |
474 | VOID *Registration;\r | |
475 | \r | |
476 | mImageHandle = ImageHandle;\r | |
477 | \r | |
478 | ///\r | |
479 | /// Install notifications for required protocols\r | |
480 | ///\r | |
481 | /// Note we use protocol notifications here so as that this thunk driver can be\r | |
482 | /// loaded before PI SMM IPL driver. Framework SMM BASE Protocol will be published \r | |
483 | /// immediately after SMM Base2 Protocol is installed to make SMM Base Protocol.InSmm()\r | |
484 | /// available as early as possible because some Framework code's behavior depends on\r | |
485 | /// correct detection of SMM mode via SMM Base Protocol.InSmm().\r | |
486 | ///\r | |
487 | /// Also SMM Base Helper driver is expected to be dispatched\r | |
488 | /// in the earliest round of SMM driver dispatch just after SMM IPL driver loads SMM Foundation.\r | |
489 | /// So the full functionality of SMM Base Protocol is ready immediately after SMM IPL driver is\r | |
490 | /// loaded. Since that point Framework SMM driver can be succesufully supported.\r | |
491 | ///\r | |
492 | EfiCreateProtocolNotifyEvent (\r | |
493 | &gEfiSmmBase2ProtocolGuid,\r | |
494 | TPL_CALLBACK,\r | |
495 | SmmBaseProtocolNotification,\r | |
496 | NULL,\r | |
497 | &Registration\r | |
498 | );\r | |
499 | \r | |
500 | EfiCreateProtocolNotifyEvent (\r | |
501 | &gEfiSmmCommunicationProtocolGuid,\r | |
502 | TPL_CALLBACK,\r | |
503 | SmmCommunicationProtocolNotification,\r | |
504 | NULL,\r | |
505 | &Registration\r | |
506 | );\r | |
507 | \r | |
508 | EfiCreateProtocolNotifyEvent (\r | |
509 | &gEfiSmmBaseHelperReadyProtocolGuid,\r | |
510 | TPL_CALLBACK,\r | |
511 | SmmBaseHelperReadyProtocolNotification,\r | |
512 | NULL,\r | |
513 | &Registration\r | |
514 | );\r | |
515 | \r | |
516 | return EFI_SUCCESS;\r | |
517 | }\r | |
518 | \r |