3 Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Light weight lib to support EFI drivers.
22 #ifndef _EFI_DRIVER_LIB_H_
23 #define _EFI_DRIVER_LIB_H_
25 #include "EfiStatusCode.h"
26 #include "EfiCommonLib.h"
28 #include "LinkedList.h"
30 #include "EfiImageFormat.h"
31 #include "EfiCompNameSupport.h"
33 #include EFI_GUID_DEFINITION (DxeServices)
34 #include EFI_GUID_DEFINITION (EventGroup)
35 #include EFI_GUID_DEFINITION (EventLegacyBios)
36 #include EFI_GUID_DEFINITION (FrameworkDevicePath)
37 #include EFI_PROTOCOL_DEFINITION (FirmwareVolume)
38 #include EFI_PROTOCOL_DEFINITION (FirmwareVolume2)
39 #include EFI_PROTOCOL_DEFINITION (DataHub)
40 #include EFI_PROTOCOL_DEFINITION (DriverBinding)
41 #include EFI_PROTOCOL_DEFINITION (ComponentName)
42 #include EFI_PROTOCOL_DEFINITION (ComponentName2)
43 #include EFI_PROTOCOL_DEFINITION (DriverConfiguration)
44 #include EFI_PROTOCOL_DEFINITION (DriverConfiguration2)
45 #include EFI_PROTOCOL_DEFINITION (DriverDiagnostics)
46 #include EFI_PROTOCOL_DEFINITION (DriverDiagnostics2)
48 #include EFI_PROTOCOL_DEFINITION (DebugMask)
50 #if defined(__GNUC__) && defined(ECP_CPU_IPF)
61 Generates a breakpoint on the CPU.
63 Generates a breakpoint on the CPU. The breakpoint must be implemented such
64 that code can resume normal execution after the breakpoint.
86 Used to serialize load and store operations.
88 All loads and stores that proceed calls to this function are guaranteed to be
89 globally visible when this function returns.
106 CHAR16
*UnicodeString
;
107 } EFI_UNICODE_STRING_TABLE
;
108 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
109 #define LANGUAGE_RFC_3066
110 #define LANGUAGE_CODE_ENGLISH "en-US"
112 #define LANGUAGE_ISO_639_2
113 #define LANGUAGE_CODE_ENGLISH "eng"
117 // Macros for EFI Driver Library Functions that are really EFI Boot Services
119 #define EfiCopyMem(_Destination, _Source, _Length) gBS->CopyMem ((_Destination), (_Source), (_Length))
120 #define EfiSetMem(_Destination, _Length, _Value) gBS->SetMem ((_Destination), (_Length), (_Value))
121 #define EfiZeroMem(_Destination, _Length) gBS->SetMem ((_Destination), (_Length), 0)
124 // Driver Lib Globals.
126 extern EFI_BOOT_SERVICES
*gBS
;
127 extern EFI_DXE_SERVICES
*gDS
;
128 extern EFI_RUNTIME_SERVICES
*gRT
;
129 extern EFI_SYSTEM_TABLE
*gST
;
130 extern UINTN gErrorLevel
;
131 extern EFI_GUID gEfiCallerIdGuid
;
132 extern EFI_DEBUG_MASK_PROTOCOL
*gDebugMaskInterface
;
135 EfiInitializeDriverLib (
136 IN EFI_HANDLE ImageHandle
,
137 IN EFI_SYSTEM_TABLE
*SystemTable
143 Intialize Driver Lib if it has not yet been initialized.
147 ImageHandle - The firmware allocated handle for the EFI image.
149 SystemTable - A pointer to the EFI System Table.
154 EFI_STATUS always returns EFI_SUCCESS
160 DxeInitializeDriverLib (
161 IN EFI_HANDLE ImageHandle
,
162 IN EFI_SYSTEM_TABLE
*SystemTable
168 Intialize Driver Lib if it has not yet been initialized.
172 ImageHandle - The firmware allocated handle for the EFI image.
174 SystemTable - A pointer to the EFI System Table.
178 EFI_STATUS always returns EFI_SUCCESS
184 EfiLibInstallDriverBinding (
185 IN EFI_HANDLE ImageHandle
,
186 IN EFI_SYSTEM_TABLE
*SystemTable
,
187 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
188 IN EFI_HANDLE DriverBindingHandle
194 Intialize a driver by installing the Driver Binding Protocol onto the
195 driver's DriverBindingHandle. This is typically the same as the driver's
196 ImageHandle, but it can be different if the driver produces multiple
197 DriverBinding Protocols. This function also initializes the EFI Driver
198 Library that initializes the global variables gST, gBS, gRT.
202 ImageHandle - The image handle of the driver
204 SystemTable - The EFI System Table that was passed to the driver's entry point
206 DriverBinding - A Driver Binding Protocol instance that this driver is producing
208 DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
209 parameter is NULL, then a new handle is created.
213 EFI_SUCCESS is DriverBinding is installed onto DriverBindingHandle
215 Otherwise, then return status from gBS->InstallProtocolInterface()
221 EfiLibInstallAllDriverProtocols (
222 IN EFI_HANDLE ImageHandle
,
223 IN EFI_SYSTEM_TABLE
*SystemTable
,
224 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
225 IN EFI_HANDLE DriverBindingHandle
,
226 IN EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
227 IN EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
228 IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics OPTIONAL
234 Intialize a driver by installing the Driver Binding Protocol onto the
235 driver's DriverBindingHandle. This is typically the same as the driver's
236 ImageHandle, but it can be different if the driver produces multiple
237 DriverBinding Protocols. This function also initializes the EFI Driver
238 Library that initializes the global variables gST, gBS, gRT.
242 ImageHandle - The image handle of the driver
244 SystemTable - The EFI System Table that was passed to the driver's entry point
246 DriverBinding - A Driver Binding Protocol instance that this driver is producing
248 DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
249 parameter is NULL, then a new handle is created.
251 ComponentName - A Component Name Protocol instance that this driver is producing
253 DriverConfiguration - A Driver Configuration Protocol instance that this driver is producing
255 DriverDiagnostics - A Driver Diagnostics Protocol instance that this driver is producing
259 EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle
261 Otherwise, then return status from gBS->InstallProtocolInterface()
267 EfiLibInstallAllDriverProtocols2 (
268 IN EFI_HANDLE ImageHandle
,
269 IN EFI_SYSTEM_TABLE
*SystemTable
,
270 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
271 IN EFI_HANDLE DriverBindingHandle
,
272 IN EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2
, OPTIONAL
273 IN EFI_DRIVER_CONFIGURATION2_PROTOCOL
*DriverConfiguration2
, OPTIONAL
274 IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL
*DriverDiagnostics2 OPTIONAL
280 Intialize a driver by installing the Driver Binding Protocol onto the
281 driver's DriverBindingHandle. This is typically the same as the driver's
282 ImageHandle, but it can be different if the driver produces multiple
283 DriverBinding Protocols. This function also initializes the EFI Driver
284 Library that initializes the global variables gST, gBS, gRT.
288 ImageHandle - The image handle of the driver
290 SystemTable - The EFI System Table that was passed to the driver's entry point
292 DriverBinding - A Driver Binding Protocol instance that this driver is producing
294 DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
295 parameter is NULL, then a new handle is created.
297 ComponentName2 - A Component Name2 Protocol instance that this driver is producing
299 DriverConfiguration2- A Driver Configuration2 Protocol instance that this driver is producing
301 DriverDiagnostics2 - A Driver Diagnostics2 Protocol instance that this driver is producing
305 EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle
307 Otherwise, then return status from gBS->InstallProtocolInterface()
313 EfiLibGetSystemConfigurationTable (
314 IN EFI_GUID
*TableGuid
,
321 Return the EFI 1.0 System Tabl entry with TableGuid
325 TableGuid - Name of entry to return in the system table
326 Table - Pointer in EFI system table associated with TableGuid
330 EFI_SUCCESS - Table returned;
331 EFI_NOT_FOUND - TableGuid not in EFI system table
337 EfiLibCompareLanguage (
345 Compare two languages to say whether they are identical.
349 Language1 - first language
350 Language2 - second language
355 FALSE - not identical
364 EfiIsDevicePathMultiInstance (
365 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
370 Return TRUE is this is a multi instance device path.
373 DevicePath - A pointer to a device path data structure.
377 TRUE - If DevicePath is multi instance.
378 FALSE - If DevicePath is not multi instance.
383 EFI_DEVICE_PATH_PROTOCOL
*
384 EfiDevicePathInstance (
385 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
,
391 Function retrieves the next device path instance from a device path data structure.
394 DevicePath - A pointer to a device path data structure.
396 Size - A pointer to the size of a device path instance in bytes.
400 This function returns a pointer to the current device path instance.
401 In addition, it returns the size in bytes of the current device path instance in Size,
402 and a pointer to the next device path instance in DevicePath.
403 If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.
410 IN EFI_DEVICE_PATH_PROTOCOL
*DevPath
416 Calculate the size of a whole device path.
420 DevPath - The pointer to the device path data.
424 Size of device path data structure..
429 EFI_DEVICE_PATH_PROTOCOL
*
430 EfiAppendDevicePath (
431 IN EFI_DEVICE_PATH_PROTOCOL
*Src1
,
432 IN EFI_DEVICE_PATH_PROTOCOL
*Src2
437 Function is used to append a Src1 and Src2 together.
440 Src1 - A pointer to a device path data structure.
442 Src2 - A pointer to a device path data structure.
446 A pointer to the new device path is returned.
447 NULL is returned if space for the new device path could not be allocated from pool.
448 It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.
453 EFI_DEVICE_PATH_PROTOCOL
*
454 EfiDevicePathFromHandle (
461 Locate device path protocol interface on a device handle.
465 Handle - The device handle
469 Device path protocol interface located.
474 EFI_DEVICE_PATH_PROTOCOL
*
475 EfiDuplicateDevicePath (
476 IN EFI_DEVICE_PATH_PROTOCOL
*DevPath
481 Duplicate a new device path data structure from the old one.
484 DevPath - A pointer to a device path data structure.
487 A pointer to the new allocated device path data.
488 Caller must free the memory used by DevicePath if it is no longer needed.
493 EFI_DEVICE_PATH_PROTOCOL
*
494 EfiAppendDevicePathNode (
495 IN EFI_DEVICE_PATH_PROTOCOL
*Src1
,
496 IN EFI_DEVICE_PATH_PROTOCOL
*Src2
501 Function is used to append a device path node to the end of another device path.
504 Src1 - A pointer to a device path data structure.
506 Src2 - A pointer to a device path data structure.
509 This function returns a pointer to the new device path.
510 If there is not enough temporary pool memory available to complete this function,
511 then NULL is returned.
517 EFI_DEVICE_PATH_PROTOCOL
*
519 IN EFI_HANDLE Device OPTIONAL
,
525 Create a device path that appends a MEDIA_DEVICE_PATH with
526 FileNameGuid to the device path of DeviceHandle.
529 Device - Optional Device Handle to use as Root of the Device Path
534 EFI_DEVICE_PATH_PROTOCOL that was allocated from dynamic memory
540 EFI_DEVICE_PATH_PROTOCOL
*
541 EfiAppendDevicePathInstance (
542 IN EFI_DEVICE_PATH_PROTOCOL
*Src
,
543 IN EFI_DEVICE_PATH_PROTOCOL
*Instance
549 Append a device path instance to another.
553 Src - The device path instance to be appended with.
554 Instance - The device path instance appending the other.
558 The contaction of these two.
574 IN OUT EFI_LOCK
*Lock
,
581 Initialize a basic mutual exclusion lock. Each lock
582 provides mutual exclusion access at it's task priority
583 level. Since there is no-premption (at any TPL) or
584 multiprocessor support, acquiring the lock only consists
585 of raising to the locks TPL.
587 Note on a check build ASSERT()s are used to ensure proper
592 Lock - The EFI_LOCK structure to initialize
594 Priority - The task priority level of the lock
599 An initialized Efi Lock structure.
605 // Macro to initialize the state of a lock when a lock variable is declared
607 #define EFI_INITIALIZE_LOCK_VARIABLE(Tpl) {Tpl,0,0}
617 Raising to the task priority level of the mutual exclusion
618 lock, and then acquires ownership of the lock.
622 Lock - The lock to acquire
632 EfiAcquireLockOrFail (
639 Initialize a basic mutual exclusion lock. Each lock
640 provides mutual exclusion access at it's task priority
641 level. Since there is no-premption (at any TPL) or
642 multiprocessor support, acquiring the lock only consists
643 of raising to the locks TPL.
647 Lock - The EFI_LOCK structure to initialize
651 EFI_SUCCESS - Lock Owned.
652 EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.
665 Releases ownership of the mutual exclusion lock, and
666 restores the previous task priority level.
670 Lock - The lock to release
681 IN UINTN AllocationSize
687 Allocate EfiBootServicesData pool of size AllocationSize
691 AllocationSize - Pool size
695 Pointer to the pool allocated
701 EfiLibAllocateRuntimePool (
702 IN UINTN AllocationSize
708 Allocate EfiRuntimeServicesData pool of size AllocationSize
712 AllocationSize - Pool size
716 Pointer to the pool allocated
722 EfiLibAllocateZeroPool (
723 IN UINTN AllocationSize
729 Allocate EfiBootServicesData pool of size AllocationSize and set memory to zero.
733 AllocationSize - Pool size
737 Pointer to the pool allocated
743 EfiLibAllocateRuntimeZeroPool (
744 IN UINTN AllocationSize
750 Allocate EfiRuntimeServicesData pool of size AllocationSize and set memory to zero.
754 AllocationSize - Pool size
758 Pointer to the pool allocated
764 EfiLibAllocateCopyPool (
765 IN UINTN AllocationSize
,
772 Allocate BootServicesData pool and use a buffer provided by
777 AllocationSize - The size to allocate
779 Buffer - Buffer that will be filled into the buffer allocated
783 Pointer of the buffer allocated.
789 EfiLibAllocateRuntimeCopyPool (
790 IN UINTN AllocationSize
,
797 Allocate RuntimeServicesData pool and use a buffer provided by
802 AllocationSize - The size to allocate
804 Buffer - Buffer that will be filled into the buffer allocated
808 Pointer of the buffer allocated.
817 EfiLibCreateProtocolNotifyEvent (
818 IN EFI_GUID
*ProtocolGuid
,
819 IN EFI_TPL NotifyTpl
,
820 IN EFI_EVENT_NOTIFY NotifyFunction
,
821 IN VOID
*NotifyContext
,
822 OUT VOID
**Registration
828 Create a protocol notification event and return it.
832 ProtocolGuid - Protocol to register notification event on.
834 NotifyTpl - Maximum TPL to single the NotifyFunction.
836 NotifyFunction - EFI notification routine.
838 NotifyContext - Context passed into Event when it is created.
840 Registration - Registration key returned from RegisterProtocolNotify().
844 The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
845 is added to the system.
851 EfiLibNamedEventSignal (
857 Signals a named event. All registered listeners will run.
858 The listeners should register using EfiLibNamedEventListen() function.
860 NOTE: For now, the named listening/signalling is implemented
861 on a protocol interface being installed and uninstalled.
862 In the future, this maybe implemented based on a dedicated mechanism.
865 Name - Name to perform the signaling on. The name is a GUID.
868 EFI_SUCCESS if successfull.
874 EfiLibNamedEventListen (
876 IN EFI_TPL NotifyTpl
,
877 IN EFI_EVENT_NOTIFY NotifyFunction
,
878 IN VOID
*NotifyContext
883 Listenes to signals on the name.
884 EfiLibNamedEventSignal() signals the event.
886 NOTE: For now, the named listening/signalling is implemented
887 on a protocol interface being installed and uninstalled.
888 In the future, this maybe implemented based on a dedicated mechanism.
891 Name - Name to register the listener on.
892 NotifyTpl - Maximum TPL to singnal the NotifyFunction.
893 NotifyFunction - The listener routine.
894 NotifyContext - Context passed into the listener routine.
897 EFI_SUCCESS if successful.
906 EfiLibLocateHandleProtocolByProtocols (
907 IN OUT EFI_HANDLE
* Handle
, OPTIONAL
908 OUT VOID
**Interface
, OPTIONAL
914 Function locates Protocol and/or Handle on which all Protocols specified
915 as a variable list are installed.
916 It supports continued search. The caller must assure that no handles are added
917 or removed while performing continued search, by e.g., rising the TPL and not
918 calling any handle routines. Otherwise the behavior is undefined.
922 Handle - The address of handle to receive the handle on which protocols
923 indicated by the variable list are installed.
924 If points to NULL, all handles are searched. If pointing to a
925 handle returned from previous call, searches starting from next handle.
926 If NULL, the parameter is ignored.
928 Interface - The address of a pointer to a protocol interface that will receive
929 the interface indicated by first variable argument.
930 If NULL, the parameter is ignored.
932 ... - A variable argument list containing protocol GUIDs. Must end with NULL.
936 EFI_SUCCESS - All the protocols where found on same handle.
937 EFI_NOT_FOUND - A Handle with all the protocols installed was not found.
938 Other values as may be returned from LocateHandleBuffer() or HandleProtocol().
954 Locate Debug Assert Protocol and set as mDebugAssert
968 // Unicode String Support
971 EfiLibLookupUnicodeString (
973 CHAR8
*SupportedLanguages
,
974 EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
975 CHAR16
**UnicodeString
981 Translate a unicode string to a specified language if supported.
985 Language - The name of language to translate to
986 SupportedLanguages - Supported languages set
987 UnicodeStringTable - Pointer of one item in translation dictionary
988 UnicodeString - The translated string
992 EFI_INVALID_PARAMETER - Invalid parameter
993 EFI_UNSUPPORTED - System not supported this language or this string translation
994 EFI_SUCCESS - String successfully translated
1000 EfiLibAddUnicodeString (
1002 CHAR8
*SupportedLanguages
,
1003 EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
1004 CHAR16
*UnicodeString
1008 Routine Description:
1010 Add an translation to the dictionary if this language if supported.
1014 Language - The name of language to translate to
1015 SupportedLanguages - Supported languages set
1016 UnicodeStringTable - Translation dictionary
1017 UnicodeString - The corresponding string for the language to be translated to
1021 EFI_INVALID_PARAMETER - Invalid parameter
1022 EFI_UNSUPPORTED - System not supported this language
1023 EFI_ALREADY_STARTED - Already has a translation item of this language
1024 EFI_OUT_OF_RESOURCES - No enough buffer to be allocated
1025 EFI_SUCCESS - String successfully translated
1031 EfiLibFreeUnicodeStringTable (
1032 EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
1036 Routine Description:
1038 Free a string table.
1042 UnicodeStringTable - The string table to be freed.
1046 EFI_SUCCESS - The table successfully freed.
1052 EfiLibReportStatusCode (
1053 IN EFI_STATUS_CODE_TYPE Type
,
1054 IN EFI_STATUS_CODE_VALUE Value
,
1056 IN EFI_GUID
*CallerId OPTIONAL
,
1057 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
1061 Routine Description:
1069 Instance - Instance number
1070 CallerId - Caller name
1071 DevicePath - Device path that to be reported
1077 EFI_OUT_OF_RESOURCES - No enough buffer could be allocated
1083 ReportStatusCodeWithDevicePath (
1084 IN EFI_STATUS_CODE_TYPE Type
,
1085 IN EFI_STATUS_CODE_VALUE Value
,
1087 IN EFI_GUID
* CallerId OPTIONAL
,
1088 IN EFI_DEVICE_PATH_PROTOCOL
* DevicePath
1092 Routine Description:
1094 Report device path through status code.
1100 Instance - Instance number
1101 CallerId - Caller name
1102 DevicePath - Device path that to be reported
1108 EFI_OUT_OF_RESOURCES - No enough buffer could be allocated
1115 EfiCreateEventLegacyBoot (
1116 IN EFI_TPL NotifyTpl
,
1117 IN EFI_EVENT_NOTIFY NotifyFunction
,
1118 IN VOID
*NotifyContext
,
1119 OUT EFI_EVENT
*LegacyBootEvent
1123 Routine Description:
1124 Create a Legacy Boot Event.
1125 Tiano extended the CreateEvent Type enum to add a legacy boot event type.
1126 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
1127 added and now it's possible to not voilate the UEFI specification by
1128 declaring a GUID for the legacy boot event class. This library supports
1129 the R8.5/EFI 1.10 form and R8.6/UEFI 2.0 form and allows common code to
1133 LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
1136 EFI_SUCCESS Event was created.
1137 Other Event was not created.
1144 EfiCreateEventReadyToBoot (
1145 IN EFI_TPL NotifyTpl
,
1146 IN EFI_EVENT_NOTIFY NotifyFunction
,
1147 IN VOID
*NotifyContext
,
1148 OUT EFI_EVENT
*ReadyToBootEvent
1152 Routine Description:
1153 Create a Read to Boot Event.
1155 Tiano extended the CreateEvent Type enum to add a ready to boot event type.
1156 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
1157 added and now it's possible to not voilate the UEFI specification and use
1158 the ready to boot event class defined in UEFI 2.0. This library supports
1159 the R8.5/EFI 1.10 form and R8.6/UEFI 2.0 form and allows common code to
1163 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
1166 EFI_SUCCESS - Event was created.
1167 Other - Event was not created.
1174 EfiInitializeFwVolDevicepathNode (
1175 IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
,
1176 IN EFI_GUID
*NameGuid
1179 Routine Description:
1180 Initialize a Firmware Volume (FV) Media Device Path node.
1182 Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
1183 so as we move to UEFI 2.0 support we must use a mechanism that conforms with
1184 the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
1185 device path is defined for PIWG extensions of device path. If the code
1186 is compiled to conform with the UEFI 2.0 specification use the new device path
1187 else use the old form for backwards compatability.
1190 FvDevicePathNode - Pointer to a FV device path node to initialize
1191 NameGuid - FV file name to use in FvDevicePathNode
1198 EfiGetNameGuidFromFwVolDevicePathNode (
1199 IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
1202 Routine Description:
1203 Check to see if the Firmware Volume (FV) Media Device Path is valid.
1205 Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
1206 so as we move to UEFI 2.0 support we must use a mechanism that conforms with
1207 the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
1208 device path is defined for PIWG extensions of device path. If the code
1209 is compiled to conform with the UEFI 2.0 specification use the new device path
1210 else use the old form for backwards compatability. The return value to this
1211 function points to a location in FvDevicePathNode and it does not allocate
1212 new memory for the GUID pointer that is returned.
1215 FvDevicePathNode - Pointer to FV device path to check
1218 NULL - FvDevicePathNode is not valid.
1219 Other - FvDevicePathNode is valid and pointer to NameGuid was returned.
1225 EfiLibSafeFreePool (
1230 Routine Description:
1236 Buffer - The allocated pool entry to free
1240 Pointer of the buffer allocated.
1246 EfiLibTestManagedDevice (
1247 IN EFI_HANDLE ControllerHandle
,
1248 IN EFI_HANDLE DriverBindingHandle
,
1249 IN EFI_GUID
*ManagedProtocolGuid
1253 Routine Description:
1255 Test to see if the controller is managed by a specific driver.
1259 ControllerHandle - Handle for controller to test
1261 DriverBindingHandle - Driver binding handle for controller
1263 ManagedProtocolGuid - The protocol guid the driver opens on controller
1267 EFI_SUCCESS - The controller is managed by the driver
1269 EFI_UNSUPPORTED - The controller is not managed by the driver
1275 EfiLibTestChildHandle (
1276 IN EFI_HANDLE ControllerHandle
,
1277 IN EFI_HANDLE ChildHandle
,
1278 IN EFI_GUID
*ConsumedGuid
1282 Routine Description:
1284 Test to see if the child handle is the child of the controller
1288 ControllerHandle - Handle for controller (parent)
1290 ChildHandle - Child handle to test
1292 ConsumsedGuid - Protocol guid consumed by child from controller
1296 EFI_SUCCESS - The child handle is the child of the controller
1298 EFI_UNSUPPORTED - The child handle is not the child of the controller