]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/PiSmmCore/PiSmmCore.h
Add PI1.2.1 EndOfDxe support.
[mirror_edk2.git] / MdeModulePkg / Core / PiSmmCore / PiSmmCore.h
CommitLineData
e42e9404 1/** @file\r
2 The internal header file includes the common header files, defines\r
3 internal structure and functions used by SmmCore module.\r
4\r
c2cb08df 5 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
e42e9404 6 This program and the accompanying materials are licensed and made available \r
7 under the terms and conditions of the BSD License which accompanies this \r
8 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 _SMM_CORE_H_\r
17#define _SMM_CORE_H_\r
18\r
19#include <PiSmm.h>\r
20\r
21#include <Protocol/DxeSmmReadyToLock.h>\r
22#include <Protocol/SmmReadyToLock.h>\r
46ece1ff 23#include <Protocol/SmmEndOfDxe.h>\r
e42e9404 24#include <Protocol/CpuIo2.h>\r
25#include <Protocol/SmmCommunication.h>\r
26#include <Protocol/SmmAccess2.h>\r
27#include <Protocol/FirmwareVolume2.h> \r
28#include <Protocol/LoadedImage.h> \r
29#include <Protocol/DevicePath.h> \r
30#include <Protocol/Security.h> \r
bc2dfdbc 31#include <Protocol/Security2.h>\r
e42e9404 32\r
33#include <Guid/Apriori.h>\r
34#include <Guid/EventGroup.h>\r
35#include <Guid/EventLegacyBios.h>\r
36\r
37#include <Library/BaseLib.h>\r
38#include <Library/BaseMemoryLib.h>\r
39#include <Library/PeCoffLib.h>\r
40#include <Library/CacheMaintenanceLib.h>\r
41#include <Library/DebugLib.h>\r
42#include <Library/ReportStatusCodeLib.h>\r
43#include <Library/MemoryAllocationLib.h>\r
44#include <Library/DevicePathLib.h> \r
45#include <Library/UefiLib.h> \r
3c447c27 46#include <Library/UefiBootServicesTableLib.h>\r
47#include <Library/PcdLib.h>\r
495797c5 48#include <Library/SmmCorePlatformHookLib.h>\r
49#include <Library/PerformanceLib.h>\r
c2cb08df 50#include <Library/TimerLib.h>\r
e42e9404 51\r
52#include "PiSmmCorePrivateData.h"\r
53\r
54//\r
55// Used to build a table of SMI Handlers that the SMM Core registers\r
56//\r
57typedef struct {\r
58 EFI_SMM_HANDLER_ENTRY_POINT2 Handler;\r
59 EFI_GUID *HandlerType;\r
60 EFI_HANDLE DispatchHandle;\r
61 BOOLEAN UnRegister;\r
62} SMM_CORE_SMI_HANDLERS;\r
63\r
64//\r
65// Structure for recording the state of an SMM Driver\r
66//\r
67#define EFI_SMM_DRIVER_ENTRY_SIGNATURE SIGNATURE_32('s', 'd','r','v')\r
68\r
69typedef struct {\r
70 UINTN Signature;\r
71 LIST_ENTRY Link; // mDriverList\r
72\r
73 LIST_ENTRY ScheduledLink; // mScheduledQueue\r
74\r
75 EFI_HANDLE FvHandle;\r
76 EFI_GUID FileName;\r
77 EFI_DEVICE_PATH_PROTOCOL *FvFileDevicePath;\r
78 EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;\r
79\r
80 VOID *Depex;\r
81 UINTN DepexSize;\r
82\r
83 BOOLEAN Before;\r
84 BOOLEAN After;\r
85 EFI_GUID BeforeAfterGuid;\r
86\r
87 BOOLEAN Dependent;\r
e42e9404 88 BOOLEAN Scheduled;\r
e42e9404 89 BOOLEAN Initialized;\r
90 BOOLEAN DepexProtocolError;\r
91\r
92 EFI_HANDLE ImageHandle;\r
93 EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;\r
94 //\r
95 // Image EntryPoint in SMRAM\r
96 //\r
97 PHYSICAL_ADDRESS ImageEntryPoint;\r
98 //\r
99 // Image Buffer in SMRAM \r
100 //\r
101 PHYSICAL_ADDRESS ImageBuffer;\r
102 //\r
103 // Image Page Number\r
104 //\r
105 UINTN NumberOfPage;\r
106} EFI_SMM_DRIVER_ENTRY;\r
107\r
108#define EFI_HANDLE_SIGNATURE SIGNATURE_32('h','n','d','l')\r
109\r
110///\r
111/// IHANDLE - contains a list of protocol handles\r
112///\r
113typedef struct {\r
114 UINTN Signature;\r
115 /// All handles list of IHANDLE\r
116 LIST_ENTRY AllHandles;\r
117 /// List of PROTOCOL_INTERFACE's for this handle\r
118 LIST_ENTRY Protocols;\r
119 UINTN LocateRequest;\r
120} IHANDLE;\r
121\r
122#define ASSERT_IS_HANDLE(a) ASSERT((a)->Signature == EFI_HANDLE_SIGNATURE)\r
123\r
124#define PROTOCOL_ENTRY_SIGNATURE SIGNATURE_32('p','r','t','e')\r
125\r
126///\r
127/// PROTOCOL_ENTRY - each different protocol has 1 entry in the protocol\r
128/// database. Each handler that supports this protocol is listed, along\r
129/// with a list of registered notifies.\r
130///\r
131typedef struct {\r
132 UINTN Signature;\r
133 /// Link Entry inserted to mProtocolDatabase\r
134 LIST_ENTRY AllEntries;\r
135 /// ID of the protocol\r
136 EFI_GUID ProtocolID;\r
137 /// All protocol interfaces\r
138 LIST_ENTRY Protocols;\r
139 /// Registerd notification handlers\r
140 LIST_ENTRY Notify;\r
141} PROTOCOL_ENTRY;\r
142\r
143#define PROTOCOL_INTERFACE_SIGNATURE SIGNATURE_32('p','i','f','c')\r
144\r
145///\r
146/// PROTOCOL_INTERFACE - each protocol installed on a handle is tracked\r
147/// with a protocol interface structure\r
148///\r
149typedef struct {\r
150 UINTN Signature;\r
151 /// Link on IHANDLE.Protocols\r
152 LIST_ENTRY Link;\r
153 /// Back pointer\r
154 IHANDLE *Handle;\r
155 /// Link on PROTOCOL_ENTRY.Protocols\r
156 LIST_ENTRY ByProtocol;\r
157 /// The protocol ID\r
158 PROTOCOL_ENTRY *Protocol;\r
159 /// The interface value\r
160 VOID *Interface;\r
161} PROTOCOL_INTERFACE;\r
162\r
163#define PROTOCOL_NOTIFY_SIGNATURE SIGNATURE_32('p','r','t','n')\r
164\r
165///\r
166/// PROTOCOL_NOTIFY - used for each register notification for a protocol\r
167///\r
168typedef struct {\r
169 UINTN Signature;\r
170 PROTOCOL_ENTRY *Protocol;\r
171 /// All notifications for this protocol\r
172 LIST_ENTRY Link;\r
173 /// Notification function\r
174 EFI_SMM_NOTIFY_FN Function;\r
175 /// Last position notified\r
176 LIST_ENTRY *Position;\r
177} PROTOCOL_NOTIFY;\r
178\r
179//\r
180// SMM Core Global Variables\r
181//\r
182extern SMM_CORE_PRIVATE_DATA *gSmmCorePrivate;\r
183extern EFI_SMM_SYSTEM_TABLE2 gSmmCoreSmst;\r
184extern LIST_ENTRY gHandleList;\r
3c447c27 185extern EFI_PHYSICAL_ADDRESS gLoadModuleAtFixAddressSmramBase;\r
e42e9404 186\r
187/**\r
188 Called to initialize the memory service.\r
189\r
190 @param SmramRangeCount Number of SMRAM Regions\r
191 @param SmramRanges Pointer to SMRAM Descriptors\r
192\r
193**/\r
194VOID\r
195SmmInitializeMemoryServices (\r
196 IN UINTN SmramRangeCount,\r
197 IN EFI_SMRAM_DESCRIPTOR *SmramRanges\r
198 );\r
199\r
200/**\r
201 The SmmInstallConfigurationTable() function is used to maintain the list\r
202 of configuration tables that are stored in the System Management System\r
203 Table. The list is stored as an array of (GUID, Pointer) pairs. The list\r
204 must be allocated from pool memory with PoolType set to EfiRuntimeServicesData.\r
205\r
206 @param SystemTable A pointer to the SMM System Table (SMST).\r
207 @param Guid A pointer to the GUID for the entry to add, update, or remove.\r
208 @param Table A pointer to the buffer of the table to add.\r
209 @param TableSize The size of the table to install.\r
210\r
211 @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.\r
212 @retval EFI_INVALID_PARAMETER Guid is not valid.\r
213 @retval EFI_NOT_FOUND An attempt was made to delete a non-existent entry.\r
214 @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.\r
215\r
216**/\r
217EFI_STATUS\r
218EFIAPI\r
219SmmInstallConfigurationTable (\r
220 IN CONST EFI_SMM_SYSTEM_TABLE2 *SystemTable,\r
221 IN CONST EFI_GUID *Guid,\r
222 IN VOID *Table,\r
223 IN UINTN TableSize\r
224 );\r
225\r
226/**\r
227 Wrapper function to SmmInstallProtocolInterfaceNotify. This is the public API which\r
228 Calls the private one which contains a BOOLEAN parameter for notifications\r
229\r
230 @param UserHandle The handle to install the protocol handler on,\r
231 or NULL if a new handle is to be allocated\r
232 @param Protocol The protocol to add to the handle\r
233 @param InterfaceType Indicates whether Interface is supplied in\r
234 native form.\r
235 @param Interface The interface for the protocol being added\r
236\r
237 @return Status code\r
238\r
239**/\r
240EFI_STATUS\r
241EFIAPI\r
242SmmInstallProtocolInterface (\r
243 IN OUT EFI_HANDLE *UserHandle,\r
244 IN EFI_GUID *Protocol,\r
245 IN EFI_INTERFACE_TYPE InterfaceType,\r
246 IN VOID *Interface\r
247 );\r
248\r
249/**\r
250 Allocates pages from the memory map.\r
251\r
252 @param Type The type of allocation to perform\r
253 @param MemoryType The type of memory to turn the allocated pages\r
254 into\r
255 @param NumberOfPages The number of pages to allocate\r
256 @param Memory A pointer to receive the base allocated memory\r
257 address\r
258\r
259 @retval EFI_INVALID_PARAMETER Parameters violate checking rules defined in spec.\r
260 @retval EFI_NOT_FOUND Could not allocate pages match the requirement.\r
261 @retval EFI_OUT_OF_RESOURCES No enough pages to allocate.\r
262 @retval EFI_SUCCESS Pages successfully allocated.\r
263\r
264**/\r
265EFI_STATUS\r
266EFIAPI\r
267SmmAllocatePages (\r
268 IN EFI_ALLOCATE_TYPE Type,\r
269 IN EFI_MEMORY_TYPE MemoryType,\r
270 IN UINTN NumberOfPages,\r
271 OUT EFI_PHYSICAL_ADDRESS *Memory\r
272 );\r
273\r
274/**\r
275 Frees previous allocated pages.\r
276\r
277 @param Memory Base address of memory being freed\r
278 @param NumberOfPages The number of pages to free\r
279\r
280 @retval EFI_NOT_FOUND Could not find the entry that covers the range\r
281 @retval EFI_INVALID_PARAMETER Address not aligned\r
282 @return EFI_SUCCESS Pages successfully freed.\r
283\r
284**/\r
285EFI_STATUS\r
286EFIAPI\r
287SmmFreePages (\r
288 IN EFI_PHYSICAL_ADDRESS Memory,\r
289 IN UINTN NumberOfPages\r
290 );\r
291\r
292/**\r
293 Allocate pool of a particular type.\r
294\r
295 @param PoolType Type of pool to allocate\r
296 @param Size The amount of pool to allocate\r
297 @param Buffer The address to return a pointer to the allocated\r
298 pool\r
299\r
300 @retval EFI_INVALID_PARAMETER PoolType not valid\r
301 @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.\r
302 @retval EFI_SUCCESS Pool successfully allocated.\r
303\r
304**/\r
305EFI_STATUS\r
306EFIAPI\r
307SmmAllocatePool (\r
308 IN EFI_MEMORY_TYPE PoolType,\r
309 IN UINTN Size,\r
310 OUT VOID **Buffer\r
311 );\r
312\r
313/**\r
314 Frees pool.\r
315\r
316 @param Buffer The allocated pool entry to free\r
317\r
318 @retval EFI_INVALID_PARAMETER Buffer is not a valid value.\r
319 @retval EFI_SUCCESS Pool successfully freed.\r
320\r
321**/\r
322EFI_STATUS\r
323EFIAPI\r
324SmmFreePool (\r
325 IN VOID *Buffer\r
326 );\r
327\r
328/**\r
329 Installs a protocol interface into the boot services environment.\r
330\r
331 @param UserHandle The handle to install the protocol handler on,\r
332 or NULL if a new handle is to be allocated\r
333 @param Protocol The protocol to add to the handle\r
334 @param InterfaceType Indicates whether Interface is supplied in\r
335 native form.\r
336 @param Interface The interface for the protocol being added\r
337 @param Notify indicates whether notify the notification list\r
338 for this protocol\r
339\r
340 @retval EFI_INVALID_PARAMETER Invalid parameter\r
341 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
342 @retval EFI_SUCCESS Protocol interface successfully installed\r
343\r
344**/\r
345EFI_STATUS\r
346SmmInstallProtocolInterfaceNotify (\r
347 IN OUT EFI_HANDLE *UserHandle,\r
348 IN EFI_GUID *Protocol,\r
349 IN EFI_INTERFACE_TYPE InterfaceType,\r
350 IN VOID *Interface,\r
351 IN BOOLEAN Notify\r
352 );\r
353\r
354/**\r
355 Uninstalls all instances of a protocol:interfacer from a handle.\r
356 If the last protocol interface is remove from the handle, the\r
357 handle is freed.\r
358\r
359 @param UserHandle The handle to remove the protocol handler from\r
360 @param Protocol The protocol, of protocol:interface, to remove\r
361 @param Interface The interface, of protocol:interface, to remove\r
362\r
363 @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
364 @retval EFI_SUCCESS Protocol interface successfully uninstalled.\r
365\r
366**/\r
367EFI_STATUS\r
368EFIAPI\r
369SmmUninstallProtocolInterface (\r
370 IN EFI_HANDLE UserHandle,\r
371 IN EFI_GUID *Protocol,\r
372 IN VOID *Interface\r
373 );\r
374\r
375/**\r
376 Queries a handle to determine if it supports a specified protocol.\r
377\r
378 @param UserHandle The handle being queried.\r
379 @param Protocol The published unique identifier of the protocol.\r
380 @param Interface Supplies the address where a pointer to the\r
381 corresponding Protocol Interface is returned.\r
382\r
383 @return The requested protocol interface for the handle\r
384\r
385**/\r
386EFI_STATUS\r
387EFIAPI\r
388SmmHandleProtocol (\r
389 IN EFI_HANDLE UserHandle,\r
390 IN EFI_GUID *Protocol,\r
391 OUT VOID **Interface\r
392 );\r
393\r
394/**\r
395 Add a new protocol notification record for the request protocol.\r
396\r
397 @param Protocol The requested protocol to add the notify\r
398 registration\r
399 @param Function Points to the notification function\r
400 @param Registration Returns the registration record\r
401\r
402 @retval EFI_INVALID_PARAMETER Invalid parameter\r
403 @retval EFI_SUCCESS Successfully returned the registration record\r
404 that has been added\r
405\r
406**/\r
407EFI_STATUS\r
408EFIAPI\r
409SmmRegisterProtocolNotify (\r
410 IN CONST EFI_GUID *Protocol,\r
411 IN EFI_SMM_NOTIFY_FN Function,\r
412 OUT VOID **Registration\r
413 );\r
414\r
415/**\r
416 Locates the requested handle(s) and returns them in Buffer.\r
417\r
418 @param SearchType The type of search to perform to locate the\r
419 handles\r
420 @param Protocol The protocol to search for\r
421 @param SearchKey Dependant on SearchType\r
422 @param BufferSize On input the size of Buffer. On output the\r
423 size of data returned.\r
424 @param Buffer The buffer to return the results in\r
425\r
426 @retval EFI_BUFFER_TOO_SMALL Buffer too small, required buffer size is\r
427 returned in BufferSize.\r
428 @retval EFI_INVALID_PARAMETER Invalid parameter\r
429 @retval EFI_SUCCESS Successfully found the requested handle(s) and\r
430 returns them in Buffer.\r
431\r
432**/\r
433EFI_STATUS\r
434EFIAPI\r
435SmmLocateHandle (\r
436 IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
437 IN EFI_GUID *Protocol OPTIONAL,\r
438 IN VOID *SearchKey OPTIONAL,\r
439 IN OUT UINTN *BufferSize,\r
440 OUT EFI_HANDLE *Buffer\r
441 );\r
442\r
443/**\r
444 Return the first Protocol Interface that matches the Protocol GUID. If\r
445 Registration is pasased in return a Protocol Instance that was just add\r
446 to the system. If Retistration is NULL return the first Protocol Interface\r
447 you find.\r
448\r
449 @param Protocol The protocol to search for\r
450 @param Registration Optional Registration Key returned from\r
451 RegisterProtocolNotify()\r
452 @param Interface Return the Protocol interface (instance).\r
453\r
454 @retval EFI_SUCCESS If a valid Interface is returned\r
455 @retval EFI_INVALID_PARAMETER Invalid parameter\r
456 @retval EFI_NOT_FOUND Protocol interface not found\r
457\r
458**/\r
459EFI_STATUS\r
460EFIAPI\r
461SmmLocateProtocol (\r
462 IN EFI_GUID *Protocol,\r
463 IN VOID *Registration OPTIONAL,\r
464 OUT VOID **Interface\r
465 );\r
466\r
467/**\r
468 Manage SMI of a particular type.\r
469\r
470 @param HandlerType Points to the handler type or NULL for root SMI handlers.\r
471 @param Context Points to an optional context buffer.\r
472 @param CommBuffer Points to the optional communication buffer.\r
473 @param CommBufferSize Points to the size of the optional communication buffer.\r
474\r
475 @retval EFI_SUCCESS Interrupt source was processed successfully but not quiesced.\r
476 @retval EFI_INTERRUPT_PENDING One or more SMI sources could not be quiesced.\r
477 @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was not handled or quiesced.\r
478 @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED Interrupt source was handled and quiesced.\r
479\r
480**/\r
481EFI_STATUS\r
482EFIAPI\r
483SmiManage (\r
484 IN CONST EFI_GUID *HandlerType,\r
485 IN CONST VOID *Context OPTIONAL,\r
486 IN OUT VOID *CommBuffer OPTIONAL,\r
487 IN OUT UINTN *CommBufferSize OPTIONAL\r
488 );\r
489\r
490/**\r
491 Registers a handler to execute within SMM.\r
492\r
493 @param Handler Handler service funtion pointer.\r
494 @param HandlerType Points to the handler type or NULL for root SMI handlers.\r
495 @param DispatchHandle On return, contains a unique handle which can be used to later unregister the handler function.\r
496\r
497 @retval EFI_SUCCESS Handler register success.\r
498 @retval EFI_INVALID_PARAMETER Handler or DispatchHandle is NULL.\r
499\r
500**/\r
501EFI_STATUS\r
502EFIAPI\r
503SmiHandlerRegister (\r
504 IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,\r
505 IN CONST EFI_GUID *HandlerType OPTIONAL,\r
506 OUT EFI_HANDLE *DispatchHandle\r
507 );\r
508\r
509/**\r
510 Unregister a handler in SMM.\r
511\r
512 @param DispatchHandle The handle that was specified when the handler was registered.\r
513\r
514 @retval EFI_SUCCESS Handler function was successfully unregistered.\r
515 @retval EFI_INVALID_PARAMETER DispatchHandle does not refer to a valid handle.\r
516\r
517**/\r
518EFI_STATUS\r
519EFIAPI\r
520SmiHandlerUnRegister (\r
521 IN EFI_HANDLE DispatchHandle\r
522 );\r
523\r
524/**\r
525 This function is the main entry point for an SMM handler dispatch\r
526 or communicate-based callback.\r
527\r
528 @param DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister().\r
529 @param Context Points to an optional handler context which was specified when the handler was registered.\r
530 @param CommBuffer A pointer to a collection of data in memory that will\r
531 be conveyed from a non-SMM environment into an SMM environment.\r
532 @param CommBufferSize The size of the CommBuffer.\r
533\r
534 @return Status Code\r
535\r
536**/\r
537EFI_STATUS\r
538EFIAPI\r
539SmmDriverDispatchHandler (\r
540 IN EFI_HANDLE DispatchHandle,\r
541 IN CONST VOID *Context, OPTIONAL\r
542 IN OUT VOID *CommBuffer, OPTIONAL\r
543 IN OUT UINTN *CommBufferSize OPTIONAL\r
544 );\r
545\r
546/**\r
547 This function is the main entry point for an SMM handler dispatch\r
548 or communicate-based callback.\r
549\r
550 @param DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister().\r
551 @param Context Points to an optional handler context which was specified when the handler was registered.\r
552 @param CommBuffer A pointer to a collection of data in memory that will\r
553 be conveyed from a non-SMM environment into an SMM environment.\r
554 @param CommBufferSize The size of the CommBuffer.\r
555\r
556 @return Status Code\r
557\r
558**/\r
559EFI_STATUS\r
560EFIAPI\r
561SmmLegacyBootHandler (\r
562 IN EFI_HANDLE DispatchHandle,\r
563 IN CONST VOID *Context, OPTIONAL\r
564 IN OUT VOID *CommBuffer, OPTIONAL\r
565 IN OUT UINTN *CommBufferSize OPTIONAL\r
566 );\r
567\r
568/**\r
569 This function is the main entry point for an SMM handler dispatch\r
570 or communicate-based callback.\r
571\r
572 @param DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister().\r
573 @param Context Points to an optional handler context which was specified when the handler was registered.\r
574 @param CommBuffer A pointer to a collection of data in memory that will\r
575 be conveyed from a non-SMM environment into an SMM environment.\r
576 @param CommBufferSize The size of the CommBuffer.\r
577\r
578 @return Status Code\r
579\r
580**/\r
581EFI_STATUS\r
582EFIAPI\r
583SmmReadyToLockHandler (\r
584 IN EFI_HANDLE DispatchHandle,\r
585 IN CONST VOID *Context, OPTIONAL\r
586 IN OUT VOID *CommBuffer, OPTIONAL\r
587 IN OUT UINTN *CommBufferSize OPTIONAL\r
588 );\r
589\r
46ece1ff
JY
590/**\r
591 This function is the main entry point for an SMM handler dispatch\r
592 or communicate-based callback.\r
593\r
594 @param DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister().\r
595 @param Context Points to an optional handler context which was specified when the handler was registered.\r
596 @param CommBuffer A pointer to a collection of data in memory that will\r
597 be conveyed from a non-SMM environment into an SMM environment.\r
598 @param CommBufferSize The size of the CommBuffer.\r
599\r
600 @return Status Code\r
601\r
602**/\r
603EFI_STATUS\r
604EFIAPI\r
605SmmEndOfDxeHandler (\r
606 IN EFI_HANDLE DispatchHandle,\r
607 IN CONST VOID *Context, OPTIONAL\r
608 IN OUT VOID *CommBuffer, OPTIONAL\r
609 IN OUT UINTN *CommBufferSize OPTIONAL\r
610 );\r
611\r
e42e9404 612/**\r
613 Place holder function until all the SMM System Table Service are available.\r
614\r
615 @param Arg1 Undefined\r
616 @param Arg2 Undefined\r
617 @param Arg3 Undefined\r
618 @param Arg4 Undefined\r
619 @param Arg5 Undefined\r
620\r
621 @return EFI_NOT_AVAILABLE_YET\r
622\r
623**/\r
624EFI_STATUS\r
625EFIAPI\r
626SmmEfiNotAvailableYetArg5 (\r
627 UINTN Arg1,\r
628 UINTN Arg2,\r
629 UINTN Arg3,\r
630 UINTN Arg4,\r
631 UINTN Arg5\r
632 );\r
633\r
634//\r
635//Functions used during debug buils\r
636//\r
637\r
638/**\r
639 Traverse the discovered list for any drivers that were discovered but not loaded\r
640 because the dependency experessions evaluated to false.\r
641\r
642**/\r
643VOID\r
644SmmDisplayDiscoveredNotDispatched (\r
645 VOID\r
646 );\r
647\r
648/**\r
649 Add free SMRAM region for use by memory service.\r
650\r
651 @param MemBase Base address of memory region.\r
652 @param MemLength Length of the memory region.\r
653 @param Type Memory type.\r
654 @param Attributes Memory region state.\r
655\r
656**/\r
657VOID\r
658SmmAddMemoryRegion (\r
659 IN EFI_PHYSICAL_ADDRESS MemBase,\r
660 IN UINT64 MemLength,\r
661 IN EFI_MEMORY_TYPE Type,\r
662 IN UINT64 Attributes\r
663 );\r
664\r
665/**\r
666 Finds the protocol entry for the requested protocol.\r
667\r
668 @param Protocol The ID of the protocol\r
669 @param Create Create a new entry if not found\r
670\r
671 @return Protocol entry\r
672\r
673**/\r
674PROTOCOL_ENTRY *\r
675SmmFindProtocolEntry (\r
676 IN EFI_GUID *Protocol,\r
677 IN BOOLEAN Create\r
678 );\r
679\r
680/**\r
681 Signal event for every protocol in protocol entry.\r
682\r
683 @param Prot Protocol interface\r
684\r
685**/\r
686VOID\r
687SmmNotifyProtocol (\r
688 IN PROTOCOL_INTERFACE *Prot\r
689 );\r
690\r
691/**\r
692 Finds the protocol instance for the requested handle and protocol.\r
693 Note: This function doesn't do parameters checking, it's caller's responsibility\r
694 to pass in valid parameters.\r
695\r
696 @param Handle The handle to search the protocol on\r
697 @param Protocol GUID of the protocol\r
698 @param Interface The interface for the protocol being searched\r
699\r
700 @return Protocol instance (NULL: Not found)\r
701\r
702**/\r
703PROTOCOL_INTERFACE *\r
704SmmFindProtocolInterface (\r
705 IN IHANDLE *Handle,\r
706 IN EFI_GUID *Protocol,\r
707 IN VOID *Interface\r
708 );\r
709\r
710/**\r
711 Removes Protocol from the protocol list (but not the handle list).\r
712\r
713 @param Handle The handle to remove protocol on.\r
714 @param Protocol GUID of the protocol to be moved\r
715 @param Interface The interface of the protocol\r
716\r
717 @return Protocol Entry\r
718\r
719**/\r
720PROTOCOL_INTERFACE *\r
721SmmRemoveInterfaceFromProtocol (\r
722 IN IHANDLE *Handle,\r
723 IN EFI_GUID *Protocol,\r
724 IN VOID *Interface\r
725 );\r
726\r
727/**\r
728 This is the POSTFIX version of the dependency evaluator. This code does\r
729 not need to handle Before or After, as it is not valid to call this\r
fa542a1e 730 routine in this case. POSTFIX means all the math is done on top of the stack.\r
e42e9404 731\r
732 @param DriverEntry DriverEntry element to update.\r
733\r
734 @retval TRUE If driver is ready to run.\r
735 @retval FALSE If driver is not ready to run or some fatal error\r
736 was found.\r
737\r
738**/\r
739BOOLEAN\r
740SmmIsSchedulable (\r
741 IN EFI_SMM_DRIVER_ENTRY *DriverEntry\r
742 );\r
743\r
744#endif\r