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