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