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