3 The internal header file includes the common header files, defines
4 internal structure and functions used by DxeCore module.
6 Copyright (c) 2006 - 2008, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
24 #include <Protocol/LoadedImage.h>
25 #include <Protocol/GuidedSectionExtraction.h>
26 #include <Guid/DebugImageInfoTable.h>
27 #include <Protocol/DevicePath.h>
28 #include <Protocol/Runtime.h>
29 #include <Protocol/LoadFile.h>
30 #include <Protocol/DriverBinding.h>
31 #include <Protocol/VariableWrite.h>
32 #include <Protocol/PlatformDriverOverride.h>
33 #include <Protocol/Variable.h>
34 #include <Guid/MemoryTypeInformation.h>
35 #include <Guid/FirmwareFileSystem2.h>
36 #include <Guid/HobList.h>
37 #include <Protocol/Timer.h>
38 #include <Protocol/SimpleFileSystem.h>
39 #include <Protocol/Bds.h>
40 #include <Guid/FileInfo.h>
41 #include <Protocol/RealTimeClock.h>
42 #include <Guid/Apriori.h>
43 #include <Protocol/WatchdogTimer.h>
44 #include <Protocol/FirmwareVolume2.h>
45 #include <Protocol/MonotonicCounter.h>
46 #include <Guid/DxeServices.h>
47 #include <Guid/MemoryAllocationHob.h>
48 #include <Protocol/StatusCode.h>
49 #include <Protocol/CustomizedDecompress.h>
50 #include <Protocol/Decompress.h>
51 #include <Protocol/LoadPe32Image.h>
52 #include <Protocol/FirmwareVolumeDispatch.h>
53 #include <Protocol/Security.h>
54 #include <Protocol/Ebc.h>
55 #include <Guid/EventLegacyBios.h>
56 #include <Protocol/Reset.h>
57 #include <Protocol/EdkDecompress.h>
58 #include <Protocol/Cpu.h>
59 #include <Guid/EventGroup.h>
60 #include <Protocol/Metronome.h>
61 #include <Protocol/FirmwareVolumeBlock.h>
62 #include <Protocol/Capsule.h>
63 #include <Protocol/BusSpecificDriverOverride.h>
64 #include <Protocol/Performance.h>
65 #include <Uefi/UefiTcgPlatform.h>
66 #include <Protocol/TcgPlatform.h>
68 #include <Library/DxeCoreEntryPoint.h>
69 #include <Library/DebugLib.h>
70 #include <Library/UefiLib.h>
71 #include <Library/BaseLib.h>
72 #include <Library/HobLib.h>
73 #include <Library/PerformanceLib.h>
74 #include <Library/UefiDecompressLib.h>
75 #include <Library/ExtractGuidedSectionLib.h>
76 #include <Library/CacheMaintenanceLib.h>
77 #include <Library/BaseMemoryLib.h>
78 #include <Library/PeCoffLib.h>
79 #include <Library/PcdLib.h>
80 #include <Library/MemoryAllocationLib.h>
82 #include "DebugImageInfo.h"
84 #include "FwVolBlock.h"
85 #include "FwVolDriver.h"
94 // Modifier for EFI DXE Services
96 #define EFI_DXESERVICE
99 // attributes for reserved memory before it is promoted to system memory
101 #define EFI_MEMORY_PRESENT 0x0100000000000000ULL
102 #define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL
103 #define EFI_MEMORY_TESTED 0x0400000000000000ULL
106 // range for memory mapped port I/O on IPF
108 #define EFI_MEMORY_PORT_IO 0x4000000000000000ULL
112 /// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependecy expression
113 /// to save time. A EFI_DEP_PUSH is evauated one an
114 /// replaced with EFI_DEP_REPLACE_TRUE
116 #define EFI_DEP_REPLACE_TRUE 0xff
119 /// Define the initial size of the dependency expression evaluation stack
121 #define DEPEX_STACK_SIZE_INCREMENT 0x1000
124 EFI_GUID
*ProtocolGuid
;
129 } ARCHITECTURAL_PROTOCOL_ENTRY
;
132 EFI_STATUS_CODE_DATA DataHeader
;
134 } EFI_DXE_DEVICE_HANDLE_EXTENDED_DATA
;
136 #define EFI_STATUS_CODE_DXE_CORE_GUID \
137 { 0x335984bd, 0xe805, 0x409a, { 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6 } }
140 // DXE Dispatcher Data structures
143 #define KNOWN_HANDLE_SIGNATURE EFI_SIGNATURE_32('k','n','o','w')
146 LIST_ENTRY Link
; // mFvHandleList
151 #define EFI_CORE_DRIVER_ENTRY_SIGNATURE EFI_SIGNATURE_32('d','r','v','r')
154 LIST_ENTRY Link
; // mDriverList
156 LIST_ENTRY ScheduledLink
; // mScheduledQueue
160 EFI_DEVICE_PATH_PROTOCOL
*FvFileDevicePath
;
161 EFI_FIRMWARE_VOLUME2_PROTOCOL
*Fv
;
168 EFI_GUID BeforeAfterGuid
;
175 BOOLEAN DepexProtocolError
;
177 EFI_HANDLE ImageHandle
;
179 } EFI_CORE_DRIVER_ENTRY
;
182 //The data structure of GCD memory map entry
184 #define EFI_GCD_MAP_SIGNATURE EFI_SIGNATURE_32('g','c','d','m')
188 EFI_PHYSICAL_ADDRESS BaseAddress
;
192 EFI_GCD_MEMORY_TYPE GcdMemoryType
;
193 EFI_GCD_IO_TYPE GcdIoType
;
194 EFI_HANDLE ImageHandle
;
195 EFI_HANDLE DeviceHandle
;
199 // DXE Core Global Variables
201 extern EFI_SYSTEM_TABLE
*gDxeCoreST
;
202 extern EFI_BOOT_SERVICES
*gDxeCoreBS
;
203 extern EFI_RUNTIME_SERVICES
*gDxeCoreRT
;
204 extern EFI_DXE_SERVICES
*gDxeCoreDS
;
205 extern EFI_HANDLE gDxeCoreImageHandle
;
207 extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress
;
209 extern EFI_RUNTIME_ARCH_PROTOCOL
*gRuntime
;
210 extern EFI_CPU_ARCH_PROTOCOL
*gCpu
;
211 extern EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
*gWatchdogTimer
;
212 extern EFI_METRONOME_ARCH_PROTOCOL
*gMetronome
;
213 extern EFI_TIMER_ARCH_PROTOCOL
*gTimer
;
214 extern EFI_SECURITY_ARCH_PROTOCOL
*gSecurity
;
215 extern EFI_BDS_ARCH_PROTOCOL
*gBds
;
216 extern EFI_STATUS_CODE_PROTOCOL
*gStatusCode
;
218 extern EFI_TPL gEfiCurrentTpl
;
220 extern EFI_GUID
*gDxeCoreFileName
;
221 extern EFI_LOADED_IMAGE_PROTOCOL
*gDxeCoreLoadedImage
;
223 extern EFI_MEMORY_TYPE_INFORMATION gMemoryTypeInformation
[EfiMaxMemoryType
+ 1];
225 extern BOOLEAN gDispatcherRunning
;
226 extern EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate
;
229 // Service Initialization Functions
235 Called to initialize the pool.
246 Called to initialize the memory map and add descriptors to
247 the current descriptor list.
248 The first descriptor that is added must be general usable
249 memory as the addition allocates heap.
251 @param Type The type of memory to add
252 @param Start The starting address in the memory range Must be
254 @param NumberOfPages The number of pages in the range
255 @param Attribute Attributes of the memory to add
257 @return None. The range is added to the memory map
261 CoreAddMemoryDescriptor (
262 IN EFI_MEMORY_TYPE Type
,
263 IN EFI_PHYSICAL_ADDRESS Start
,
264 IN UINT64 NumberOfPages
,
271 Release memory lock on mGcdMemorySpaceLock.
275 CoreReleaseGcdMemoryLock (
282 Acquire memory lock on mGcdMemorySpaceLock.
286 CoreAcquireGcdMemoryLock (
293 External function. Initializes the GCD and memory services based on the memory
294 descriptor HOBs. This function is responsible for priming the GCD map and the
295 memory map, so memory allocations and resource allocations can be made. The first
296 part of this function can not depend on any memory services until at least one
297 memory descriptor is provided to the memory services. Then the memory services
298 can be used to intialize the GCD map.
300 @param HobStart The start address of the HOB.
301 @param MemoryBaseAddress Start address of memory region found to init DXE
303 @param MemoryLength Length of memory region found to init DXE core.
305 @retval EFI_SUCCESS Memory services successfully initialized.
309 CoreInitializeMemoryServices (
311 IN EFI_PHYSICAL_ADDRESS
*MemoryBaseAddress
,
312 IN UINT64
*MemoryLength
319 External function. Initializes the GCD and memory services based on the memory
320 descriptor HOBs. This function is responsible for priming the GCD map and the
321 memory map, so memory allocations and resource allocations can be made. The first
322 part of this function can not depend on any memory services until at least one
323 memory descriptor is provided to the memory services. Then the memory services
324 can be used to intialize the GCD map. The HobStart will be relocated to a pool
327 @param HobStart The start address of the HOB
328 @param MemoryBaseAddress Start address of memory region found to init DXE
330 @param MemoryLength Length of memory region found to init DXE core.
332 @retval EFI_SUCCESS GCD services successfully initialized.
336 CoreInitializeGcdServices (
337 IN OUT VOID
**HobStart
,
338 IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress
,
339 IN UINT64 MemoryLength
345 Initializes "event" support and populates parts of the System and Runtime Table.
348 @retval EFI_SUCCESS Always return success
352 CoreInitializeEventServices (
359 Add the Image Services to EFI Boot Services Table and install the protocol
360 interfaces for this image.
362 @param HobStart The HOB to initialize
368 CoreInitializeImageServices (
375 Creates an event that is fired everytime a Protocol of a specific type is installed.
379 CoreNotifyOnArchProtocolInstallation (
386 Return TRUE if all AP services are availible.
389 @retval EFI_SUCCESS All AP services are available
390 @retval EFI_NOT_FOUND At least one AP service is not available
394 CoreAllEfiServicesAvailable (
401 Calcualte the 32-bit CRC in a EFI table using the service provided by the
404 @param Hdr Pointer to an EFI standard header
409 IN OUT EFI_TABLE_HEADER
*Hdr
415 Called by the platform code to process a tick.
417 @param Duration The number of 100ns elasped since the last call
430 Initialize the dispatcher. Initialize the notification function that runs when
431 a FV protocol is added to the system.
435 CoreInitializeDispatcher (
442 This is the POSTFIX version of the dependency evaluator. This code does
443 not need to handle Before or After, as it is not valid to call this
444 routine in this case. The SOR is just ignored and is a nop in the grammer.
445 POSTFIX means all the math is done on top of the stack.
447 @param DriverEntry DriverEntry element to update
449 @retval TRUE If driver is ready to run.
450 @retval FALSE If driver is not ready to run or some fatal error
456 IN EFI_CORE_DRIVER_ENTRY
*DriverEntry
462 Preprocess dependency expression and update DriverEntry to reflect the
463 state of Before, After, and SOR dependencies. If DriverEntry->Before
464 or DriverEntry->After is set it will never be cleared. If SOR is set
465 it will be cleared by CoreSchedule(), and then the driver can be
468 @param DriverEntry DriverEntry element to update
470 @retval EFI_SUCCESS It always works.
474 CorePreProcessDepex (
475 IN EFI_CORE_DRIVER_ENTRY
*DriverEntry
482 Terminates all boot services.
484 @param ImageHandle Handle that identifies the exiting image.
485 @param MapKey Key to the latest memory map.
487 @retval EFI_SUCCESS Boot Services terminated
488 @retval EFI_INVALID_PARAMETER MapKey is incorrect.
493 CoreExitBootServices (
494 IN EFI_HANDLE ImageHandle
,
501 Make sure the memory map is following all the construction rules,
502 it is the last time to check memory map error before exit boot services.
504 @param MapKey Memory map key
506 @retval EFI_INVALID_PARAMETER Memory map not consistent with construction
508 @retval EFI_SUCCESS Valid memory map.
512 CoreTerminateMemoryMap (
519 Signals all events in the EventGroup.
521 @param EventGroup The list to signal
525 CoreNotifySignalList (
526 IN EFI_GUID
*EventGroup
533 Boot Service called to add, modify, or remove a system configuration table from
534 the EFI System Table.
536 @param Guid Pointer to the GUID for the entry to add, update, or
538 @param Table Pointer to the configuration table for the entry to add,
539 update, or remove, may be NULL.
541 @return EFI_SUCCESS Guid, Table pair added, updated, or removed.
542 @return EFI_INVALID_PARAMETER Input GUID not valid.
543 @return EFI_NOT_FOUND Attempted to delete non-existant entry
544 @return EFI_OUT_OF_RESOURCES Not enough memory available
549 CoreInstallConfigurationTable (
558 Raise the task priority level to the new level.
559 High level is implemented by disabling processor interrupts.
561 @param NewTpl New task priority level
563 @return The previous task priority level
576 Lowers the task priority to the previous value. If the new
577 priority unmasks events at a higher priority, they are dispatched.
579 @param NewTpl New, lower, task priority
592 Introduces a fine-grained stall.
594 @param Microseconds The number of microseconds to stall execution.
596 @retval EFI_SUCCESS Execution was stalled for at least the requested
597 amount of microseconds.
598 @retval EFI_NOT_AVAILABLE_YET gMetronome is not available yet
604 IN UINTN Microseconds
611 Sets the system's watchdog timer.
613 @param Timeout The number of seconds to set the watchdog timer to.
614 A value of zero disables the timer.
615 @param WatchdogCode The numeric code to log on a watchdog timer timeout
616 event. The firmware reserves codes 0x0000 to 0xFFFF.
617 Loaders and operating systems may use other timeout
619 @param DataSize The size, in bytes, of WatchdogData.
620 @param WatchdogData A data buffer that includes a Null-terminated Unicode
621 string, optionally followed by additional binary data.
622 The string is a description that the call may use to
623 further indicate the reason to be logged with a
626 @return EFI_SUCCESS Timeout has been set
627 @return EFI_NOT_AVAILABLE_YET WatchdogTimer is not available yet
628 @return EFI_UNSUPPORTED System does not have a timer (currently not used)
629 @return EFI_DEVICE_ERROR Could not complete due to hardware error
634 CoreSetWatchdogTimer (
636 IN UINT64 WatchdogCode
,
638 IN CHAR16
*WatchdogData OPTIONAL
645 Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which
646 Calls the private one which contains a BOOLEAN parameter for notifications
648 @param UserHandle The handle to install the protocol handler on,
649 or NULL if a new handle is to be allocated
650 @param Protocol The protocol to add to the handle
651 @param InterfaceType Indicates whether Interface is supplied in
653 @param Interface The interface for the protocol being added
660 CoreInstallProtocolInterface (
661 IN OUT EFI_HANDLE
*UserHandle
,
662 IN EFI_GUID
*Protocol
,
663 IN EFI_INTERFACE_TYPE InterfaceType
,
670 Installs a protocol interface into the boot services environment.
672 @param UserHandle The handle to install the protocol handler on,
673 or NULL if a new handle is to be allocated
674 @param Protocol The protocol to add to the handle
675 @param InterfaceType Indicates whether Interface is supplied in
677 @param Interface The interface for the protocol being added
678 @param Notify indicates whether notify the notification list
681 @retval EFI_INVALID_PARAMETER Invalid parameter
682 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
683 @retval EFI_SUCCESS Protocol interface successfully installed
687 CoreInstallProtocolInterfaceNotify (
688 IN OUT EFI_HANDLE
*UserHandle
,
689 IN EFI_GUID
*Protocol
,
690 IN EFI_INTERFACE_TYPE InterfaceType
,
699 Installs a list of protocol interface into the boot services environment.
700 This function calls InstallProtocolInterface() in a loop. If any error
701 occures all the protocols added by this function are removed. This is
702 basically a lib function to save space.
704 @param Handle The handle to install the protocol handlers on,
705 or NULL if a new handle is to be allocated
706 @param ... EFI_GUID followed by protocol instance. A NULL
707 terminates the list. The pairs are the
708 arguments to InstallProtocolInterface(). All the
709 protocols are added to Handle.
711 @retval EFI_INVALID_PARAMETER Handle is NULL.
712 @retval EFI_SUCCESS Protocol interfaces successfully installed.
717 CoreInstallMultipleProtocolInterfaces (
718 IN OUT EFI_HANDLE
*Handle
,
726 Uninstalls a list of protocol interface in the boot services environment.
727 This function calls UnisatllProtocolInterface() in a loop. This is
728 basically a lib function to save space.
730 @param Handle The handle to uninstall the protocol
731 @param ... EFI_GUID followed by protocol instance. A NULL
732 terminates the list. The pairs are the
733 arguments to UninstallProtocolInterface(). All
734 the protocols are added to Handle.
741 CoreUninstallMultipleProtocolInterfaces (
742 IN EFI_HANDLE Handle
,
750 Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.
752 @param UserHandle Handle on which the interface is to be
754 @param Protocol The numeric ID of the interface
755 @param OldInterface A pointer to the old interface
756 @param NewInterface A pointer to the new interface
758 @retval EFI_SUCCESS The protocol interface was installed
759 @retval EFI_NOT_FOUND The OldInterface on the handle was not found
760 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value
765 CoreReinstallProtocolInterface (
766 IN EFI_HANDLE UserHandle
,
767 IN EFI_GUID
*Protocol
,
768 IN VOID
*OldInterface
,
769 IN VOID
*NewInterface
776 Uninstalls all instances of a protocol:interfacer from a handle.
777 If the last protocol interface is remove from the handle, the
780 @param UserHandle The handle to remove the protocol handler from
781 @param Protocol The protocol, of protocol:interface, to remove
782 @param Interface The interface, of protocol:interface, to remove
784 @retval EFI_INVALID_PARAMETER Protocol is NULL.
785 @retval EFI_SUCCESS Protocol interface successfully uninstalled.
790 CoreUninstallProtocolInterface (
791 IN EFI_HANDLE UserHandle
,
792 IN EFI_GUID
*Protocol
,
800 Queries a handle to determine if it supports a specified protocol.
802 @param UserHandle The handle being queried.
803 @param Protocol The published unique identifier of the protocol.
804 @param Interface Supplies the address where a pointer to the
805 corresponding Protocol Interface is returned.
807 @return The requested protocol interface for the handle
813 IN EFI_HANDLE UserHandle
,
814 IN EFI_GUID
*Protocol
,
822 Locates the installed protocol handler for the handle, and
823 invokes it to obtain the protocol interface. Usage information
824 is registered in the protocol data base.
826 @param UserHandle The handle to obtain the protocol interface on
827 @param Protocol The ID of the protocol
828 @param Interface The location to return the protocol interface
829 @param ImageHandle The handle of the Image that is opening the
830 protocol interface specified by Protocol and
832 @param ControllerHandle The controller handle that is requiring this
834 @param Attributes The open mode of the protocol interface
835 specified by Handle and Protocol.
837 @retval EFI_INVALID_PARAMETER Protocol is NULL.
838 @retval EFI_SUCCESS Get the protocol interface.
844 IN EFI_HANDLE UserHandle
,
845 IN EFI_GUID
*Protocol
,
846 OUT VOID
**Interface OPTIONAL
,
847 IN EFI_HANDLE ImageHandle
,
848 IN EFI_HANDLE ControllerHandle
,
856 Return information about Opened protocols in the system
858 @param UserHandle The handle to close the protocol interface on
859 @param Protocol The ID of the protocol
860 @param EntryBuffer A pointer to a buffer of open protocol
861 information in the form of
862 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
863 @param EntryCount Number of EntryBuffer entries
868 CoreOpenProtocolInformation (
869 IN EFI_HANDLE UserHandle
,
870 IN EFI_GUID
*Protocol
,
871 OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
**EntryBuffer
,
872 OUT UINTN
*EntryCount
879 Closes a protocol on a handle that was opened using OpenProtocol().
881 @param UserHandle The handle for the protocol interface that was
882 previously opened with OpenProtocol(), and is
884 @param Protocol The published unique identifier of the protocol.
885 It is the caller's responsibility to pass in a
887 @param AgentHandle The handle of the agent that is closing the
889 @param ControllerHandle If the agent that opened a protocol is a driver
890 that follows the EFI Driver Model, then this
891 parameter is the controller handle that required
892 the protocol interface. If the agent does not
893 follow the EFI Driver Model, then this parameter
894 is optional and may be NULL.
896 @retval EFI_SUCCESS The protocol instance was closed.
897 @retval EFI_INVALID_PARAMETER Handle, AgentHandle or ControllerHandle is not a
899 @retval EFI_NOT_FOUND Can not find the specified protocol or
906 IN EFI_HANDLE UserHandle
,
907 IN EFI_GUID
*Protocol
,
908 IN EFI_HANDLE AgentHandle
,
909 IN EFI_HANDLE ControllerHandle
916 Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated
919 @param UserHandle The handle from which to retrieve the list of
920 protocol interface GUIDs.
921 @param ProtocolBuffer A pointer to the list of protocol interface GUID
922 pointers that are installed on Handle.
923 @param ProtocolBufferCount A pointer to the number of GUID pointers present
926 @retval EFI_SUCCESS The list of protocol interface GUIDs installed
927 on Handle was returned in ProtocolBuffer. The
928 number of protocol interface GUIDs was returned
929 in ProtocolBufferCount.
930 @retval EFI_INVALID_PARAMETER Handle is NULL.
931 @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
932 @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.
933 @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.
934 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the
940 CoreProtocolsPerHandle (
941 IN EFI_HANDLE UserHandle
,
942 OUT EFI_GUID
***ProtocolBuffer
,
943 OUT UINTN
*ProtocolBufferCount
950 Add a new protocol notification record for the request protocol.
952 @param Protocol The requested protocol to add the notify
954 @param Event The event to signal
955 @param Registration Returns the registration record
957 @retval EFI_INVALID_PARAMETER Invalid parameter
958 @retval EFI_SUCCESS Successfully returned the registration record
964 CoreRegisterProtocolNotify (
965 IN EFI_GUID
*Protocol
,
967 OUT VOID
**Registration
974 Locates the requested handle(s) and returns them in Buffer.
976 @param SearchType The type of search to perform to locate the
978 @param Protocol The protocol to search for
979 @param SearchKey Dependant on SearchType
980 @param BufferSize On input the size of Buffer. On output the
981 size of data returned.
982 @param Buffer The buffer to return the results in
984 @retval EFI_BUFFER_TOO_SMALL Buffer too small, required buffer size is
985 returned in BufferSize.
986 @retval EFI_INVALID_PARAMETER Invalid parameter
987 @retval EFI_SUCCESS Successfully found the requested handle(s) and
988 returns them in Buffer.
994 IN EFI_LOCATE_SEARCH_TYPE SearchType
,
995 IN EFI_GUID
*Protocol OPTIONAL
,
996 IN VOID
*SearchKey OPTIONAL
,
997 IN OUT UINTN
*BufferSize
,
998 OUT EFI_HANDLE
*Buffer
1005 Locates the handle to a device on the device path that best matches the specified protocol.
1007 @param Protocol The protocol to search for.
1008 @param DevicePath On input, a pointer to a pointer to the device
1009 path. On output, the device path pointer is
1010 modified to point to the remaining part of the
1012 @param Device A pointer to the returned device handle.
1014 @retval EFI_SUCCESS The resulting handle was returned.
1015 @retval EFI_NOT_FOUND No handles matched the search.
1016 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1021 CoreLocateDevicePath (
1022 IN EFI_GUID
*Protocol
,
1023 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
,
1024 OUT EFI_HANDLE
*Device
1031 Function returns an array of handles that support the requested protocol
1032 in a buffer allocated from pool. This is a version of CoreLocateHandle()
1033 that allocates a buffer for the caller.
1035 @param SearchType Specifies which handle(s) are to be returned.
1036 @param Protocol Provides the protocol to search by. This
1037 parameter is only valid for SearchType
1039 @param SearchKey Supplies the search key depending on the
1041 @param NumberHandles The number of handles returned in Buffer.
1042 @param Buffer A pointer to the buffer to return the requested
1043 array of handles that support Protocol.
1045 @retval EFI_SUCCESS The result array of handles was returned.
1046 @retval EFI_NOT_FOUND No handles match the search.
1047 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the
1049 @retval EFI_INVALID_PARAMETER Invalid parameter
1054 CoreLocateHandleBuffer (
1055 IN EFI_LOCATE_SEARCH_TYPE SearchType
,
1056 IN EFI_GUID
*Protocol OPTIONAL
,
1057 IN VOID
*SearchKey OPTIONAL
,
1058 IN OUT UINTN
*NumberHandles
,
1059 OUT EFI_HANDLE
**Buffer
1066 Return the first Protocol Interface that matches the Protocol GUID. If
1067 Registration is pasased in return a Protocol Instance that was just add
1068 to the system. If Retistration is NULL return the first Protocol Interface
1071 @param Protocol The protocol to search for
1072 @param Registration Optional Registration Key returned from
1073 RegisterProtocolNotify()
1074 @param Interface Return the Protocol interface (instance).
1076 @retval EFI_SUCCESS If a valid Interface is returned
1077 @retval EFI_INVALID_PARAMETER Invalid parameter
1078 @retval EFI_NOT_FOUND Protocol interface not found
1083 CoreLocateProtocol (
1084 IN EFI_GUID
*Protocol
,
1085 IN VOID
*Registration OPTIONAL
,
1086 OUT VOID
**Interface
1092 return handle database key.
1095 @return Handle database key.
1099 CoreGetHandleDatabaseKey (
1106 Go connect any handles that were created or modified while a image executed.
1108 @param Key The Key to show that the handle has been
1113 CoreConnectHandlesByKey (
1121 Connects one or more drivers to a controller.
1123 @param ControllerHandle Handle of the controller to be
1125 @param DriverImageHandle DriverImageHandle A pointer to an
1126 ordered list of driver image
1128 @param RemainingDevicePath RemainingDevicePath A pointer to
1129 the device path that specifies a
1130 child of the controller specified
1131 by ControllerHandle.
1132 @param Recursive Whether the function would be
1133 called recursively or not.
1135 @return Status code.
1140 CoreConnectController (
1141 IN EFI_HANDLE ControllerHandle
,
1142 IN EFI_HANDLE
*DriverImageHandle OPTIONAL
,
1143 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
,
1144 IN BOOLEAN Recursive
1151 Disonnects a controller from a driver
1153 @param ControllerHandle ControllerHandle The handle of
1154 the controller from which
1157 @param DriverImageHandle DriverImageHandle The driver to
1158 disconnect from ControllerHandle.
1159 @param ChildHandle ChildHandle The handle of the
1162 @retval EFI_SUCCESS One or more drivers were
1163 disconnected from the controller.
1164 @retval EFI_SUCCESS On entry, no drivers are managing
1166 @retval EFI_SUCCESS DriverImageHandle is not NULL,
1167 and on entry DriverImageHandle is
1168 not managing ControllerHandle.
1169 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid
1171 @retval EFI_INVALID_PARAMETER DriverImageHandle is not NULL,
1172 and it is not a valid EFI_HANDLE.
1173 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it
1174 is not a valid EFI_HANDLE.
1175 @retval EFI_OUT_OF_RESOURCES There are not enough resources
1176 available to disconnect any
1177 drivers from ControllerHandle.
1178 @retval EFI_DEVICE_ERROR The controller could not be
1179 disconnected because of a device
1185 CoreDisconnectController (
1186 IN EFI_HANDLE ControllerHandle
,
1187 IN EFI_HANDLE DriverImageHandle OPTIONAL
,
1188 IN EFI_HANDLE ChildHandle OPTIONAL
1195 Allocates pages from the memory map.
1197 @param Type The type of allocation to perform
1198 @param MemoryType The type of memory to turn the allocated pages
1200 @param NumberOfPages The number of pages to allocate
1201 @param Memory A pointer to receive the base allocated memory
1204 @return Status. On success, Memory is filled in with the base address allocated
1205 @retval EFI_INVALID_PARAMETER Parameters violate checking rules defined in
1207 @retval EFI_NOT_FOUND Could not allocate pages match the requirement.
1208 @retval EFI_OUT_OF_RESOURCES No enough pages to allocate.
1209 @retval EFI_SUCCESS Pages successfully allocated.
1215 IN EFI_ALLOCATE_TYPE Type
,
1216 IN EFI_MEMORY_TYPE MemoryType
,
1217 IN UINTN NumberOfPages
,
1218 IN OUT EFI_PHYSICAL_ADDRESS
*Memory
1225 Frees previous allocated pages.
1227 @param Memory Base address of memory being freed
1228 @param NumberOfPages The number of pages to free
1230 @retval EFI_NOT_FOUND Could not find the entry that covers the range
1231 @retval EFI_INVALID_PARAMETER Address not aligned
1232 @return EFI_SUCCESS -Pages successfully freed.
1238 IN EFI_PHYSICAL_ADDRESS Memory
,
1239 IN UINTN NumberOfPages
1246 This function returns a copy of the current memory map. The map is an array of
1247 memory descriptors, each of which describes a contiguous block of memory.
1249 @param MemoryMapSize A pointer to the size, in bytes, of the
1250 MemoryMap buffer. On input, this is the size of
1251 the buffer allocated by the caller. On output,
1252 it is the size of the buffer returned by the
1253 firmware if the buffer was large enough, or the
1254 size of the buffer needed to contain the map if
1255 the buffer was too small.
1256 @param MemoryMap A pointer to the buffer in which firmware places
1257 the current memory map.
1258 @param MapKey A pointer to the location in which firmware
1259 returns the key for the current memory map.
1260 @param DescriptorSize A pointer to the location in which firmware
1261 returns the size, in bytes, of an individual
1262 EFI_MEMORY_DESCRIPTOR.
1263 @param DescriptorVersion A pointer to the location in which firmware
1264 returns the version number associated with the
1265 EFI_MEMORY_DESCRIPTOR.
1267 @retval EFI_SUCCESS The memory map was returned in the MemoryMap
1269 @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current
1270 buffer size needed to hold the memory map is
1271 returned in MemoryMapSize.
1272 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1278 IN OUT UINTN
*MemoryMapSize
,
1279 IN OUT EFI_MEMORY_DESCRIPTOR
*MemoryMap
,
1281 OUT UINTN
*DescriptorSize
,
1282 OUT UINT32
*DescriptorVersion
1289 Allocate pool of a particular type.
1291 @param PoolType Type of pool to allocate
1292 @param Size The amount of pool to allocate
1293 @param Buffer The address to return a pointer to the allocated
1296 @retval EFI_INVALID_PARAMETER PoolType not valid
1297 @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.
1298 @retval EFI_SUCCESS Pool successfully allocated.
1304 IN EFI_MEMORY_TYPE PoolType
,
1315 @param Buffer The allocated pool entry to free
1317 @retval EFI_INVALID_PARAMETER Buffer is not a valid value.
1318 @retval EFI_SUCCESS Pool successfully freed.
1331 Loads an EFI image into memory and returns a handle to the image.
1333 @param BootPolicy If TRUE, indicates that the request originates
1334 from the boot manager, and that the boot
1335 manager is attempting to load FilePath as a
1337 @param ParentImageHandle The caller's image handle.
1338 @param FilePath The specific file path from which the image is
1340 @param SourceBuffer If not NULL, a pointer to the memory location
1341 containing a copy of the image to be loaded.
1342 @param SourceSize The size in bytes of SourceBuffer.
1343 @param ImageHandle Pointer to the returned image handle that is
1344 created when the image is successfully loaded.
1346 @retval EFI_SUCCESS The image was loaded into memory.
1347 @retval EFI_NOT_FOUND The FilePath was not found.
1348 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1349 @retval EFI_UNSUPPORTED The image type is not supported, or the device
1350 path cannot be parsed to locate the proper
1351 protocol for loading the file.
1352 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient
1359 IN BOOLEAN BootPolicy
,
1360 IN EFI_HANDLE ParentImageHandle
,
1361 IN EFI_DEVICE_PATH_PROTOCOL
*FilePath
,
1362 IN VOID
*SourceBuffer OPTIONAL
,
1363 IN UINTN SourceSize
,
1364 OUT EFI_HANDLE
*ImageHandle
1373 @param ImageHandle Handle that identifies the image to be
1376 @retval EFI_SUCCESS The image has been unloaded.
1377 @retval EFI_UNSUPPORTED The image has been sarted, and does not support
1379 @retval EFI_INVALID_PARAMPETER ImageHandle is not a valid image handle.
1385 IN EFI_HANDLE ImageHandle
1392 Transfer control to a loaded image's entry point.
1394 @param ImageHandle Handle of image to be started.
1395 @param ExitDataSize Pointer of the size to ExitData
1396 @param ExitData Pointer to a pointer to a data buffer that
1397 includes a Null-terminated Unicode string,
1398 optionally followed by additional binary data.
1399 The string is a description that the caller may
1400 use to further indicate the reason for the
1403 @retval EFI_INVALID_PARAMETER Invalid parameter
1404 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
1405 @retval EFI_SUCCESS Successfully transfer control to the image's
1412 IN EFI_HANDLE ImageHandle
,
1413 OUT UINTN
*ExitDataSize
,
1414 OUT CHAR16
**ExitData OPTIONAL
1421 Terminates the currently loaded EFI image and returns control to boot services.
1423 @param ImageHandle Handle that identifies the image. This
1424 parameter is passed to the image on entry.
1425 @param Status The image's exit code.
1426 @param ExitDataSize The size, in bytes, of ExitData. Ignored if
1427 ExitStatus is EFI_SUCCESS.
1428 @param ExitData Pointer to a data buffer that includes a
1429 Null-terminated Unicode string, optionally
1430 followed by additional binary data. The string
1431 is a description that the caller may use to
1432 further indicate the reason for the image's
1435 @retval EFI_INVALID_PARAMETER Image handle is NULL or it is not current
1437 @retval EFI_SUCCESS Successfully terminates the currently loaded
1439 @retval EFI_ACCESS_DENIED Should never reach there.
1440 @retval EFI_OUT_OF_RESOURCES Could not allocate pool
1446 IN EFI_HANDLE ImageHandle
,
1447 IN EFI_STATUS Status
,
1448 IN UINTN ExitDataSize
,
1449 IN CHAR16
*ExitData OPTIONAL
1456 Creates a general-purpose event structure.
1458 @param Type The type of event to create and its mode and
1460 @param NotifyTpl The task priority level of event notifications
1461 @param NotifyFunction Pointer to the events notification function
1462 @param NotifyContext Pointer to the notification functions context;
1463 corresponds to parameter "Context" in the
1464 notification function
1465 @param Event Pointer to the newly created event if the call
1466 succeeds; undefined otherwise
1468 @retval EFI_SUCCESS The event structure was created
1469 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value
1470 @retval EFI_OUT_OF_RESOURCES The event could not be allocated
1477 IN EFI_TPL NotifyTpl
,
1478 IN EFI_EVENT_NOTIFY NotifyFunction
,
1479 IN VOID
*NotifyContext
,
1480 OUT EFI_EVENT
*Event
1487 Creates a general-purpose event structure
1489 @param Type The type of event to create and its mode and
1491 @param NotifyTpl The task priority level of event notifications
1492 @param NotifyFunction Pointer to the events notification function
1493 @param NotifyContext Pointer to the notification functions context;
1494 corresponds to parameter "Context" in the
1495 notification function
1496 @param EventGroup GUID for EventGroup if NULL act the same as
1498 @param Event Pointer to the newly created event if the call
1499 succeeds; undefined otherwise
1501 @retval EFI_SUCCESS The event structure was created
1502 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value
1503 @retval EFI_OUT_OF_RESOURCES The event could not be allocated
1510 IN EFI_TPL NotifyTpl
,
1511 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
1512 IN CONST VOID
*NotifyContext
, OPTIONAL
1513 IN CONST EFI_GUID
*EventGroup
, OPTIONAL
1514 OUT EFI_EVENT
*Event
1521 Sets the type of timer and the trigger time for a timer event.
1523 @param UserEvent The timer event that is to be signaled at the
1525 @param Type The type of time that is specified in
1527 @param TriggerTime The number of 100ns units until the timer
1530 @retval EFI_SUCCESS The event has been set to be signaled at the
1532 @retval EFI_INVALID_PARAMETER Event or Type is not valid
1539 IN EFI_TIMER_DELAY Type
,
1540 IN UINT64 TriggerTime
1547 Signals the event. Queues the event to be notified if needed
1549 @param UserEvent The event to signal
1551 @retval EFI_INVALID_PARAMETER Parameters are not valid.
1552 @retval EFI_SUCCESS The event was signaled.
1565 Stops execution until an event is signaled.
1567 @param NumberOfEvents The number of events in the UserEvents array
1568 @param UserEvents An array of EFI_EVENT
1569 @param UserIndex Pointer to the index of the event which
1570 satisfied the wait condition
1572 @retval EFI_SUCCESS The event indicated by Index was signaled.
1573 @retval EFI_INVALID_PARAMETER The event indicated by Index has a notification
1574 function or Event was not a valid type
1575 @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION
1581 IN UINTN NumberOfEvents
,
1582 IN EFI_EVENT
*UserEvents
,
1583 OUT UINTN
*UserIndex
1590 Closes an event and frees the event structure.
1592 @param UserEvent Event to close
1594 @retval EFI_INVALID_PARAMETER Parameters are not valid.
1595 @retval EFI_SUCCESS The event has been closed
1608 Check the status of an event.
1610 @param UserEvent The event to check
1612 @retval EFI_SUCCESS The event is in the signaled state
1613 @retval EFI_NOT_READY The event is not in the signaled state
1614 @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL
1626 Adds reserved memory, system memory, or memory-mapped I/O resources to the
1627 global coherency domain of the processor.
1629 @param GcdMemoryType Memory type of the memory space.
1630 @param BaseAddress Base address of the memory space.
1631 @param Length Length of the memory space.
1632 @param Capabilities alterable attributes of the memory space.
1634 @retval EFI_SUCCESS Merged this memory space into GCD map.
1638 CoreAddMemorySpace (
1639 IN EFI_GCD_MEMORY_TYPE GcdMemoryType
,
1640 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
1642 IN UINT64 Capabilities
1648 Allocates nonexistent memory, reserved memory, system memory, or memorymapped
1649 I/O resources from the global coherency domain of the processor.
1651 @param GcdAllocateType The type of allocate operation
1652 @param GcdMemoryType The desired memory type
1653 @param Alignment Align with 2^Alignment
1654 @param Length Length to allocate
1655 @param BaseAddress Base address to allocate
1656 @param ImageHandle The image handle consume the allocated space.
1657 @param DeviceHandle The device handle consume the allocated space.
1659 @retval EFI_INVALID_PARAMETER Invalid parameter.
1660 @retval EFI_NOT_FOUND No descriptor contains the desired space.
1661 @retval EFI_SUCCESS Memory space successfully allocated.
1665 CoreAllocateMemorySpace (
1666 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType
,
1667 IN EFI_GCD_MEMORY_TYPE GcdMemoryType
,
1670 IN OUT EFI_PHYSICAL_ADDRESS
*BaseAddress
,
1671 IN EFI_HANDLE ImageHandle
,
1672 IN EFI_HANDLE DeviceHandle OPTIONAL
1678 Frees nonexistent memory, reserved memory, system memory, or memory-mapped
1679 I/O resources from the global coherency domain of the processor.
1681 @param BaseAddress Base address of the memory space.
1682 @param Length Length of the memory space.
1684 @retval EFI_SUCCESS Space successfully freed.
1688 CoreFreeMemorySpace (
1689 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
1696 Removes reserved memory, system memory, or memory-mapped I/O resources from
1697 the global coherency domain of the processor.
1699 @param BaseAddress Base address of the memory space.
1700 @param Length Length of the memory space.
1702 @retval EFI_SUCCESS Successfully remove a segment of memory space.
1706 CoreRemoveMemorySpace (
1707 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
1714 Retrieves the descriptor for a memory region containing a specified address.
1716 @param BaseAddress Specified start address
1717 @param Descriptor Specified length
1719 @retval EFI_INVALID_PARAMETER Invalid parameter
1720 @retval EFI_SUCCESS Successfully get memory space descriptor.
1724 CoreGetMemorySpaceDescriptor (
1725 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
1726 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR
*Descriptor
1732 Modifies the attributes for a memory region in the global coherency domain of the
1735 @param BaseAddress Specified start address
1736 @param Length Specified length
1737 @param Attributes Specified attributes
1739 @retval EFI_SUCCESS Successfully set attribute of a segment of
1744 CoreSetMemorySpaceAttributes (
1745 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
1747 IN UINT64 Attributes
1753 Returns a map of the memory resources in the global coherency domain of the
1756 @param NumberOfDescriptors Number of descriptors.
1757 @param MemorySpaceMap Descriptor array
1759 @retval EFI_INVALID_PARAMETER Invalid parameter
1760 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
1761 @retval EFI_SUCCESS Successfully get memory space map.
1765 CoreGetMemorySpaceMap (
1766 OUT UINTN
*NumberOfDescriptors
,
1767 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR
**MemorySpaceMap
1773 Adds reserved I/O or I/O resources to the global coherency domain of the processor.
1775 @param GcdIoType IO type of the segment.
1776 @param BaseAddress Base address of the segment.
1777 @param Length Length of the segment.
1779 @retval EFI_SUCCESS Merged this segment into GCD map.
1780 @retval EFI_INVALID_PARAMETER Parameter not valid
1785 IN EFI_GCD_IO_TYPE GcdIoType
,
1786 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
1793 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
1794 domain of the processor.
1796 @param GcdAllocateType The type of allocate operation
1797 @param GcdIoType The desired IO type
1798 @param Alignment Align with 2^Alignment
1799 @param Length Length to allocate
1800 @param BaseAddress Base address to allocate
1801 @param ImageHandle The image handle consume the allocated space.
1802 @param DeviceHandle The device handle consume the allocated space.
1804 @retval EFI_INVALID_PARAMETER Invalid parameter.
1805 @retval EFI_NOT_FOUND No descriptor contains the desired space.
1806 @retval EFI_SUCCESS IO space successfully allocated.
1810 CoreAllocateIoSpace (
1811 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType
,
1812 IN EFI_GCD_IO_TYPE GcdIoType
,
1815 IN OUT EFI_PHYSICAL_ADDRESS
*BaseAddress
,
1816 IN EFI_HANDLE ImageHandle
,
1817 IN EFI_HANDLE DeviceHandle OPTIONAL
1823 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
1824 domain of the processor.
1826 @param BaseAddress Base address of the segment.
1827 @param Length Length of the segment.
1829 @retval EFI_SUCCESS Space successfully freed.
1834 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
1841 Removes reserved I/O or I/O resources from the global coherency domain of the
1844 @param BaseAddress Base address of the segment.
1845 @param Length Length of the segment.
1847 @retval EFI_SUCCESS Successfully removed a segment of IO space.
1852 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
1859 Retrieves the descriptor for an I/O region containing a specified address.
1861 @param BaseAddress Specified start address
1862 @param Descriptor Specified length
1864 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
1865 @retval EFI_SUCCESS Successfully get the IO space descriptor.
1869 CoreGetIoSpaceDescriptor (
1870 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
1871 OUT EFI_GCD_IO_SPACE_DESCRIPTOR
*Descriptor
1877 Returns a map of the I/O resources in the global coherency domain of the processor.
1879 @param NumberOfDescriptors Number of descriptors.
1880 @param IoSpaceMap Descriptor array
1882 @retval EFI_INVALID_PARAMETER Invalid parameter
1883 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
1884 @retval EFI_SUCCESS Successfully get IO space map.
1889 OUT UINTN
*NumberOfDescriptors
,
1890 OUT EFI_GCD_IO_SPACE_DESCRIPTOR
**IoSpaceMap
1896 This is the main Dispatcher for DXE and it exits when there are no more
1897 drivers to run. Drain the mScheduledQueue and load and start a PE
1898 image for each driver. Search the mDiscoveredList to see if any driver can
1899 be placed on the mScheduledQueue. If no drivers are placed on the
1900 mScheduledQueue exit the function. On exit it is assumed the Bds()
1901 will be called, and when the Bds() exits the Dispatcher will be called
1906 @retval EFI_ALREADY_STARTED The DXE Dispatcher is already running
1907 @retval EFI_NOT_FOUND No DXE Drivers were dispatched
1908 @retval EFI_SUCCESS One or more DXE Drivers were dispatched
1920 Check every driver and locate a matching one. If the driver is found, the Unrequested
1921 state flag is cleared.
1923 @param FirmwareVolumeHandle The handle of the Firmware Volume that contains
1924 the firmware file specified by DriverName.
1925 @param DriverName The Driver name to put in the Dependent state.
1927 @retval EFI_SUCCESS The DriverName was found and it's SOR bit was
1929 @retval EFI_NOT_FOUND The DriverName does not exist or it's SOR bit
1937 IN EFI_HANDLE FirmwareVolumeHandle
,
1938 IN EFI_GUID
*DriverName
1944 Convert a driver from the Untrused back to the Scheduled state
1946 @param FirmwareVolumeHandle The handle of the Firmware Volume that contains
1947 the firmware file specified by DriverName.
1948 @param DriverName The Driver name to put in the Scheduled state
1950 @retval EFI_SUCCESS The file was found in the untrusted state, and
1951 it was promoted to the trusted state.
1952 @retval EFI_NOT_FOUND The file was not found in the untrusted state.
1959 IN EFI_HANDLE FirmwareVolumeHandle
,
1960 IN EFI_GUID
*DriverName
1966 Helper function called as part of the code needed
1967 to allocate the proper sized buffer for various
1970 @param Status Current status
1971 @param Buffer Current allocated buffer, or NULL
1972 @param BufferSize Current buffer size needed
1974 @retval TRUE if the buffer was reallocated and the caller
1975 should try the API again.
1976 @retval FALSE buffer could not be allocated and the caller
1977 should not try the API again.
1982 IN OUT EFI_STATUS
*Status
,
1983 IN OUT VOID
**Buffer
,
1990 This routine is the driver initialization entry point. It initializes the
1991 libraries, and registers two notification functions. These notification
1992 functions are responsible for building the FV stack dynamically.
1994 @param ImageHandle The image handle.
1995 @param SystemTable The system table.
1997 @retval EFI_SUCCESS Function successfully returned.
2003 IN EFI_HANDLE ImageHandle
,
2004 IN EFI_SYSTEM_TABLE
*SystemTable
2010 Entry point of the section extraction code. Initializes an instance of the
2011 section extraction interface and installs it on a new handle.
2013 @param ImageHandle A handle for the image that is initializing this driver
2014 @param SystemTable A pointer to the EFI system table
2016 @retval EFI_SUCCESS Driver initialized successfully
2017 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources
2022 InitializeSectionExtraction (
2023 IN EFI_HANDLE ImageHandle
,
2024 IN EFI_SYSTEM_TABLE
*SystemTable
2030 This DXE service routine is used to process a firmware volume. In
2031 particular, it can be called by BDS to process a single firmware
2032 volume found in a capsule.
2034 @param FvHeader pointer to a firmware volume header
2035 @param Size the size of the buffer pointed to by FvHeader
2036 @param FVProtocolHandle the handle on which a firmware volume protocol
2037 was produced for the firmware volume passed in.
2039 @retval EFI_OUT_OF_RESOURCES if an FVB could not be produced due to lack of
2041 @retval EFI_VOLUME_CORRUPTED if the volume was corrupted
2042 @retval EFI_SUCCESS a firmware volume protocol was produced for the
2047 CoreProcessFirmwareVolume (
2050 OUT EFI_HANDLE
*FVProtocolHandle
2055 //Functions used during debug buils
2059 Displays Architectural protocols that were not loaded and are required for DXE
2060 core to function Only used in Debug Builds.
2064 CoreDisplayMissingArchProtocols (
2071 Traverse the discovered list for any drivers that were discovered but not loaded
2072 because the dependency experessions evaluated to false.
2076 CoreDisplayDiscoveredNotDispatched (
2083 Place holder function until all the Boot Services and Runtime Services are available.
2086 @return EFI_NOT_AVAILABLE_YET
2091 CoreEfiNotAvailableYetArg0 (
2098 Place holder function until all the Boot Services and Runtime Services are available.
2100 @param Arg1 Undefined
2102 @return EFI_NOT_AVAILABLE_YET
2107 CoreEfiNotAvailableYetArg1 (
2114 Place holder function until all the Boot Services and Runtime Services are available.
2116 @param Arg1 Undefined
2117 @param Arg2 Undefined
2119 @return EFI_NOT_AVAILABLE_YET
2124 CoreEfiNotAvailableYetArg2 (
2132 Place holder function until all the Boot Services and Runtime Services are available.
2134 @param Arg1 Undefined
2135 @param Arg2 Undefined
2136 @param Arg3 Undefined
2138 @return EFI_NOT_AVAILABLE_YET
2143 CoreEfiNotAvailableYetArg3 (
2152 Place holder function until all the Boot Services and Runtime Services are available.
2154 @param Arg1 Undefined
2155 @param Arg2 Undefined
2156 @param Arg3 Undefined
2157 @param Arg4 Undefined
2159 @return EFI_NOT_AVAILABLE_YET
2164 CoreEfiNotAvailableYetArg4 (
2174 Place holder function until all the Boot Services and Runtime Services are available.
2176 @param Arg1 Undefined
2177 @param Arg2 Undefined
2178 @param Arg3 Undefined
2179 @param Arg4 Undefined
2180 @param Arg5 Undefined
2182 @return EFI_NOT_AVAILABLE_YET
2187 CoreEfiNotAvailableYetArg5 (
2198 Searches for a Protocol Interface passed from PEI through a HOB.
2200 @param ProtocolGuid The Protocol GUID to search for in the HOB List
2201 @param Interface A pointer to the interface for the Protocol GUID
2203 @retval EFI_SUCCESS The Protocol GUID was found and its interface is
2204 returned in Interface
2205 @retval EFI_NOT_FOUND The Protocol GUID was not found in the HOB List
2209 CoreGetPeiProtocol (
2210 IN EFI_GUID
*ProtocolGuid
,
2217 Given a compressed source buffer, this function retrieves the size of the
2218 uncompressed buffer and the size of the scratch buffer required to decompress
2219 the compressed source buffer.
2221 The GetInfo() function retrieves the size of the uncompressed buffer and the
2222 temporary scratch buffer required to decompress the buffer specified by Source
2223 and SourceSize. If the size of the uncompressed buffer or the size of the
2224 scratch buffer cannot be determined from the compressed data specified by
2225 Source and SourceData, then EFI_INVALID_PARAMETER is returned. Otherwise, the
2226 size of the uncompressed buffer is returned in DestinationSize, the size of
2227 the scratch buffer is returned in ScratchSize, and EFI_SUCCESS is returned.
2228 The GetInfo() function does not have scratch buffer available to perform a
2229 thorough checking of the validity of the source data. It just retrieves the
2230 "Original Size" field from the beginning bytes of the source data and output
2231 it as DestinationSize. And ScratchSize is specific to the decompression
2234 @param This A pointer to the EFI_DECOMPRESS_PROTOCOL instance.
2235 @param Source The source buffer containing the compressed data.
2236 @param SourceSize The size, in bytes, of the source buffer.
2237 @param DestinationSize A pointer to the size, in bytes, of the
2238 uncompressed buffer that will be generated when the
2239 compressed buffer specified by Source and
2240 SourceSize is decompressed.
2241 @param ScratchSize A pointer to the size, in bytes, of the scratch
2242 buffer that is required to decompress the
2243 compressed buffer specified by Source and
2246 @retval EFI_SUCCESS The size of the uncompressed data was returned in
2247 DestinationSize and the size of the scratch buffer
2248 was returned in ScratchSize.
2249 @retval EFI_INVALID_PARAMETER The size of the uncompressed data or the size of
2250 the scratch buffer cannot be determined from the
2251 compressed data specified by Source and
2256 DxeMainUefiDecompressGetInfo (
2257 IN EFI_DECOMPRESS_PROTOCOL
*This
,
2259 IN UINT32 SourceSize
,
2260 OUT UINT32
*DestinationSize
,
2261 OUT UINT32
*ScratchSize
2266 Decompresses a compressed source buffer.
2268 The Decompress() function extracts decompressed data to its original form.
2269 This protocol is designed so that the decompression algorithm can be
2270 implemented without using any memory services. As a result, the Decompress()
2271 Function is not allowed to call AllocatePool() or AllocatePages() in its
2272 implementation. It is the caller's responsibility to allocate and free the
2273 Destination and Scratch buffers.
2274 If the compressed source data specified by Source and SourceSize is
2275 sucessfully decompressed into Destination, then EFI_SUCCESS is returned. If
2276 the compressed source data specified by Source and SourceSize is not in a
2277 valid compressed data format, then EFI_INVALID_PARAMETER is returned.
2279 @param This A pointer to the EFI_DECOMPRESS_PROTOCOL instance.
2280 @param Source The source buffer containing the compressed data.
2281 @param SourceSize SourceSizeThe size of source data.
2282 @param Destination On output, the destination buffer that contains
2283 the uncompressed data.
2284 @param DestinationSize The size of the destination buffer. The size of
2285 the destination buffer needed is obtained from
2286 EFI_DECOMPRESS_PROTOCOL.GetInfo().
2287 @param Scratch A temporary scratch buffer that is used to perform
2289 @param ScratchSize The size of scratch buffer. The size of the
2290 scratch buffer needed is obtained from GetInfo().
2292 @retval EFI_SUCCESS Decompression completed successfully, and the
2293 uncompressed buffer is returned in Destination.
2294 @retval EFI_INVALID_PARAMETER The source buffer specified by Source and
2295 SourceSize is corrupted (not in a valid
2301 DxeMainUefiDecompress (
2302 IN EFI_DECOMPRESS_PROTOCOL
*This
,
2304 IN UINT32 SourceSize
,
2305 IN OUT VOID
*Destination
,
2306 IN UINT32 DestinationSize
,
2307 IN OUT VOID
*Scratch
,
2308 IN UINT32 ScratchSize
2312 SEP member function. This function creates and returns a new section stream
2313 handle to represent the new section stream.
2315 @param SectionStreamLength Size in bytes of the section stream.
2316 @param SectionStream Buffer containing the new section stream.
2317 @param SectionStreamHandle A pointer to a caller allocated UINTN that on
2318 output contains the new section stream handle.
2320 @retval EFI_SUCCESS The section stream is created successfully.
2321 @retval EFI_OUT_OF_RESOURCES memory allocation failed.
2322 @retval EFI_INVALID_PARAMETER Section stream does not end concident with end
2329 IN UINTN SectionStreamLength
,
2330 IN VOID
*SectionStream
,
2331 OUT UINTN
*SectionStreamHandle
2337 SEP member function. Retrieves requested section from section stream.
2339 @param SectionStreamHandle The section stream from which to extract the
2341 @param SectionType A pointer to the type of section to search for.
2342 @param SectionDefinitionGuid If the section type is EFI_SECTION_GUID_DEFINED,
2343 then SectionDefinitionGuid indicates which of
2344 these types of sections to search for.
2345 @param SectionInstance Indicates which instance of the requested
2347 @param Buffer Double indirection to buffer. If *Buffer is
2348 non-null on input, then the buffer is caller
2349 allocated. If Buffer is NULL, then the buffer
2350 is callee allocated. In either case, the
2351 requried buffer size is returned in *BufferSize.
2352 @param BufferSize On input, indicates the size of *Buffer if
2353 *Buffer is non-null on input. On output,
2354 indicates the required size (allocated size if
2355 callee allocated) of *Buffer.
2356 @param AuthenticationStatus A pointer to a caller-allocated UINT32 that
2357 indicates the authentication status of the
2358 output buffer. If the input section's
2359 GuidedSectionHeader.Attributes field
2360 has the EFI_GUIDED_SECTION_AUTH_STATUS_VALID
2361 bit as clear, AuthenticationStatus must return
2362 zero. Both local bits (19:16) and aggregate
2363 bits (3:0) in AuthenticationStatus are returned
2364 by ExtractSection(). These bits reflect the
2365 status of the extraction operation. The bit
2366 pattern in both regions must be the same, as
2367 the local and aggregate authentication statuses
2368 have equivalent meaning at this level. If the
2369 function returns anything other than
2370 EFI_SUCCESS, the value of *AuthenticationStatus
2373 @retval EFI_SUCCESS Section was retrieved successfully
2374 @retval EFI_PROTOCOL_ERROR A GUID defined section was encountered in the
2375 section stream with its
2376 EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set,
2377 but there was no corresponding GUIDed Section
2378 Extraction Protocol in the handle database.
2379 *Buffer is unmodified.
2380 @retval EFI_NOT_FOUND An error was encountered when parsing the
2381 SectionStream. This indicates the SectionStream
2382 is not correctly formatted.
2383 @retval EFI_NOT_FOUND The requested section does not exist.
2384 @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process
2386 @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.
2387 @retval EFI_WARN_TOO_SMALL The size of the caller allocated input buffer is
2388 insufficient to contain the requested section.
2389 The input buffer is filled and section contents
2396 IN UINTN SectionStreamHandle
,
2397 IN EFI_SECTION_TYPE
*SectionType
,
2398 IN EFI_GUID
*SectionDefinitionGuid
,
2399 IN UINTN SectionInstance
,
2401 IN OUT UINTN
*BufferSize
,
2402 OUT UINT32
*AuthenticationStatus
2407 SEP member function. Deletes an existing section stream
2409 @param StreamHandleToClose Indicates the stream to close
2411 @retval EFI_SUCCESS The section stream is closed sucessfully.
2412 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
2413 @retval EFI_INVALID_PARAMETER Section stream does not end concident with end
2419 CloseSectionStream (
2420 IN UINTN StreamHandleToClose