]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Core/Dxe/DxeMain.h
Measure ExitBootServices failure case
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain.h
... / ...
CommitLineData
1/** @file\r
2 The internal header file includes the common header files, defines\r
3 internal structure and functions used by DxeCore module.\r
4\r
5Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
6This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _DXE_MAIN_H_\r
17#define _DXE_MAIN_H_\r
18\r
19\r
20\r
21#include <PiDxe.h>\r
22\r
23#include <Protocol/LoadedImage.h>\r
24#include <Protocol/GuidedSectionExtraction.h>\r
25#include <Protocol/DevicePath.h>\r
26#include <Protocol/Runtime.h>\r
27#include <Protocol/LoadFile.h>\r
28#include <Protocol/LoadFile2.h>\r
29#include <Protocol/DriverBinding.h>\r
30#include <Protocol/VariableWrite.h>\r
31#include <Protocol/PlatformDriverOverride.h>\r
32#include <Protocol/Variable.h>\r
33#include <Protocol/Timer.h>\r
34#include <Protocol/SimpleFileSystem.h>\r
35#include <Protocol/Bds.h>\r
36#include <Protocol/RealTimeClock.h>\r
37#include <Protocol/WatchdogTimer.h>\r
38#include <Protocol/FirmwareVolume2.h>\r
39#include <Protocol/MonotonicCounter.h>\r
40#include <Protocol/StatusCode.h>\r
41#include <Protocol/Decompress.h>\r
42#include <Protocol/LoadPe32Image.h>\r
43#include <Protocol/Security.h>\r
44#include <Protocol/Ebc.h>\r
45#include <Protocol/Reset.h>\r
46#include <Protocol/Cpu.h>\r
47#include <Protocol/Metronome.h>\r
48#include <Protocol/FirmwareVolumeBlock.h>\r
49#include <Protocol/Capsule.h>\r
50#include <Protocol/BusSpecificDriverOverride.h>\r
51#include <Protocol/DriverFamilyOverride.h>\r
52#include <Protocol/TcgService.h>\r
53#include <Protocol/HiiPackageList.h>\r
54#include <Protocol/SmmBase2.h>\r
55#include <Guid/MemoryTypeInformation.h>\r
56#include <Guid/FirmwareFileSystem2.h>\r
57#include <Guid/FirmwareFileSystem3.h>\r
58#include <Guid/HobList.h>\r
59#include <Guid/DebugImageInfoTable.h>\r
60#include <Guid/FileInfo.h>\r
61#include <Guid/Apriori.h>\r
62#include <Guid/DxeServices.h>\r
63#include <Guid/MemoryAllocationHob.h>\r
64#include <Guid/EventLegacyBios.h>\r
65#include <Guid/EventGroup.h>\r
66#include <Guid/LoadModuleAtFixedAddress.h>\r
67#include <Guid/IdleLoopEvent.h>\r
68\r
69#include <Library/DxeCoreEntryPoint.h>\r
70#include <Library/DebugLib.h>\r
71#include <Library/UefiLib.h>\r
72#include <Library/BaseLib.h>\r
73#include <Library/HobLib.h>\r
74#include <Library/PerformanceLib.h>\r
75#include <Library/UefiDecompressLib.h>\r
76#include <Library/ExtractGuidedSectionLib.h>\r
77#include <Library/CacheMaintenanceLib.h>\r
78#include <Library/BaseMemoryLib.h>\r
79#include <Library/PeCoffLib.h>\r
80#include <Library/PeCoffGetEntryPointLib.h>\r
81#include <Library/PeCoffExtraActionLib.h>\r
82#include <Library/PcdLib.h>\r
83#include <Library/MemoryAllocationLib.h>\r
84#include <Library/DevicePathLib.h>\r
85#include <Library/UefiBootServicesTableLib.h>\r
86#include <Library/ReportStatusCodeLib.h>\r
87#include <Library/TimerLib.h>\r
88#include <Library/DxeServicesLib.h>\r
89#include <Library/DebugAgentLib.h>\r
90#include <Library/CpuExceptionHandlerLib.h>\r
91\r
92\r
93//\r
94// attributes for reserved memory before it is promoted to system memory\r
95//\r
96#define EFI_MEMORY_PRESENT 0x0100000000000000ULL\r
97#define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL\r
98#define EFI_MEMORY_TESTED 0x0400000000000000ULL\r
99\r
100//\r
101// range for memory mapped port I/O on IPF\r
102//\r
103#define EFI_MEMORY_PORT_IO 0x4000000000000000ULL\r
104\r
105\r
106///\r
107/// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependecy expression\r
108/// to save time. A EFI_DEP_PUSH is evauated one an\r
109/// replaced with EFI_DEP_REPLACE_TRUE. If PI spec's Vol 2\r
110/// Driver Execution Environment Core Interface use 0xff\r
111/// as new DEPEX opcode. EFI_DEP_REPLACE_TRUE should be\r
112/// defined to a new value that is not conflicting with PI spec.\r
113///\r
114#define EFI_DEP_REPLACE_TRUE 0xff\r
115\r
116///\r
117/// Define the initial size of the dependency expression evaluation stack\r
118///\r
119#define DEPEX_STACK_SIZE_INCREMENT 0x1000\r
120\r
121typedef struct {\r
122 EFI_GUID *ProtocolGuid;\r
123 VOID **Protocol;\r
124 EFI_EVENT Event;\r
125 VOID *Registration;\r
126 BOOLEAN Present;\r
127} EFI_CORE_PROTOCOL_NOTIFY_ENTRY;\r
128\r
129//\r
130// DXE Dispatcher Data structures\r
131//\r
132\r
133#define KNOWN_HANDLE_SIGNATURE SIGNATURE_32('k','n','o','w')\r
134typedef struct {\r
135 UINTN Signature;\r
136 LIST_ENTRY Link; // mFvHandleList\r
137 EFI_HANDLE Handle;\r
138 EFI_GUID FvNameGuid;\r
139} KNOWN_HANDLE;\r
140\r
141\r
142#define EFI_CORE_DRIVER_ENTRY_SIGNATURE SIGNATURE_32('d','r','v','r')\r
143typedef struct {\r
144 UINTN Signature;\r
145 LIST_ENTRY Link; // mDriverList\r
146\r
147 LIST_ENTRY ScheduledLink; // mScheduledQueue\r
148\r
149 EFI_HANDLE FvHandle;\r
150 EFI_GUID FileName;\r
151 EFI_DEVICE_PATH_PROTOCOL *FvFileDevicePath;\r
152 EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;\r
153\r
154 VOID *Depex;\r
155 UINTN DepexSize;\r
156\r
157 BOOLEAN Before;\r
158 BOOLEAN After;\r
159 EFI_GUID BeforeAfterGuid;\r
160\r
161 BOOLEAN Dependent;\r
162 BOOLEAN Unrequested;\r
163 BOOLEAN Scheduled;\r
164 BOOLEAN Untrusted;\r
165 BOOLEAN Initialized;\r
166 BOOLEAN DepexProtocolError;\r
167\r
168 EFI_HANDLE ImageHandle;\r
169 BOOLEAN IsFvImage;\r
170\r
171} EFI_CORE_DRIVER_ENTRY;\r
172\r
173//\r
174//The data structure of GCD memory map entry\r
175//\r
176#define EFI_GCD_MAP_SIGNATURE SIGNATURE_32('g','c','d','m')\r
177typedef struct {\r
178 UINTN Signature;\r
179 LIST_ENTRY Link;\r
180 EFI_PHYSICAL_ADDRESS BaseAddress;\r
181 UINT64 EndAddress;\r
182 UINT64 Capabilities;\r
183 UINT64 Attributes;\r
184 EFI_GCD_MEMORY_TYPE GcdMemoryType;\r
185 EFI_GCD_IO_TYPE GcdIoType;\r
186 EFI_HANDLE ImageHandle;\r
187 EFI_HANDLE DeviceHandle;\r
188} EFI_GCD_MAP_ENTRY;\r
189\r
190//\r
191// DXE Core Global Variables\r
192//\r
193extern EFI_SYSTEM_TABLE *gDxeCoreST;\r
194extern EFI_RUNTIME_SERVICES *gDxeCoreRT;\r
195extern EFI_DXE_SERVICES *gDxeCoreDS;\r
196extern EFI_HANDLE gDxeCoreImageHandle;\r
197\r
198extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;\r
199\r
200extern EFI_RUNTIME_ARCH_PROTOCOL *gRuntime;\r
201extern EFI_CPU_ARCH_PROTOCOL *gCpu;\r
202extern EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *gWatchdogTimer;\r
203extern EFI_METRONOME_ARCH_PROTOCOL *gMetronome;\r
204extern EFI_TIMER_ARCH_PROTOCOL *gTimer;\r
205extern EFI_SECURITY_ARCH_PROTOCOL *gSecurity;\r
206extern EFI_BDS_ARCH_PROTOCOL *gBds;\r
207extern EFI_SMM_BASE2_PROTOCOL *gSmmBase2;\r
208\r
209extern EFI_TPL gEfiCurrentTpl;\r
210\r
211extern EFI_GUID *gDxeCoreFileName;\r
212extern EFI_LOADED_IMAGE_PROTOCOL *gDxeCoreLoadedImage;\r
213\r
214extern EFI_MEMORY_TYPE_INFORMATION gMemoryTypeInformation[EfiMaxMemoryType + 1];\r
215\r
216extern BOOLEAN gDispatcherRunning;\r
217extern EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate;\r
218\r
219extern EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE gLoadModuleAtFixAddressConfigurationTable;\r
220extern BOOLEAN gLoadFixedAddressCodeMemoryReady;\r
221//\r
222// Service Initialization Functions\r
223//\r
224\r
225\r
226\r
227/**\r
228 Called to initialize the pool.\r
229\r
230**/\r
231VOID\r
232CoreInitializePool (\r
233 VOID\r
234 );\r
235\r
236\r
237/**\r
238 Called to initialize the memory map and add descriptors to\r
239 the current descriptor list.\r
240 The first descriptor that is added must be general usable\r
241 memory as the addition allocates heap.\r
242\r
243 @param Type The type of memory to add\r
244 @param Start The starting address in the memory range Must be\r
245 page aligned\r
246 @param NumberOfPages The number of pages in the range\r
247 @param Attribute Attributes of the memory to add\r
248\r
249 @return None. The range is added to the memory map\r
250\r
251**/\r
252VOID\r
253CoreAddMemoryDescriptor (\r
254 IN EFI_MEMORY_TYPE Type,\r
255 IN EFI_PHYSICAL_ADDRESS Start,\r
256 IN UINT64 NumberOfPages,\r
257 IN UINT64 Attribute\r
258 );\r
259\r
260\r
261/**\r
262 Release memory lock on mGcdMemorySpaceLock.\r
263\r
264**/\r
265VOID\r
266CoreReleaseGcdMemoryLock (\r
267 VOID\r
268 );\r
269\r
270\r
271/**\r
272 Acquire memory lock on mGcdMemorySpaceLock.\r
273\r
274**/\r
275VOID\r
276CoreAcquireGcdMemoryLock (\r
277 VOID\r
278 );\r
279\r
280\r
281/**\r
282 External function. Initializes memory services based on the memory\r
283 descriptor HOBs. This function is responsible for priming the memory\r
284 map, so memory allocations and resource allocations can be made.\r
285 The first part of this function can not depend on any memory services\r
286 until at least one memory descriptor is provided to the memory services.\r
287\r
288 @param HobStart The start address of the HOB.\r
289 @param MemoryBaseAddress Start address of memory region found to init DXE\r
290 core.\r
291 @param MemoryLength Length of memory region found to init DXE core.\r
292\r
293 @retval EFI_SUCCESS Memory services successfully initialized.\r
294\r
295**/\r
296EFI_STATUS\r
297CoreInitializeMemoryServices (\r
298 IN VOID **HobStart,\r
299 OUT EFI_PHYSICAL_ADDRESS *MemoryBaseAddress,\r
300 OUT UINT64 *MemoryLength\r
301 );\r
302\r
303\r
304\r
305/**\r
306 External function. Initializes the GCD and memory services based on the memory\r
307 descriptor HOBs. This function is responsible for priming the GCD map and the\r
308 memory map, so memory allocations and resource allocations can be made. The\r
309 HobStart will be relocated to a pool buffer.\r
310\r
311 @param HobStart The start address of the HOB\r
312 @param MemoryBaseAddress Start address of memory region found to init DXE\r
313 core.\r
314 @param MemoryLength Length of memory region found to init DXE core.\r
315\r
316 @retval EFI_SUCCESS GCD services successfully initialized.\r
317\r
318**/\r
319EFI_STATUS\r
320CoreInitializeGcdServices (\r
321 IN OUT VOID **HobStart,\r
322 IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress,\r
323 IN UINT64 MemoryLength\r
324 );\r
325\r
326\r
327/**\r
328 Initializes "event" support.\r
329\r
330 @retval EFI_SUCCESS Always return success\r
331\r
332**/\r
333EFI_STATUS\r
334CoreInitializeEventServices (\r
335 VOID\r
336 );\r
337\r
338\r
339/**\r
340 Add the Image Services to EFI Boot Services Table and install the protocol\r
341 interfaces for this image.\r
342\r
343 @param HobStart The HOB to initialize\r
344\r
345 @return Status code.\r
346\r
347**/\r
348EFI_STATUS\r
349CoreInitializeImageServices (\r
350 IN VOID *HobStart\r
351 );\r
352\r
353\r
354/**\r
355 Creates an event that is fired everytime a Protocol of a specific type is installed.\r
356\r
357**/\r
358VOID\r
359CoreNotifyOnProtocolInstallation (\r
360 VOID\r
361 );\r
362\r
363\r
364/**\r
365 Return TRUE if all AP services are availible.\r
366\r
367 @retval EFI_SUCCESS All AP services are available\r
368 @retval EFI_NOT_FOUND At least one AP service is not available\r
369\r
370**/\r
371EFI_STATUS\r
372CoreAllEfiServicesAvailable (\r
373 VOID\r
374 );\r
375\r
376\r
377/**\r
378 Calcualte the 32-bit CRC in a EFI table using the service provided by the\r
379 gRuntime service.\r
380\r
381 @param Hdr Pointer to an EFI standard header\r
382\r
383**/\r
384VOID\r
385CalculateEfiHdrCrc (\r
386 IN OUT EFI_TABLE_HEADER *Hdr\r
387 );\r
388\r
389\r
390/**\r
391 Called by the platform code to process a tick.\r
392\r
393 @param Duration The number of 100ns elasped since the last call\r
394 to TimerTick\r
395\r
396**/\r
397VOID\r
398EFIAPI\r
399CoreTimerTick (\r
400 IN UINT64 Duration\r
401 );\r
402\r
403\r
404/**\r
405 Initialize the dispatcher. Initialize the notification function that runs when\r
406 an FV2 protocol is added to the system.\r
407\r
408**/\r
409VOID\r
410CoreInitializeDispatcher (\r
411 VOID\r
412 );\r
413\r
414\r
415/**\r
416 This is the POSTFIX version of the dependency evaluator. This code does\r
417 not need to handle Before or After, as it is not valid to call this\r
418 routine in this case. The SOR is just ignored and is a nop in the grammer.\r
419 POSTFIX means all the math is done on top of the stack.\r
420\r
421 @param DriverEntry DriverEntry element to update.\r
422\r
423 @retval TRUE If driver is ready to run.\r
424 @retval FALSE If driver is not ready to run or some fatal error\r
425 was found.\r
426\r
427**/\r
428BOOLEAN\r
429CoreIsSchedulable (\r
430 IN EFI_CORE_DRIVER_ENTRY *DriverEntry\r
431 );\r
432\r
433\r
434/**\r
435 Preprocess dependency expression and update DriverEntry to reflect the\r
436 state of Before, After, and SOR dependencies. If DriverEntry->Before\r
437 or DriverEntry->After is set it will never be cleared. If SOR is set\r
438 it will be cleared by CoreSchedule(), and then the driver can be\r
439 dispatched.\r
440\r
441 @param DriverEntry DriverEntry element to update .\r
442\r
443 @retval EFI_SUCCESS It always works.\r
444\r
445**/\r
446EFI_STATUS\r
447CorePreProcessDepex (\r
448 IN EFI_CORE_DRIVER_ENTRY *DriverEntry\r
449 );\r
450\r
451\r
452\r
453/**\r
454 Terminates all boot services.\r
455\r
456 @param ImageHandle Handle that identifies the exiting image.\r
457 @param MapKey Key to the latest memory map.\r
458\r
459 @retval EFI_SUCCESS Boot Services terminated\r
460 @retval EFI_INVALID_PARAMETER MapKey is incorrect.\r
461\r
462**/\r
463EFI_STATUS\r
464EFIAPI\r
465CoreExitBootServices (\r
466 IN EFI_HANDLE ImageHandle,\r
467 IN UINTN MapKey\r
468 );\r
469\r
470\r
471/**\r
472 Make sure the memory map is following all the construction rules,\r
473 it is the last time to check memory map error before exit boot services.\r
474\r
475 @param MapKey Memory map key\r
476\r
477 @retval EFI_INVALID_PARAMETER Memory map not consistent with construction\r
478 rules.\r
479 @retval EFI_SUCCESS Valid memory map.\r
480\r
481**/\r
482EFI_STATUS\r
483CoreTerminateMemoryMap (\r
484 IN UINTN MapKey\r
485 );\r
486\r
487\r
488/**\r
489 Signals all events in the EventGroup.\r
490\r
491 @param EventGroup The list to signal\r
492\r
493**/\r
494VOID\r
495CoreNotifySignalList (\r
496 IN EFI_GUID *EventGroup\r
497 );\r
498\r
499\r
500\r
501/**\r
502 Boot Service called to add, modify, or remove a system configuration table from\r
503 the EFI System Table.\r
504\r
505 @param Guid Pointer to the GUID for the entry to add, update, or\r
506 remove\r
507 @param Table Pointer to the configuration table for the entry to add,\r
508 update, or remove, may be NULL.\r
509\r
510 @return EFI_SUCCESS Guid, Table pair added, updated, or removed.\r
511 @return EFI_INVALID_PARAMETER Input GUID not valid.\r
512 @return EFI_NOT_FOUND Attempted to delete non-existant entry\r
513 @return EFI_OUT_OF_RESOURCES Not enough memory available\r
514\r
515**/\r
516EFI_STATUS\r
517EFIAPI\r
518CoreInstallConfigurationTable (\r
519 IN EFI_GUID *Guid,\r
520 IN VOID *Table\r
521 );\r
522\r
523\r
524\r
525/**\r
526 Raise the task priority level to the new level.\r
527 High level is implemented by disabling processor interrupts.\r
528\r
529 @param NewTpl New task priority level\r
530\r
531 @return The previous task priority level\r
532\r
533**/\r
534EFI_TPL\r
535EFIAPI\r
536CoreRaiseTpl (\r
537 IN EFI_TPL NewTpl\r
538 );\r
539\r
540\r
541\r
542/**\r
543 Lowers the task priority to the previous value. If the new\r
544 priority unmasks events at a higher priority, they are dispatched.\r
545\r
546 @param NewTpl New, lower, task priority\r
547\r
548**/\r
549VOID\r
550EFIAPI\r
551CoreRestoreTpl (\r
552 IN EFI_TPL NewTpl\r
553 );\r
554\r
555\r
556\r
557/**\r
558 Introduces a fine-grained stall.\r
559\r
560 @param Microseconds The number of microseconds to stall execution.\r
561\r
562 @retval EFI_SUCCESS Execution was stalled for at least the requested\r
563 amount of microseconds.\r
564 @retval EFI_NOT_AVAILABLE_YET gMetronome is not available yet\r
565\r
566**/\r
567EFI_STATUS\r
568EFIAPI\r
569CoreStall (\r
570 IN UINTN Microseconds\r
571 );\r
572\r
573\r
574\r
575/**\r
576 Sets the system's watchdog timer.\r
577\r
578 @param Timeout The number of seconds to set the watchdog timer to.\r
579 A value of zero disables the timer.\r
580 @param WatchdogCode The numeric code to log on a watchdog timer timeout\r
581 event. The firmware reserves codes 0x0000 to 0xFFFF.\r
582 Loaders and operating systems may use other timeout\r
583 codes.\r
584 @param DataSize The size, in bytes, of WatchdogData.\r
585 @param WatchdogData A data buffer that includes a Null-terminated Unicode\r
586 string, optionally followed by additional binary data.\r
587 The string is a description that the call may use to\r
588 further indicate the reason to be logged with a\r
589 watchdog event.\r
590\r
591 @return EFI_SUCCESS Timeout has been set\r
592 @return EFI_NOT_AVAILABLE_YET WatchdogTimer is not available yet\r
593 @return EFI_UNSUPPORTED System does not have a timer (currently not used)\r
594 @return EFI_DEVICE_ERROR Could not complete due to hardware error\r
595\r
596**/\r
597EFI_STATUS\r
598EFIAPI\r
599CoreSetWatchdogTimer (\r
600 IN UINTN Timeout,\r
601 IN UINT64 WatchdogCode,\r
602 IN UINTN DataSize,\r
603 IN CHAR16 *WatchdogData OPTIONAL\r
604 );\r
605\r
606\r
607\r
608/**\r
609 Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which\r
610 Calls the private one which contains a BOOLEAN parameter for notifications\r
611\r
612 @param UserHandle The handle to install the protocol handler on,\r
613 or NULL if a new handle is to be allocated\r
614 @param Protocol The protocol to add to the handle\r
615 @param InterfaceType Indicates whether Interface is supplied in\r
616 native form.\r
617 @param Interface The interface for the protocol being added\r
618\r
619 @return Status code\r
620\r
621**/\r
622EFI_STATUS\r
623EFIAPI\r
624CoreInstallProtocolInterface (\r
625 IN OUT EFI_HANDLE *UserHandle,\r
626 IN EFI_GUID *Protocol,\r
627 IN EFI_INTERFACE_TYPE InterfaceType,\r
628 IN VOID *Interface\r
629 );\r
630\r
631\r
632/**\r
633 Installs a protocol interface into the boot services environment.\r
634\r
635 @param UserHandle The handle to install the protocol handler on,\r
636 or NULL if a new handle is to be allocated\r
637 @param Protocol The protocol to add to the handle\r
638 @param InterfaceType Indicates whether Interface is supplied in\r
639 native form.\r
640 @param Interface The interface for the protocol being added\r
641 @param Notify indicates whether notify the notification list\r
642 for this protocol\r
643\r
644 @retval EFI_INVALID_PARAMETER Invalid parameter\r
645 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
646 @retval EFI_SUCCESS Protocol interface successfully installed\r
647\r
648**/\r
649EFI_STATUS\r
650CoreInstallProtocolInterfaceNotify (\r
651 IN OUT EFI_HANDLE *UserHandle,\r
652 IN EFI_GUID *Protocol,\r
653 IN EFI_INTERFACE_TYPE InterfaceType,\r
654 IN VOID *Interface,\r
655 IN BOOLEAN Notify\r
656 );\r
657\r
658\r
659\r
660/**\r
661 Installs a list of protocol interface into the boot services environment.\r
662 This function calls InstallProtocolInterface() in a loop. If any error\r
663 occures all the protocols added by this function are removed. This is\r
664 basically a lib function to save space.\r
665\r
666 @param Handle The handle to install the protocol handlers on,\r
667 or NULL if a new handle is to be allocated\r
668 @param ... EFI_GUID followed by protocol instance. A NULL\r
669 terminates the list. The pairs are the\r
670 arguments to InstallProtocolInterface(). All the\r
671 protocols are added to Handle.\r
672\r
673 @retval EFI_INVALID_PARAMETER Handle is NULL.\r
674 @retval EFI_SUCCESS Protocol interfaces successfully installed.\r
675\r
676**/\r
677EFI_STATUS\r
678EFIAPI\r
679CoreInstallMultipleProtocolInterfaces (\r
680 IN OUT EFI_HANDLE *Handle,\r
681 ...\r
682 );\r
683\r
684\r
685\r
686/**\r
687 Uninstalls a list of protocol interface in the boot services environment.\r
688 This function calls UnisatllProtocolInterface() in a loop. This is\r
689 basically a lib function to save space.\r
690\r
691 @param Handle The handle to uninstall the protocol\r
692 @param ... EFI_GUID followed by protocol instance. A NULL\r
693 terminates the list. The pairs are the\r
694 arguments to UninstallProtocolInterface(). All\r
695 the protocols are added to Handle.\r
696\r
697 @return Status code\r
698\r
699**/\r
700EFI_STATUS\r
701EFIAPI\r
702CoreUninstallMultipleProtocolInterfaces (\r
703 IN EFI_HANDLE Handle,\r
704 ...\r
705 );\r
706\r
707\r
708\r
709/**\r
710 Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.\r
711\r
712 @param UserHandle Handle on which the interface is to be\r
713 reinstalled\r
714 @param Protocol The numeric ID of the interface\r
715 @param OldInterface A pointer to the old interface\r
716 @param NewInterface A pointer to the new interface\r
717\r
718 @retval EFI_SUCCESS The protocol interface was installed\r
719 @retval EFI_NOT_FOUND The OldInterface on the handle was not found\r
720 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
721\r
722**/\r
723EFI_STATUS\r
724EFIAPI\r
725CoreReinstallProtocolInterface (\r
726 IN EFI_HANDLE UserHandle,\r
727 IN EFI_GUID *Protocol,\r
728 IN VOID *OldInterface,\r
729 IN VOID *NewInterface\r
730 );\r
731\r
732\r
733\r
734/**\r
735 Uninstalls all instances of a protocol:interfacer from a handle.\r
736 If the last protocol interface is remove from the handle, the\r
737 handle is freed.\r
738\r
739 @param UserHandle The handle to remove the protocol handler from\r
740 @param Protocol The protocol, of protocol:interface, to remove\r
741 @param Interface The interface, of protocol:interface, to remove\r
742\r
743 @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
744 @retval EFI_SUCCESS Protocol interface successfully uninstalled.\r
745\r
746**/\r
747EFI_STATUS\r
748EFIAPI\r
749CoreUninstallProtocolInterface (\r
750 IN EFI_HANDLE UserHandle,\r
751 IN EFI_GUID *Protocol,\r
752 IN VOID *Interface\r
753 );\r
754\r
755\r
756\r
757/**\r
758 Queries a handle to determine if it supports a specified protocol.\r
759\r
760 @param UserHandle The handle being queried.\r
761 @param Protocol The published unique identifier of the protocol.\r
762 @param Interface Supplies the address where a pointer to the\r
763 corresponding Protocol Interface is returned.\r
764\r
765 @return The requested protocol interface for the handle\r
766\r
767**/\r
768EFI_STATUS\r
769EFIAPI\r
770CoreHandleProtocol (\r
771 IN EFI_HANDLE UserHandle,\r
772 IN EFI_GUID *Protocol,\r
773 OUT VOID **Interface\r
774 );\r
775\r
776\r
777\r
778/**\r
779 Locates the installed protocol handler for the handle, and\r
780 invokes it to obtain the protocol interface. Usage information\r
781 is registered in the protocol data base.\r
782\r
783 @param UserHandle The handle to obtain the protocol interface on\r
784 @param Protocol The ID of the protocol\r
785 @param Interface The location to return the protocol interface\r
786 @param ImageHandle The handle of the Image that is opening the\r
787 protocol interface specified by Protocol and\r
788 Interface.\r
789 @param ControllerHandle The controller handle that is requiring this\r
790 interface.\r
791 @param Attributes The open mode of the protocol interface\r
792 specified by Handle and Protocol.\r
793\r
794 @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
795 @retval EFI_SUCCESS Get the protocol interface.\r
796\r
797**/\r
798EFI_STATUS\r
799EFIAPI\r
800CoreOpenProtocol (\r
801 IN EFI_HANDLE UserHandle,\r
802 IN EFI_GUID *Protocol,\r
803 OUT VOID **Interface OPTIONAL,\r
804 IN EFI_HANDLE ImageHandle,\r
805 IN EFI_HANDLE ControllerHandle,\r
806 IN UINT32 Attributes\r
807 );\r
808\r
809\r
810\r
811/**\r
812 Return information about Opened protocols in the system\r
813\r
814 @param UserHandle The handle to close the protocol interface on\r
815 @param Protocol The ID of the protocol\r
816 @param EntryBuffer A pointer to a buffer of open protocol\r
817 information in the form of\r
818 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r
819 @param EntryCount Number of EntryBuffer entries\r
820\r
821**/\r
822EFI_STATUS\r
823EFIAPI\r
824CoreOpenProtocolInformation (\r
825 IN EFI_HANDLE UserHandle,\r
826 IN EFI_GUID *Protocol,\r
827 OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r
828 OUT UINTN *EntryCount\r
829 );\r
830\r
831\r
832\r
833/**\r
834 Closes a protocol on a handle that was opened using OpenProtocol().\r
835\r
836 @param UserHandle The handle for the protocol interface that was\r
837 previously opened with OpenProtocol(), and is\r
838 now being closed.\r
839 @param Protocol The published unique identifier of the protocol.\r
840 It is the caller's responsibility to pass in a\r
841 valid GUID.\r
842 @param AgentHandle The handle of the agent that is closing the\r
843 protocol interface.\r
844 @param ControllerHandle If the agent that opened a protocol is a driver\r
845 that follows the EFI Driver Model, then this\r
846 parameter is the controller handle that required\r
847 the protocol interface. If the agent does not\r
848 follow the EFI Driver Model, then this parameter\r
849 is optional and may be NULL.\r
850\r
851 @retval EFI_SUCCESS The protocol instance was closed.\r
852 @retval EFI_INVALID_PARAMETER Handle, AgentHandle or ControllerHandle is not a\r
853 valid EFI_HANDLE.\r
854 @retval EFI_NOT_FOUND Can not find the specified protocol or\r
855 AgentHandle.\r
856\r
857**/\r
858EFI_STATUS\r
859EFIAPI\r
860CoreCloseProtocol (\r
861 IN EFI_HANDLE UserHandle,\r
862 IN EFI_GUID *Protocol,\r
863 IN EFI_HANDLE AgentHandle,\r
864 IN EFI_HANDLE ControllerHandle\r
865 );\r
866\r
867\r
868\r
869/**\r
870 Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r
871 from pool.\r
872\r
873 @param UserHandle The handle from which to retrieve the list of\r
874 protocol interface GUIDs.\r
875 @param ProtocolBuffer A pointer to the list of protocol interface GUID\r
876 pointers that are installed on Handle.\r
877 @param ProtocolBufferCount A pointer to the number of GUID pointers present\r
878 in ProtocolBuffer.\r
879\r
880 @retval EFI_SUCCESS The list of protocol interface GUIDs installed\r
881 on Handle was returned in ProtocolBuffer. The\r
882 number of protocol interface GUIDs was returned\r
883 in ProtocolBufferCount.\r
884 @retval EFI_INVALID_PARAMETER Handle is NULL.\r
885 @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.\r
886 @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.\r
887 @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.\r
888 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the\r
889 results.\r
890\r
891**/\r
892EFI_STATUS\r
893EFIAPI\r
894CoreProtocolsPerHandle (\r
895 IN EFI_HANDLE UserHandle,\r
896 OUT EFI_GUID ***ProtocolBuffer,\r
897 OUT UINTN *ProtocolBufferCount\r
898 );\r
899\r
900\r
901\r
902/**\r
903 Add a new protocol notification record for the request protocol.\r
904\r
905 @param Protocol The requested protocol to add the notify\r
906 registration\r
907 @param Event The event to signal\r
908 @param Registration Returns the registration record\r
909\r
910 @retval EFI_INVALID_PARAMETER Invalid parameter\r
911 @retval EFI_SUCCESS Successfully returned the registration record\r
912 that has been added\r
913\r
914**/\r
915EFI_STATUS\r
916EFIAPI\r
917CoreRegisterProtocolNotify (\r
918 IN EFI_GUID *Protocol,\r
919 IN EFI_EVENT Event,\r
920 OUT VOID **Registration\r
921 );\r
922\r
923\r
924/**\r
925 Removes all the events in the protocol database that match Event.\r
926\r
927 @param Event The event to search for in the protocol\r
928 database.\r
929\r
930 @return EFI_SUCCESS when done searching the entire database.\r
931\r
932**/\r
933EFI_STATUS\r
934CoreUnregisterProtocolNotify (\r
935 IN EFI_EVENT Event\r
936 );\r
937\r
938\r
939/**\r
940 Locates the requested handle(s) and returns them in Buffer.\r
941\r
942 @param SearchType The type of search to perform to locate the\r
943 handles\r
944 @param Protocol The protocol to search for\r
945 @param SearchKey Dependant on SearchType\r
946 @param BufferSize On input the size of Buffer. On output the\r
947 size of data returned.\r
948 @param Buffer The buffer to return the results in\r
949\r
950 @retval EFI_BUFFER_TOO_SMALL Buffer too small, required buffer size is\r
951 returned in BufferSize.\r
952 @retval EFI_INVALID_PARAMETER Invalid parameter\r
953 @retval EFI_SUCCESS Successfully found the requested handle(s) and\r
954 returns them in Buffer.\r
955\r
956**/\r
957EFI_STATUS\r
958EFIAPI\r
959CoreLocateHandle (\r
960 IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
961 IN EFI_GUID *Protocol OPTIONAL,\r
962 IN VOID *SearchKey OPTIONAL,\r
963 IN OUT UINTN *BufferSize,\r
964 OUT EFI_HANDLE *Buffer\r
965 );\r
966\r
967\r
968\r
969/**\r
970 Locates the handle to a device on the device path that best matches the specified protocol.\r
971\r
972 @param Protocol The protocol to search for.\r
973 @param DevicePath On input, a pointer to a pointer to the device\r
974 path. On output, the device path pointer is\r
975 modified to point to the remaining part of the\r
976 devicepath.\r
977 @param Device A pointer to the returned device handle.\r
978\r
979 @retval EFI_SUCCESS The resulting handle was returned.\r
980 @retval EFI_NOT_FOUND No handles matched the search.\r
981 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
982\r
983**/\r
984EFI_STATUS\r
985EFIAPI\r
986CoreLocateDevicePath (\r
987 IN EFI_GUID *Protocol,\r
988 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,\r
989 OUT EFI_HANDLE *Device\r
990 );\r
991\r
992\r
993\r
994/**\r
995 Function returns an array of handles that support the requested protocol\r
996 in a buffer allocated from pool. This is a version of CoreLocateHandle()\r
997 that allocates a buffer for the caller.\r
998\r
999 @param SearchType Specifies which handle(s) are to be returned.\r
1000 @param Protocol Provides the protocol to search by. This\r
1001 parameter is only valid for SearchType\r
1002 ByProtocol.\r
1003 @param SearchKey Supplies the search key depending on the\r
1004 SearchType.\r
1005 @param NumberHandles The number of handles returned in Buffer.\r
1006 @param Buffer A pointer to the buffer to return the requested\r
1007 array of handles that support Protocol.\r
1008\r
1009 @retval EFI_SUCCESS The result array of handles was returned.\r
1010 @retval EFI_NOT_FOUND No handles match the search.\r
1011 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the\r
1012 matching results.\r
1013 @retval EFI_INVALID_PARAMETER One or more paramters are not valid.\r
1014\r
1015**/\r
1016EFI_STATUS\r
1017EFIAPI\r
1018CoreLocateHandleBuffer (\r
1019 IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
1020 IN EFI_GUID *Protocol OPTIONAL,\r
1021 IN VOID *SearchKey OPTIONAL,\r
1022 IN OUT UINTN *NumberHandles,\r
1023 OUT EFI_HANDLE **Buffer\r
1024 );\r
1025\r
1026\r
1027\r
1028/**\r
1029 Return the first Protocol Interface that matches the Protocol GUID. If\r
1030 Registration is passed in, return a Protocol Instance that was just add\r
1031 to the system. If Registration is NULL return the first Protocol Interface\r
1032 you find.\r
1033\r
1034 @param Protocol The protocol to search for\r
1035 @param Registration Optional Registration Key returned from\r
1036 RegisterProtocolNotify()\r
1037 @param Interface Return the Protocol interface (instance).\r
1038\r
1039 @retval EFI_SUCCESS If a valid Interface is returned\r
1040 @retval EFI_INVALID_PARAMETER Invalid parameter\r
1041 @retval EFI_NOT_FOUND Protocol interface not found\r
1042\r
1043**/\r
1044EFI_STATUS\r
1045EFIAPI\r
1046CoreLocateProtocol (\r
1047 IN EFI_GUID *Protocol,\r
1048 IN VOID *Registration OPTIONAL,\r
1049 OUT VOID **Interface\r
1050 );\r
1051\r
1052\r
1053/**\r
1054 return handle database key.\r
1055\r
1056\r
1057 @return Handle database key.\r
1058\r
1059**/\r
1060UINT64\r
1061CoreGetHandleDatabaseKey (\r
1062 VOID\r
1063 );\r
1064\r
1065\r
1066/**\r
1067 Go connect any handles that were created or modified while a image executed.\r
1068\r
1069 @param Key The Key to show that the handle has been\r
1070 created/modified\r
1071\r
1072**/\r
1073VOID\r
1074CoreConnectHandlesByKey (\r
1075 UINT64 Key\r
1076 );\r
1077\r
1078\r
1079\r
1080/**\r
1081 Connects one or more drivers to a controller.\r
1082\r
1083 @param ControllerHandle Handle of the controller to be\r
1084 connected.\r
1085 @param DriverImageHandle DriverImageHandle A pointer to an\r
1086 ordered list of driver image\r
1087 handles.\r
1088 @param RemainingDevicePath RemainingDevicePath A pointer to\r
1089 the device path that specifies a\r
1090 child of the controller specified\r
1091 by ControllerHandle.\r
1092 @param Recursive Whether the function would be\r
1093 called recursively or not.\r
1094\r
1095 @return Status code.\r
1096\r
1097**/\r
1098EFI_STATUS\r
1099EFIAPI\r
1100CoreConnectController (\r
1101 IN EFI_HANDLE ControllerHandle,\r
1102 IN EFI_HANDLE *DriverImageHandle OPTIONAL,\r
1103 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,\r
1104 IN BOOLEAN Recursive\r
1105 );\r
1106\r
1107\r
1108\r
1109/**\r
1110 Disonnects a controller from a driver\r
1111\r
1112 @param ControllerHandle ControllerHandle The handle of\r
1113 the controller from which\r
1114 driver(s) are to be\r
1115 disconnected.\r
1116 @param DriverImageHandle DriverImageHandle The driver to\r
1117 disconnect from ControllerHandle.\r
1118 @param ChildHandle ChildHandle The handle of the\r
1119 child to destroy.\r
1120\r
1121 @retval EFI_SUCCESS One or more drivers were\r
1122 disconnected from the controller.\r
1123 @retval EFI_SUCCESS On entry, no drivers are managing\r
1124 ControllerHandle.\r
1125 @retval EFI_SUCCESS DriverImageHandle is not NULL,\r
1126 and on entry DriverImageHandle is\r
1127 not managing ControllerHandle.\r
1128 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
1129 @retval EFI_INVALID_PARAMETER DriverImageHandle is not NULL,\r
1130 and it is not a valid EFI_HANDLE.\r
1131 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it\r
1132 is not a valid EFI_HANDLE.\r
1133 @retval EFI_OUT_OF_RESOURCES There are not enough resources\r
1134 available to disconnect any\r
1135 drivers from ControllerHandle.\r
1136 @retval EFI_DEVICE_ERROR The controller could not be\r
1137 disconnected because of a device\r
1138 error.\r
1139\r
1140**/\r
1141EFI_STATUS\r
1142EFIAPI\r
1143CoreDisconnectController (\r
1144 IN EFI_HANDLE ControllerHandle,\r
1145 IN EFI_HANDLE DriverImageHandle OPTIONAL,\r
1146 IN EFI_HANDLE ChildHandle OPTIONAL\r
1147 );\r
1148\r
1149\r
1150\r
1151/**\r
1152 Allocates pages from the memory map.\r
1153\r
1154 @param Type The type of allocation to perform\r
1155 @param MemoryType The type of memory to turn the allocated pages\r
1156 into\r
1157 @param NumberOfPages The number of pages to allocate\r
1158 @param Memory A pointer to receive the base allocated memory\r
1159 address\r
1160\r
1161 @return Status. On success, Memory is filled in with the base address allocated\r
1162 @retval EFI_INVALID_PARAMETER Parameters violate checking rules defined in\r
1163 spec.\r
1164 @retval EFI_NOT_FOUND Could not allocate pages match the requirement.\r
1165 @retval EFI_OUT_OF_RESOURCES No enough pages to allocate.\r
1166 @retval EFI_SUCCESS Pages successfully allocated.\r
1167\r
1168**/\r
1169EFI_STATUS\r
1170EFIAPI\r
1171CoreAllocatePages (\r
1172 IN EFI_ALLOCATE_TYPE Type,\r
1173 IN EFI_MEMORY_TYPE MemoryType,\r
1174 IN UINTN NumberOfPages,\r
1175 IN OUT EFI_PHYSICAL_ADDRESS *Memory\r
1176 );\r
1177\r
1178\r
1179\r
1180/**\r
1181 Frees previous allocated pages.\r
1182\r
1183 @param Memory Base address of memory being freed\r
1184 @param NumberOfPages The number of pages to free\r
1185\r
1186 @retval EFI_NOT_FOUND Could not find the entry that covers the range\r
1187 @retval EFI_INVALID_PARAMETER Address not aligned\r
1188 @return EFI_SUCCESS -Pages successfully freed.\r
1189\r
1190**/\r
1191EFI_STATUS\r
1192EFIAPI\r
1193CoreFreePages (\r
1194 IN EFI_PHYSICAL_ADDRESS Memory,\r
1195 IN UINTN NumberOfPages\r
1196 );\r
1197\r
1198\r
1199\r
1200/**\r
1201 This function returns a copy of the current memory map. The map is an array of\r
1202 memory descriptors, each of which describes a contiguous block of memory.\r
1203\r
1204 @param MemoryMapSize A pointer to the size, in bytes, of the\r
1205 MemoryMap buffer. On input, this is the size of\r
1206 the buffer allocated by the caller. On output,\r
1207 it is the size of the buffer returned by the\r
1208 firmware if the buffer was large enough, or the\r
1209 size of the buffer needed to contain the map if\r
1210 the buffer was too small.\r
1211 @param MemoryMap A pointer to the buffer in which firmware places\r
1212 the current memory map.\r
1213 @param MapKey A pointer to the location in which firmware\r
1214 returns the key for the current memory map.\r
1215 @param DescriptorSize A pointer to the location in which firmware\r
1216 returns the size, in bytes, of an individual\r
1217 EFI_MEMORY_DESCRIPTOR.\r
1218 @param DescriptorVersion A pointer to the location in which firmware\r
1219 returns the version number associated with the\r
1220 EFI_MEMORY_DESCRIPTOR.\r
1221\r
1222 @retval EFI_SUCCESS The memory map was returned in the MemoryMap\r
1223 buffer.\r
1224 @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current\r
1225 buffer size needed to hold the memory map is\r
1226 returned in MemoryMapSize.\r
1227 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
1228\r
1229**/\r
1230EFI_STATUS\r
1231EFIAPI\r
1232CoreGetMemoryMap (\r
1233 IN OUT UINTN *MemoryMapSize,\r
1234 IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,\r
1235 OUT UINTN *MapKey,\r
1236 OUT UINTN *DescriptorSize,\r
1237 OUT UINT32 *DescriptorVersion\r
1238 );\r
1239\r
1240\r
1241\r
1242/**\r
1243 Allocate pool of a particular type.\r
1244\r
1245 @param PoolType Type of pool to allocate\r
1246 @param Size The amount of pool to allocate\r
1247 @param Buffer The address to return a pointer to the allocated\r
1248 pool\r
1249\r
1250 @retval EFI_INVALID_PARAMETER PoolType not valid or Buffer is NULL\r
1251 @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.\r
1252 @retval EFI_SUCCESS Pool successfully allocated.\r
1253\r
1254**/\r
1255EFI_STATUS\r
1256EFIAPI\r
1257CoreAllocatePool (\r
1258 IN EFI_MEMORY_TYPE PoolType,\r
1259 IN UINTN Size,\r
1260 OUT VOID **Buffer\r
1261 );\r
1262\r
1263\r
1264\r
1265/**\r
1266 Frees pool.\r
1267\r
1268 @param Buffer The allocated pool entry to free\r
1269\r
1270 @retval EFI_INVALID_PARAMETER Buffer is not a valid value.\r
1271 @retval EFI_SUCCESS Pool successfully freed.\r
1272\r
1273**/\r
1274EFI_STATUS\r
1275EFIAPI\r
1276CoreFreePool (\r
1277 IN VOID *Buffer\r
1278 );\r
1279\r
1280\r
1281\r
1282/**\r
1283 Loads an EFI image into memory and returns a handle to the image.\r
1284\r
1285 @param BootPolicy If TRUE, indicates that the request originates\r
1286 from the boot manager, and that the boot\r
1287 manager is attempting to load FilePath as a\r
1288 boot selection.\r
1289 @param ParentImageHandle The caller's image handle.\r
1290 @param FilePath The specific file path from which the image is\r
1291 loaded.\r
1292 @param SourceBuffer If not NULL, a pointer to the memory location\r
1293 containing a copy of the image to be loaded.\r
1294 @param SourceSize The size in bytes of SourceBuffer.\r
1295 @param ImageHandle Pointer to the returned image handle that is\r
1296 created when the image is successfully loaded.\r
1297\r
1298 @retval EFI_SUCCESS The image was loaded into memory.\r
1299 @retval EFI_NOT_FOUND The FilePath was not found.\r
1300 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
1301 @retval EFI_UNSUPPORTED The image type is not supported, or the device\r
1302 path cannot be parsed to locate the proper\r
1303 protocol for loading the file.\r
1304 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient\r
1305 resources.\r
1306 @retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not\r
1307 understood.\r
1308 @retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.\r
1309 @retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the \r
1310 image from being loaded. NULL is returned in *ImageHandle.\r
1311 @retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a \r
1312 valid EFI_LOADED_IMAGE_PROTOCOL. However, the current \r
1313 platform policy specifies that the image should not be started.\r
1314\r
1315**/\r
1316EFI_STATUS\r
1317EFIAPI\r
1318CoreLoadImage (\r
1319 IN BOOLEAN BootPolicy,\r
1320 IN EFI_HANDLE ParentImageHandle,\r
1321 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
1322 IN VOID *SourceBuffer OPTIONAL,\r
1323 IN UINTN SourceSize,\r
1324 OUT EFI_HANDLE *ImageHandle\r
1325 );\r
1326\r
1327\r
1328\r
1329/**\r
1330 Unloads an image.\r
1331\r
1332 @param ImageHandle Handle that identifies the image to be\r
1333 unloaded.\r
1334\r
1335 @retval EFI_SUCCESS The image has been unloaded.\r
1336 @retval EFI_UNSUPPORTED The image has been sarted, and does not support\r
1337 unload.\r
1338 @retval EFI_INVALID_PARAMPETER ImageHandle is not a valid image handle.\r
1339\r
1340**/\r
1341EFI_STATUS\r
1342EFIAPI\r
1343CoreUnloadImage (\r
1344 IN EFI_HANDLE ImageHandle\r
1345 );\r
1346\r
1347\r
1348\r
1349/**\r
1350 Transfer control to a loaded image's entry point.\r
1351\r
1352 @param ImageHandle Handle of image to be started.\r
1353 @param ExitDataSize Pointer of the size to ExitData\r
1354 @param ExitData Pointer to a pointer to a data buffer that\r
1355 includes a Null-terminated string,\r
1356 optionally followed by additional binary data.\r
1357 The string is a description that the caller may\r
1358 use to further indicate the reason for the\r
1359 image's exit.\r
1360\r
1361 @retval EFI_INVALID_PARAMETER Invalid parameter\r
1362 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
1363 @retval EFI_SUCCESS Successfully transfer control to the image's\r
1364 entry point.\r
1365\r
1366**/\r
1367EFI_STATUS\r
1368EFIAPI\r
1369CoreStartImage (\r
1370 IN EFI_HANDLE ImageHandle,\r
1371 OUT UINTN *ExitDataSize,\r
1372 OUT CHAR16 **ExitData OPTIONAL\r
1373 );\r
1374\r
1375\r
1376\r
1377/**\r
1378 Terminates the currently loaded EFI image and returns control to boot services.\r
1379\r
1380 @param ImageHandle Handle that identifies the image. This\r
1381 parameter is passed to the image on entry.\r
1382 @param Status The image's exit code.\r
1383 @param ExitDataSize The size, in bytes, of ExitData. Ignored if\r
1384 ExitStatus is EFI_SUCCESS.\r
1385 @param ExitData Pointer to a data buffer that includes a\r
1386 Null-terminated Unicode string, optionally\r
1387 followed by additional binary data. The string\r
1388 is a description that the caller may use to\r
1389 further indicate the reason for the image's\r
1390 exit.\r
1391\r
1392 @retval EFI_INVALID_PARAMETER Image handle is NULL or it is not current\r
1393 image.\r
1394 @retval EFI_SUCCESS Successfully terminates the currently loaded\r
1395 EFI image.\r
1396 @retval EFI_ACCESS_DENIED Should never reach there.\r
1397 @retval EFI_OUT_OF_RESOURCES Could not allocate pool\r
1398\r
1399**/\r
1400EFI_STATUS\r
1401EFIAPI\r
1402CoreExit (\r
1403 IN EFI_HANDLE ImageHandle,\r
1404 IN EFI_STATUS Status,\r
1405 IN UINTN ExitDataSize,\r
1406 IN CHAR16 *ExitData OPTIONAL\r
1407 );\r
1408\r
1409\r
1410\r
1411/**\r
1412 Creates an event.\r
1413\r
1414 @param Type The type of event to create and its mode and\r
1415 attributes\r
1416 @param NotifyTpl The task priority level of event notifications\r
1417 @param NotifyFunction Pointer to the events notification function\r
1418 @param NotifyContext Pointer to the notification functions context;\r
1419 corresponds to parameter "Context" in the\r
1420 notification function\r
1421 @param Event Pointer to the newly created event if the call\r
1422 succeeds; undefined otherwise\r
1423\r
1424 @retval EFI_SUCCESS The event structure was created\r
1425 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
1426 @retval EFI_OUT_OF_RESOURCES The event could not be allocated\r
1427\r
1428**/\r
1429EFI_STATUS\r
1430EFIAPI\r
1431CoreCreateEvent (\r
1432 IN UINT32 Type,\r
1433 IN EFI_TPL NotifyTpl,\r
1434 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r
1435 IN VOID *NotifyContext, OPTIONAL\r
1436 OUT EFI_EVENT *Event\r
1437 );\r
1438\r
1439\r
1440\r
1441/**\r
1442 Creates an event in a group.\r
1443\r
1444 @param Type The type of event to create and its mode and\r
1445 attributes\r
1446 @param NotifyTpl The task priority level of event notifications\r
1447 @param NotifyFunction Pointer to the events notification function\r
1448 @param NotifyContext Pointer to the notification functions context;\r
1449 corresponds to parameter "Context" in the\r
1450 notification function\r
1451 @param EventGroup GUID for EventGroup if NULL act the same as\r
1452 gBS->CreateEvent().\r
1453 @param Event Pointer to the newly created event if the call\r
1454 succeeds; undefined otherwise\r
1455\r
1456 @retval EFI_SUCCESS The event structure was created\r
1457 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
1458 @retval EFI_OUT_OF_RESOURCES The event could not be allocated\r
1459\r
1460**/\r
1461EFI_STATUS\r
1462EFIAPI\r
1463CoreCreateEventEx (\r
1464 IN UINT32 Type,\r
1465 IN EFI_TPL NotifyTpl,\r
1466 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r
1467 IN CONST VOID *NotifyContext, OPTIONAL\r
1468 IN CONST EFI_GUID *EventGroup, OPTIONAL\r
1469 OUT EFI_EVENT *Event\r
1470 );\r
1471\r
1472/**\r
1473 Creates a general-purpose event structure\r
1474\r
1475 @param Type The type of event to create and its mode and\r
1476 attributes\r
1477 @param NotifyTpl The task priority level of event notifications\r
1478 @param NotifyFunction Pointer to the events notification function\r
1479 @param NotifyContext Pointer to the notification functions context;\r
1480 corresponds to parameter "Context" in the\r
1481 notification function\r
1482 @param EventGroup GUID for EventGroup if NULL act the same as\r
1483 gBS->CreateEvent().\r
1484 @param Event Pointer to the newly created event if the call\r
1485 succeeds; undefined otherwise\r
1486\r
1487 @retval EFI_SUCCESS The event structure was created\r
1488 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
1489 @retval EFI_OUT_OF_RESOURCES The event could not be allocated\r
1490\r
1491**/\r
1492EFI_STATUS\r
1493EFIAPI\r
1494CoreCreateEventInternal (\r
1495 IN UINT32 Type,\r
1496 IN EFI_TPL NotifyTpl,\r
1497 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r
1498 IN CONST VOID *NotifyContext, OPTIONAL\r
1499 IN CONST EFI_GUID *EventGroup, OPTIONAL\r
1500 OUT EFI_EVENT *Event\r
1501 );\r
1502\r
1503/**\r
1504 Sets the type of timer and the trigger time for a timer event.\r
1505\r
1506 @param UserEvent The timer event that is to be signaled at the\r
1507 specified time\r
1508 @param Type The type of time that is specified in\r
1509 TriggerTime\r
1510 @param TriggerTime The number of 100ns units until the timer\r
1511 expires\r
1512\r
1513 @retval EFI_SUCCESS The event has been set to be signaled at the\r
1514 requested time\r
1515 @retval EFI_INVALID_PARAMETER Event or Type is not valid\r
1516\r
1517**/\r
1518EFI_STATUS\r
1519EFIAPI\r
1520CoreSetTimer (\r
1521 IN EFI_EVENT UserEvent,\r
1522 IN EFI_TIMER_DELAY Type,\r
1523 IN UINT64 TriggerTime\r
1524 );\r
1525\r
1526\r
1527\r
1528/**\r
1529 Signals the event. Queues the event to be notified if needed.\r
1530\r
1531 @param UserEvent The event to signal .\r
1532\r
1533 @retval EFI_INVALID_PARAMETER Parameters are not valid.\r
1534 @retval EFI_SUCCESS The event was signaled.\r
1535\r
1536**/\r
1537EFI_STATUS\r
1538EFIAPI\r
1539CoreSignalEvent (\r
1540 IN EFI_EVENT UserEvent\r
1541 );\r
1542\r
1543\r
1544\r
1545/**\r
1546 Stops execution until an event is signaled.\r
1547\r
1548 @param NumberOfEvents The number of events in the UserEvents array\r
1549 @param UserEvents An array of EFI_EVENT\r
1550 @param UserIndex Pointer to the index of the event which\r
1551 satisfied the wait condition\r
1552\r
1553 @retval EFI_SUCCESS The event indicated by Index was signaled.\r
1554 @retval EFI_INVALID_PARAMETER The event indicated by Index has a notification\r
1555 function or Event was not a valid type\r
1556 @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION\r
1557\r
1558**/\r
1559EFI_STATUS\r
1560EFIAPI\r
1561CoreWaitForEvent (\r
1562 IN UINTN NumberOfEvents,\r
1563 IN EFI_EVENT *UserEvents,\r
1564 OUT UINTN *UserIndex\r
1565 );\r
1566\r
1567\r
1568\r
1569/**\r
1570 Closes an event and frees the event structure.\r
1571\r
1572 @param UserEvent Event to close\r
1573\r
1574 @retval EFI_INVALID_PARAMETER Parameters are not valid.\r
1575 @retval EFI_SUCCESS The event has been closed\r
1576\r
1577**/\r
1578EFI_STATUS\r
1579EFIAPI\r
1580CoreCloseEvent (\r
1581 IN EFI_EVENT UserEvent\r
1582 );\r
1583\r
1584\r
1585\r
1586/**\r
1587 Check the status of an event.\r
1588\r
1589 @param UserEvent The event to check\r
1590\r
1591 @retval EFI_SUCCESS The event is in the signaled state\r
1592 @retval EFI_NOT_READY The event is not in the signaled state\r
1593 @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL\r
1594\r
1595**/\r
1596EFI_STATUS\r
1597EFIAPI\r
1598CoreCheckEvent (\r
1599 IN EFI_EVENT UserEvent\r
1600 );\r
1601\r
1602\r
1603/**\r
1604 Adds reserved memory, system memory, or memory-mapped I/O resources to the\r
1605 global coherency domain of the processor.\r
1606\r
1607 @param GcdMemoryType Memory type of the memory space.\r
1608 @param BaseAddress Base address of the memory space.\r
1609 @param Length Length of the memory space.\r
1610 @param Capabilities alterable attributes of the memory space.\r
1611\r
1612 @retval EFI_SUCCESS Merged this memory space into GCD map.\r
1613\r
1614**/\r
1615EFI_STATUS\r
1616EFIAPI\r
1617CoreAddMemorySpace (\r
1618 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r
1619 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1620 IN UINT64 Length,\r
1621 IN UINT64 Capabilities\r
1622 );\r
1623\r
1624\r
1625/**\r
1626 Allocates nonexistent memory, reserved memory, system memory, or memorymapped\r
1627 I/O resources from the global coherency domain of the processor.\r
1628\r
1629 @param GcdAllocateType The type of allocate operation\r
1630 @param GcdMemoryType The desired memory type\r
1631 @param Alignment Align with 2^Alignment\r
1632 @param Length Length to allocate\r
1633 @param BaseAddress Base address to allocate\r
1634 @param ImageHandle The image handle consume the allocated space.\r
1635 @param DeviceHandle The device handle consume the allocated space.\r
1636\r
1637 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
1638 @retval EFI_NOT_FOUND No descriptor contains the desired space.\r
1639 @retval EFI_SUCCESS Memory space successfully allocated.\r
1640\r
1641**/\r
1642EFI_STATUS\r
1643EFIAPI\r
1644CoreAllocateMemorySpace (\r
1645 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r
1646 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r
1647 IN UINTN Alignment,\r
1648 IN UINT64 Length,\r
1649 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r
1650 IN EFI_HANDLE ImageHandle,\r
1651 IN EFI_HANDLE DeviceHandle OPTIONAL\r
1652 );\r
1653\r
1654\r
1655/**\r
1656 Frees nonexistent memory, reserved memory, system memory, or memory-mapped\r
1657 I/O resources from the global coherency domain of the processor.\r
1658\r
1659 @param BaseAddress Base address of the memory space.\r
1660 @param Length Length of the memory space.\r
1661\r
1662 @retval EFI_SUCCESS Space successfully freed.\r
1663\r
1664**/\r
1665EFI_STATUS\r
1666EFIAPI\r
1667CoreFreeMemorySpace (\r
1668 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1669 IN UINT64 Length\r
1670 );\r
1671\r
1672\r
1673/**\r
1674 Removes reserved memory, system memory, or memory-mapped I/O resources from\r
1675 the global coherency domain of the processor.\r
1676\r
1677 @param BaseAddress Base address of the memory space.\r
1678 @param Length Length of the memory space.\r
1679\r
1680 @retval EFI_SUCCESS Successfully remove a segment of memory space.\r
1681\r
1682**/\r
1683EFI_STATUS\r
1684EFIAPI\r
1685CoreRemoveMemorySpace (\r
1686 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1687 IN UINT64 Length\r
1688 );\r
1689\r
1690\r
1691/**\r
1692 Retrieves the descriptor for a memory region containing a specified address.\r
1693\r
1694 @param BaseAddress Specified start address\r
1695 @param Descriptor Specified length\r
1696\r
1697 @retval EFI_INVALID_PARAMETER Invalid parameter\r
1698 @retval EFI_SUCCESS Successfully get memory space descriptor.\r
1699\r
1700**/\r
1701EFI_STATUS\r
1702EFIAPI\r
1703CoreGetMemorySpaceDescriptor (\r
1704 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1705 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor\r
1706 );\r
1707\r
1708\r
1709/**\r
1710 Modifies the attributes for a memory region in the global coherency domain of the\r
1711 processor.\r
1712\r
1713 @param BaseAddress Specified start address\r
1714 @param Length Specified length\r
1715 @param Attributes Specified attributes\r
1716\r
1717 @retval EFI_SUCCESS The attributes were set for the memory region.\r
1718 @retval EFI_INVALID_PARAMETER Length is zero. \r
1719 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r
1720 resource range specified by BaseAddress and Length.\r
1721 @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource\r
1722 range specified by BaseAddress and Length.\r
1723 @retval EFI_ACCESS_DEFINED The attributes for the memory resource range specified by\r
1724 BaseAddress and Length cannot be modified.\r
1725 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of\r
1726 the memory resource range.\r
1727 @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is\r
1728 not available yet.\r
1729\r
1730**/\r
1731EFI_STATUS\r
1732EFIAPI\r
1733CoreSetMemorySpaceAttributes (\r
1734 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1735 IN UINT64 Length,\r
1736 IN UINT64 Attributes\r
1737 );\r
1738\r
1739\r
1740/**\r
1741 Returns a map of the memory resources in the global coherency domain of the\r
1742 processor.\r
1743\r
1744 @param NumberOfDescriptors Number of descriptors.\r
1745 @param MemorySpaceMap Descriptor array\r
1746\r
1747 @retval EFI_INVALID_PARAMETER Invalid parameter\r
1748 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
1749 @retval EFI_SUCCESS Successfully get memory space map.\r
1750\r
1751**/\r
1752EFI_STATUS\r
1753EFIAPI\r
1754CoreGetMemorySpaceMap (\r
1755 OUT UINTN *NumberOfDescriptors,\r
1756 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap\r
1757 );\r
1758\r
1759\r
1760/**\r
1761 Adds reserved I/O or I/O resources to the global coherency domain of the processor.\r
1762\r
1763 @param GcdIoType IO type of the segment.\r
1764 @param BaseAddress Base address of the segment.\r
1765 @param Length Length of the segment.\r
1766\r
1767 @retval EFI_SUCCESS Merged this segment into GCD map.\r
1768 @retval EFI_INVALID_PARAMETER Parameter not valid\r
1769\r
1770**/\r
1771EFI_STATUS\r
1772EFIAPI\r
1773CoreAddIoSpace (\r
1774 IN EFI_GCD_IO_TYPE GcdIoType,\r
1775 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1776 IN UINT64 Length\r
1777 );\r
1778\r
1779\r
1780/**\r
1781 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
1782 domain of the processor.\r
1783\r
1784 @param GcdAllocateType The type of allocate operation\r
1785 @param GcdIoType The desired IO type\r
1786 @param Alignment Align with 2^Alignment\r
1787 @param Length Length to allocate\r
1788 @param BaseAddress Base address to allocate\r
1789 @param ImageHandle The image handle consume the allocated space.\r
1790 @param DeviceHandle The device handle consume the allocated space.\r
1791\r
1792 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
1793 @retval EFI_NOT_FOUND No descriptor contains the desired space.\r
1794 @retval EFI_SUCCESS IO space successfully allocated.\r
1795\r
1796**/\r
1797EFI_STATUS\r
1798EFIAPI\r
1799CoreAllocateIoSpace (\r
1800 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r
1801 IN EFI_GCD_IO_TYPE GcdIoType,\r
1802 IN UINTN Alignment,\r
1803 IN UINT64 Length,\r
1804 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r
1805 IN EFI_HANDLE ImageHandle,\r
1806 IN EFI_HANDLE DeviceHandle OPTIONAL\r
1807 );\r
1808\r
1809\r
1810/**\r
1811 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
1812 domain of the processor.\r
1813\r
1814 @param BaseAddress Base address of the segment.\r
1815 @param Length Length of the segment.\r
1816\r
1817 @retval EFI_SUCCESS Space successfully freed.\r
1818\r
1819**/\r
1820EFI_STATUS\r
1821EFIAPI\r
1822CoreFreeIoSpace (\r
1823 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1824 IN UINT64 Length\r
1825 );\r
1826\r
1827\r
1828/**\r
1829 Removes reserved I/O or I/O resources from the global coherency domain of the\r
1830 processor.\r
1831\r
1832 @param BaseAddress Base address of the segment.\r
1833 @param Length Length of the segment.\r
1834\r
1835 @retval EFI_SUCCESS Successfully removed a segment of IO space.\r
1836\r
1837**/\r
1838EFI_STATUS\r
1839EFIAPI\r
1840CoreRemoveIoSpace (\r
1841 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1842 IN UINT64 Length\r
1843 );\r
1844\r
1845\r
1846/**\r
1847 Retrieves the descriptor for an I/O region containing a specified address.\r
1848\r
1849 @param BaseAddress Specified start address\r
1850 @param Descriptor Specified length\r
1851\r
1852 @retval EFI_INVALID_PARAMETER Descriptor is NULL.\r
1853 @retval EFI_SUCCESS Successfully get the IO space descriptor.\r
1854\r
1855**/\r
1856EFI_STATUS\r
1857EFIAPI\r
1858CoreGetIoSpaceDescriptor (\r
1859 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
1860 OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor\r
1861 );\r
1862\r
1863\r
1864/**\r
1865 Returns a map of the I/O resources in the global coherency domain of the processor.\r
1866\r
1867 @param NumberOfDescriptors Number of descriptors.\r
1868 @param IoSpaceMap Descriptor array\r
1869\r
1870 @retval EFI_INVALID_PARAMETER Invalid parameter\r
1871 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
1872 @retval EFI_SUCCESS Successfully get IO space map.\r
1873\r
1874**/\r
1875EFI_STATUS\r
1876EFIAPI\r
1877CoreGetIoSpaceMap (\r
1878 OUT UINTN *NumberOfDescriptors,\r
1879 OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap\r
1880 );\r
1881\r
1882\r
1883/**\r
1884 This is the main Dispatcher for DXE and it exits when there are no more\r
1885 drivers to run. Drain the mScheduledQueue and load and start a PE\r
1886 image for each driver. Search the mDiscoveredList to see if any driver can\r
1887 be placed on the mScheduledQueue. If no drivers are placed on the\r
1888 mScheduledQueue exit the function. On exit it is assumed the Bds()\r
1889 will be called, and when the Bds() exits the Dispatcher will be called\r
1890 again.\r
1891\r
1892 @retval EFI_ALREADY_STARTED The DXE Dispatcher is already running\r
1893 @retval EFI_NOT_FOUND No DXE Drivers were dispatched\r
1894 @retval EFI_SUCCESS One or more DXE Drivers were dispatched\r
1895\r
1896**/\r
1897EFI_STATUS\r
1898EFIAPI\r
1899CoreDispatcher (\r
1900 VOID\r
1901 );\r
1902\r
1903/**\r
1904 Check every driver and locate a matching one. If the driver is found, the Unrequested\r
1905 state flag is cleared.\r
1906\r
1907 @param FirmwareVolumeHandle The handle of the Firmware Volume that contains\r
1908 the firmware file specified by DriverName.\r
1909 @param DriverName The Driver name to put in the Dependent state.\r
1910\r
1911 @retval EFI_SUCCESS The DriverName was found and it's SOR bit was\r
1912 cleared\r
1913 @retval EFI_NOT_FOUND The DriverName does not exist or it's SOR bit was\r
1914 not set.\r
1915\r
1916**/\r
1917EFI_STATUS\r
1918EFIAPI\r
1919CoreSchedule (\r
1920 IN EFI_HANDLE FirmwareVolumeHandle,\r
1921 IN EFI_GUID *DriverName\r
1922 );\r
1923\r
1924\r
1925/**\r
1926 Convert a driver from the Untrused back to the Scheduled state.\r
1927\r
1928 @param FirmwareVolumeHandle The handle of the Firmware Volume that contains\r
1929 the firmware file specified by DriverName.\r
1930 @param DriverName The Driver name to put in the Scheduled state\r
1931\r
1932 @retval EFI_SUCCESS The file was found in the untrusted state, and it\r
1933 was promoted to the trusted state.\r
1934 @retval EFI_NOT_FOUND The file was not found in the untrusted state.\r
1935\r
1936**/\r
1937EFI_STATUS\r
1938EFIAPI\r
1939CoreTrust (\r
1940 IN EFI_HANDLE FirmwareVolumeHandle,\r
1941 IN EFI_GUID *DriverName\r
1942 );\r
1943\r
1944\r
1945/**\r
1946 This routine is the driver initialization entry point. It initializes the\r
1947 libraries, and registers two notification functions. These notification\r
1948 functions are responsible for building the FV stack dynamically.\r
1949\r
1950 @param ImageHandle The image handle.\r
1951 @param SystemTable The system table.\r
1952\r
1953 @retval EFI_SUCCESS Function successfully returned.\r
1954\r
1955**/\r
1956EFI_STATUS\r
1957EFIAPI\r
1958FwVolDriverInit (\r
1959 IN EFI_HANDLE ImageHandle,\r
1960 IN EFI_SYSTEM_TABLE *SystemTable\r
1961 );\r
1962\r
1963\r
1964/**\r
1965 Entry point of the section extraction code. Initializes an instance of the\r
1966 section extraction interface and installs it on a new handle.\r
1967\r
1968 @param ImageHandle A handle for the image that is initializing this driver\r
1969 @param SystemTable A pointer to the EFI system table\r
1970\r
1971 @retval EFI_SUCCESS Driver initialized successfully\r
1972 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources\r
1973\r
1974**/\r
1975EFI_STATUS\r
1976EFIAPI\r
1977InitializeSectionExtraction (\r
1978 IN EFI_HANDLE ImageHandle,\r
1979 IN EFI_SYSTEM_TABLE *SystemTable\r
1980 );\r
1981\r
1982\r
1983/**\r
1984 This DXE service routine is used to process a firmware volume. In\r
1985 particular, it can be called by BDS to process a single firmware\r
1986 volume found in a capsule.\r
1987\r
1988 @param FvHeader pointer to a firmware volume header\r
1989 @param Size the size of the buffer pointed to by FvHeader\r
1990 @param FVProtocolHandle the handle on which a firmware volume protocol\r
1991 was produced for the firmware volume passed in.\r
1992\r
1993 @retval EFI_OUT_OF_RESOURCES if an FVB could not be produced due to lack of\r
1994 system resources\r
1995 @retval EFI_VOLUME_CORRUPTED if the volume was corrupted\r
1996 @retval EFI_SUCCESS a firmware volume protocol was produced for the\r
1997 firmware volume\r
1998\r
1999**/\r
2000EFI_STATUS\r
2001EFIAPI\r
2002CoreProcessFirmwareVolume (\r
2003 IN VOID *FvHeader,\r
2004 IN UINTN Size,\r
2005 OUT EFI_HANDLE *FVProtocolHandle\r
2006 );\r
2007\r
2008//\r
2009//Functions used during debug buils\r
2010//\r
2011\r
2012/**\r
2013 Displays Architectural protocols that were not loaded and are required for DXE\r
2014 core to function. Only used in Debug Builds.\r
2015\r
2016**/\r
2017VOID\r
2018CoreDisplayMissingArchProtocols (\r
2019 VOID\r
2020 );\r
2021\r
2022\r
2023/**\r
2024 Traverse the discovered list for any drivers that were discovered but not loaded\r
2025 because the dependency experessions evaluated to false.\r
2026\r
2027**/\r
2028VOID\r
2029CoreDisplayDiscoveredNotDispatched (\r
2030 VOID\r
2031 );\r
2032\r
2033\r
2034/**\r
2035 Place holder function until all the Boot Services and Runtime Services are\r
2036 available.\r
2037\r
2038 @return EFI_NOT_AVAILABLE_YET\r
2039\r
2040**/\r
2041EFI_STATUS\r
2042EFIAPI\r
2043CoreEfiNotAvailableYetArg0 (\r
2044 VOID\r
2045 );\r
2046\r
2047\r
2048/**\r
2049 Place holder function until all the Boot Services and Runtime Services are\r
2050 available.\r
2051\r
2052 @param Arg1 Undefined\r
2053\r
2054 @return EFI_NOT_AVAILABLE_YET\r
2055\r
2056**/\r
2057EFI_STATUS\r
2058EFIAPI\r
2059CoreEfiNotAvailableYetArg1 (\r
2060 UINTN Arg1\r
2061 );\r
2062\r
2063\r
2064/**\r
2065 Place holder function until all the Boot Services and Runtime Services are available.\r
2066\r
2067 @param Arg1 Undefined\r
2068 @param Arg2 Undefined\r
2069\r
2070 @return EFI_NOT_AVAILABLE_YET\r
2071\r
2072**/\r
2073EFI_STATUS\r
2074EFIAPI\r
2075CoreEfiNotAvailableYetArg2 (\r
2076 UINTN Arg1,\r
2077 UINTN Arg2\r
2078 );\r
2079\r
2080\r
2081/**\r
2082 Place holder function until all the Boot Services and Runtime Services are available.\r
2083\r
2084 @param Arg1 Undefined\r
2085 @param Arg2 Undefined\r
2086 @param Arg3 Undefined\r
2087\r
2088 @return EFI_NOT_AVAILABLE_YET\r
2089\r
2090**/\r
2091EFI_STATUS\r
2092EFIAPI\r
2093CoreEfiNotAvailableYetArg3 (\r
2094 UINTN Arg1,\r
2095 UINTN Arg2,\r
2096 UINTN Arg3\r
2097 );\r
2098\r
2099\r
2100/**\r
2101 Place holder function until all the Boot Services and Runtime Services are available.\r
2102\r
2103 @param Arg1 Undefined\r
2104 @param Arg2 Undefined\r
2105 @param Arg3 Undefined\r
2106 @param Arg4 Undefined\r
2107\r
2108 @return EFI_NOT_AVAILABLE_YET\r
2109\r
2110**/\r
2111EFI_STATUS\r
2112EFIAPI\r
2113CoreEfiNotAvailableYetArg4 (\r
2114 UINTN Arg1,\r
2115 UINTN Arg2,\r
2116 UINTN Arg3,\r
2117 UINTN Arg4\r
2118 );\r
2119\r
2120\r
2121/**\r
2122 Place holder function until all the Boot Services and Runtime Services are available.\r
2123\r
2124 @param Arg1 Undefined\r
2125 @param Arg2 Undefined\r
2126 @param Arg3 Undefined\r
2127 @param Arg4 Undefined\r
2128 @param Arg5 Undefined\r
2129\r
2130 @return EFI_NOT_AVAILABLE_YET\r
2131\r
2132**/\r
2133EFI_STATUS\r
2134EFIAPI\r
2135CoreEfiNotAvailableYetArg5 (\r
2136 UINTN Arg1,\r
2137 UINTN Arg2,\r
2138 UINTN Arg3,\r
2139 UINTN Arg4,\r
2140 UINTN Arg5\r
2141 );\r
2142\r
2143\r
2144/**\r
2145 Given a compressed source buffer, this function retrieves the size of the\r
2146 uncompressed buffer and the size of the scratch buffer required to decompress\r
2147 the compressed source buffer.\r
2148\r
2149 The GetInfo() function retrieves the size of the uncompressed buffer and the\r
2150 temporary scratch buffer required to decompress the buffer specified by Source\r
2151 and SourceSize. If the size of the uncompressed buffer or the size of the\r
2152 scratch buffer cannot be determined from the compressed data specified by\r
2153 Source and SourceData, then EFI_INVALID_PARAMETER is returned. Otherwise, the\r
2154 size of the uncompressed buffer is returned in DestinationSize, the size of\r
2155 the scratch buffer is returned in ScratchSize, and EFI_SUCCESS is returned.\r
2156 The GetInfo() function does not have scratch buffer available to perform a\r
2157 thorough checking of the validity of the source data. It just retrieves the\r
2158 "Original Size" field from the beginning bytes of the source data and output\r
2159 it as DestinationSize. And ScratchSize is specific to the decompression\r
2160 implementation.\r
2161\r
2162 @param This A pointer to the EFI_DECOMPRESS_PROTOCOL instance.\r
2163 @param Source The source buffer containing the compressed data.\r
2164 @param SourceSize The size, in bytes, of the source buffer.\r
2165 @param DestinationSize A pointer to the size, in bytes, of the\r
2166 uncompressed buffer that will be generated when the\r
2167 compressed buffer specified by Source and\r
2168 SourceSize is decompressed.\r
2169 @param ScratchSize A pointer to the size, in bytes, of the scratch\r
2170 buffer that is required to decompress the\r
2171 compressed buffer specified by Source and\r
2172 SourceSize.\r
2173\r
2174 @retval EFI_SUCCESS The size of the uncompressed data was returned in\r
2175 DestinationSize and the size of the scratch buffer\r
2176 was returned in ScratchSize.\r
2177 @retval EFI_INVALID_PARAMETER The size of the uncompressed data or the size of\r
2178 the scratch buffer cannot be determined from the\r
2179 compressed data specified by Source and\r
2180 SourceSize.\r
2181\r
2182**/\r
2183EFI_STATUS\r
2184EFIAPI\r
2185DxeMainUefiDecompressGetInfo (\r
2186 IN EFI_DECOMPRESS_PROTOCOL *This,\r
2187 IN VOID *Source,\r
2188 IN UINT32 SourceSize,\r
2189 OUT UINT32 *DestinationSize,\r
2190 OUT UINT32 *ScratchSize\r
2191 );\r
2192\r
2193\r
2194/**\r
2195 Decompresses a compressed source buffer.\r
2196\r
2197 The Decompress() function extracts decompressed data to its original form.\r
2198 This protocol is designed so that the decompression algorithm can be\r
2199 implemented without using any memory services. As a result, the Decompress()\r
2200 Function is not allowed to call AllocatePool() or AllocatePages() in its\r
2201 implementation. It is the caller's responsibility to allocate and free the\r
2202 Destination and Scratch buffers.\r
2203 If the compressed source data specified by Source and SourceSize is\r
2204 sucessfully decompressed into Destination, then EFI_SUCCESS is returned. If\r
2205 the compressed source data specified by Source and SourceSize is not in a\r
2206 valid compressed data format, then EFI_INVALID_PARAMETER is returned.\r
2207\r
2208 @param This A pointer to the EFI_DECOMPRESS_PROTOCOL instance.\r
2209 @param Source The source buffer containing the compressed data.\r
2210 @param SourceSize SourceSizeThe size of source data.\r
2211 @param Destination On output, the destination buffer that contains\r
2212 the uncompressed data.\r
2213 @param DestinationSize The size of the destination buffer. The size of\r
2214 the destination buffer needed is obtained from\r
2215 EFI_DECOMPRESS_PROTOCOL.GetInfo().\r
2216 @param Scratch A temporary scratch buffer that is used to perform\r
2217 the decompression.\r
2218 @param ScratchSize The size of scratch buffer. The size of the\r
2219 scratch buffer needed is obtained from GetInfo().\r
2220\r
2221 @retval EFI_SUCCESS Decompression completed successfully, and the\r
2222 uncompressed buffer is returned in Destination.\r
2223 @retval EFI_INVALID_PARAMETER The source buffer specified by Source and\r
2224 SourceSize is corrupted (not in a valid\r
2225 compressed format).\r
2226\r
2227**/\r
2228EFI_STATUS\r
2229EFIAPI\r
2230DxeMainUefiDecompress (\r
2231 IN EFI_DECOMPRESS_PROTOCOL *This,\r
2232 IN VOID *Source,\r
2233 IN UINT32 SourceSize,\r
2234 IN OUT VOID *Destination,\r
2235 IN UINT32 DestinationSize,\r
2236 IN OUT VOID *Scratch,\r
2237 IN UINT32 ScratchSize\r
2238 );\r
2239\r
2240/**\r
2241 SEP member function. This function creates and returns a new section stream\r
2242 handle to represent the new section stream.\r
2243\r
2244 @param SectionStreamLength Size in bytes of the section stream.\r
2245 @param SectionStream Buffer containing the new section stream.\r
2246 @param SectionStreamHandle A pointer to a caller allocated UINTN that on\r
2247 output contains the new section stream handle.\r
2248\r
2249 @retval EFI_SUCCESS The section stream is created successfully.\r
2250 @retval EFI_OUT_OF_RESOURCES memory allocation failed.\r
2251 @retval EFI_INVALID_PARAMETER Section stream does not end concident with end\r
2252 of last section.\r
2253\r
2254**/\r
2255EFI_STATUS\r
2256EFIAPI\r
2257OpenSectionStream (\r
2258 IN UINTN SectionStreamLength,\r
2259 IN VOID *SectionStream,\r
2260 OUT UINTN *SectionStreamHandle\r
2261 );\r
2262\r
2263\r
2264\r
2265/**\r
2266 SEP member function. Retrieves requested section from section stream.\r
2267\r
2268 @param SectionStreamHandle The section stream from which to extract the\r
2269 requested section.\r
2270 @param SectionType A pointer to the type of section to search for.\r
2271 @param SectionDefinitionGuid If the section type is EFI_SECTION_GUID_DEFINED,\r
2272 then SectionDefinitionGuid indicates which of\r
2273 these types of sections to search for.\r
2274 @param SectionInstance Indicates which instance of the requested\r
2275 section to return.\r
2276 @param Buffer Double indirection to buffer. If *Buffer is\r
2277 non-null on input, then the buffer is caller\r
2278 allocated. If Buffer is NULL, then the buffer\r
2279 is callee allocated. In either case, the\r
2280 requried buffer size is returned in *BufferSize.\r
2281 @param BufferSize On input, indicates the size of *Buffer if\r
2282 *Buffer is non-null on input. On output,\r
2283 indicates the required size (allocated size if\r
2284 callee allocated) of *Buffer.\r
2285 @param AuthenticationStatus A pointer to a caller-allocated UINT32 that\r
2286 indicates the authentication status of the\r
2287 output buffer. If the input section's\r
2288 GuidedSectionHeader.Attributes field\r
2289 has the EFI_GUIDED_SECTION_AUTH_STATUS_VALID\r
2290 bit as clear, AuthenticationStatus must return\r
2291 zero. Both local bits (19:16) and aggregate\r
2292 bits (3:0) in AuthenticationStatus are returned\r
2293 by ExtractSection(). These bits reflect the\r
2294 status of the extraction operation. The bit\r
2295 pattern in both regions must be the same, as\r
2296 the local and aggregate authentication statuses\r
2297 have equivalent meaning at this level. If the\r
2298 function returns anything other than\r
2299 EFI_SUCCESS, the value of *AuthenticationStatus\r
2300 is undefined.\r
2301 @param IsFfs3Fv Indicates the FV format.\r
2302\r
2303 @retval EFI_SUCCESS Section was retrieved successfully\r
2304 @retval EFI_PROTOCOL_ERROR A GUID defined section was encountered in the\r
2305 section stream with its\r
2306 EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set,\r
2307 but there was no corresponding GUIDed Section\r
2308 Extraction Protocol in the handle database.\r
2309 *Buffer is unmodified.\r
2310 @retval EFI_NOT_FOUND An error was encountered when parsing the\r
2311 SectionStream. This indicates the SectionStream\r
2312 is not correctly formatted.\r
2313 @retval EFI_NOT_FOUND The requested section does not exist.\r
2314 @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process\r
2315 the request.\r
2316 @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
2317 @retval EFI_WARN_TOO_SMALL The size of the caller allocated input buffer is\r
2318 insufficient to contain the requested section.\r
2319 The input buffer is filled and section contents\r
2320 are truncated.\r
2321\r
2322**/\r
2323EFI_STATUS\r
2324EFIAPI\r
2325GetSection (\r
2326 IN UINTN SectionStreamHandle,\r
2327 IN EFI_SECTION_TYPE *SectionType,\r
2328 IN EFI_GUID *SectionDefinitionGuid,\r
2329 IN UINTN SectionInstance,\r
2330 IN VOID **Buffer,\r
2331 IN OUT UINTN *BufferSize,\r
2332 OUT UINT32 *AuthenticationStatus,\r
2333 IN BOOLEAN IsFfs3Fv\r
2334 );\r
2335\r
2336\r
2337/**\r
2338 SEP member function. Deletes an existing section stream\r
2339\r
2340 @param StreamHandleToClose Indicates the stream to close\r
2341\r
2342 @retval EFI_SUCCESS The section stream is closed sucessfully.\r
2343 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.\r
2344 @retval EFI_INVALID_PARAMETER Section stream does not end concident with end\r
2345 of last section.\r
2346\r
2347**/\r
2348EFI_STATUS\r
2349EFIAPI\r
2350CloseSectionStream (\r
2351 IN UINTN StreamHandleToClose\r
2352 );\r
2353\r
2354/**\r
2355 Creates and initializes the DebugImageInfo Table. Also creates the configuration\r
2356 table and registers it into the system table.\r
2357\r
2358 Note:\r
2359 This function allocates memory, frees it, and then allocates memory at an\r
2360 address within the initial allocation. Since this function is called early\r
2361 in DXE core initialization (before drivers are dispatched), this should not\r
2362 be a problem.\r
2363\r
2364**/\r
2365VOID\r
2366CoreInitializeDebugImageInfoTable (\r
2367 VOID\r
2368 );\r
2369\r
2370\r
2371/**\r
2372 Update the CRC32 in the Debug Table.\r
2373 Since the CRC32 service is made available by the Runtime driver, we have to\r
2374 wait for the Runtime Driver to be installed before the CRC32 can be computed.\r
2375 This function is called elsewhere by the core when the runtime architectural\r
2376 protocol is produced.\r
2377\r
2378**/\r
2379VOID\r
2380CoreUpdateDebugTableCrc32 (\r
2381 VOID\r
2382 );\r
2383\r
2384\r
2385/**\r
2386 Adds a new DebugImageInfo structure to the DebugImageInfo Table. Re-Allocates\r
2387 the table if it's not large enough to accomidate another entry.\r
2388\r
2389 @param ImageInfoType type of debug image information\r
2390 @param LoadedImage pointer to the loaded image protocol for the image being\r
2391 loaded\r
2392 @param ImageHandle image handle for the image being loaded\r
2393\r
2394**/\r
2395VOID\r
2396CoreNewDebugImageInfoEntry (\r
2397 IN UINT32 ImageInfoType,\r
2398 IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage,\r
2399 IN EFI_HANDLE ImageHandle\r
2400 );\r
2401\r
2402\r
2403/**\r
2404 Removes and frees an entry from the DebugImageInfo Table.\r
2405\r
2406 @param ImageHandle image handle for the image being unloaded\r
2407\r
2408**/\r
2409VOID\r
2410CoreRemoveDebugImageInfoEntry (\r
2411 EFI_HANDLE ImageHandle\r
2412 );\r
2413\r
2414\r
2415/**\r
2416 This routine consumes FV hobs and produces instances of FW_VOL_BLOCK_PROTOCOL as appropriate.\r
2417\r
2418 @param ImageHandle The image handle.\r
2419 @param SystemTable The system table.\r
2420\r
2421 @retval EFI_SUCCESS Successfully initialized firmware volume block\r
2422 driver.\r
2423\r
2424**/\r
2425EFI_STATUS\r
2426EFIAPI\r
2427FwVolBlockDriverInit (\r
2428 IN EFI_HANDLE ImageHandle,\r
2429 IN EFI_SYSTEM_TABLE *SystemTable\r
2430 );\r
2431\r
2432/**\r
2433\r
2434 Get FVB authentication status\r
2435\r
2436 @param FvbProtocol FVB protocol.\r
2437\r
2438 @return Authentication status.\r
2439\r
2440**/\r
2441UINT32\r
2442GetFvbAuthenticationStatus (\r
2443 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvbProtocol\r
2444 );\r
2445\r
2446/**\r
2447 This routine produces a firmware volume block protocol on a given\r
2448 buffer.\r
2449\r
2450 @param BaseAddress base address of the firmware volume image\r
2451 @param Length length of the firmware volume image\r
2452 @param ParentHandle handle of parent firmware volume, if this image\r
2453 came from an FV image file and section in another firmware\r
2454 volume (ala capsules)\r
2455 @param AuthenticationStatus Authentication status inherited, if this image\r
2456 came from an FV image file and section in another firmware volume.\r
2457 @param FvProtocol Firmware volume block protocol produced.\r
2458\r
2459 @retval EFI_VOLUME_CORRUPTED Volume corrupted.\r
2460 @retval EFI_OUT_OF_RESOURCES No enough buffer to be allocated.\r
2461 @retval EFI_SUCCESS Successfully produced a FVB protocol on given\r
2462 buffer.\r
2463\r
2464**/\r
2465EFI_STATUS\r
2466ProduceFVBProtocolOnBuffer (\r
2467 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
2468 IN UINT64 Length,\r
2469 IN EFI_HANDLE ParentHandle,\r
2470 IN UINT32 AuthenticationStatus,\r
2471 OUT EFI_HANDLE *FvProtocol OPTIONAL\r
2472 );\r
2473\r
2474\r
2475/**\r
2476 Raising to the task priority level of the mutual exclusion\r
2477 lock, and then acquires ownership of the lock.\r
2478\r
2479 @param Lock The lock to acquire\r
2480\r
2481 @return Lock owned\r
2482\r
2483**/\r
2484VOID\r
2485CoreAcquireLock (\r
2486 IN EFI_LOCK *Lock\r
2487 );\r
2488\r
2489\r
2490/**\r
2491 Initialize a basic mutual exclusion lock. Each lock\r
2492 provides mutual exclusion access at it's task priority\r
2493 level. Since there is no-premption (at any TPL) or\r
2494 multiprocessor support, acquiring the lock only consists\r
2495 of raising to the locks TPL.\r
2496\r
2497 @param Lock The EFI_LOCK structure to initialize\r
2498\r
2499 @retval EFI_SUCCESS Lock Owned.\r
2500 @retval EFI_ACCESS_DENIED Reentrant Lock Acquisition, Lock not Owned.\r
2501\r
2502**/\r
2503EFI_STATUS\r
2504CoreAcquireLockOrFail (\r
2505 IN EFI_LOCK *Lock\r
2506 );\r
2507\r
2508\r
2509/**\r
2510 Releases ownership of the mutual exclusion lock, and\r
2511 restores the previous task priority level.\r
2512\r
2513 @param Lock The lock to release\r
2514\r
2515 @return Lock unowned\r
2516\r
2517**/\r
2518VOID\r
2519CoreReleaseLock (\r
2520 IN EFI_LOCK *Lock\r
2521 );\r
2522\r
2523\r
2524/**\r
2525 An empty function to pass error checking of CreateEventEx ().\r
2526\r
2527 @param Event Event whose notification function is being invoked.\r
2528 @param Context Pointer to the notification function's context,\r
2529 which is implementation-dependent.\r
2530\r
2531**/\r
2532VOID\r
2533EFIAPI\r
2534CoreEmptyCallbackFunction (\r
2535 IN EFI_EVENT Event,\r
2536 IN VOID *Context\r
2537 );\r
2538\r
2539/**\r
2540 Read data from Firmware Block by FVB protocol Read. \r
2541 The data may cross the multi block ranges.\r
2542\r
2543 @param Fvb The FW_VOL_BLOCK_PROTOCOL instance from which to read data.\r
2544 @param StartLba Pointer to StartLba.\r
2545 On input, the start logical block index from which to read.\r
2546 On output,the end logical block index after reading.\r
2547 @param Offset Pointer to Offset\r
2548 On input, offset into the block at which to begin reading.\r
2549 On output, offset into the end block after reading.\r
2550 @param DataSize Size of data to be read.\r
2551 @param Data Pointer to Buffer that the data will be read into.\r
2552\r
2553 @retval EFI_SUCCESS Successfully read data from firmware block.\r
2554 @retval others\r
2555**/\r
2556EFI_STATUS\r
2557ReadFvbData (\r
2558 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb,\r
2559 IN OUT EFI_LBA *StartLba,\r
2560 IN OUT UINTN *Offset,\r
2561 IN UINTN DataSize,\r
2562 OUT UINT8 *Data\r
2563 );\r
2564\r
2565/**\r
2566 Given the supplied FW_VOL_BLOCK_PROTOCOL, allocate a buffer for output and\r
2567 copy the real length volume header into it.\r
2568\r
2569 @param Fvb The FW_VOL_BLOCK_PROTOCOL instance from which to\r
2570 read the volume header\r
2571 @param FwVolHeader Pointer to pointer to allocated buffer in which\r
2572 the volume header is returned.\r
2573\r
2574 @retval EFI_OUT_OF_RESOURCES No enough buffer could be allocated.\r
2575 @retval EFI_SUCCESS Successfully read volume header to the allocated\r
2576 buffer.\r
2577\r
2578**/\r
2579EFI_STATUS\r
2580GetFwVolHeader (\r
2581 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb,\r
2582 OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader\r
2583 );\r
2584\r
2585/**\r
2586 Verify checksum of the firmware volume header.\r
2587\r
2588 @param FvHeader Points to the firmware volume header to be checked\r
2589\r
2590 @retval TRUE Checksum verification passed\r
2591 @retval FALSE Checksum verification failed\r
2592\r
2593**/\r
2594BOOLEAN\r
2595VerifyFvHeaderChecksum (\r
2596 IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader\r
2597 );\r
2598\r
2599#endif\r