2 MDE UEFI library functions and macros
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __UEFI_LIB_H__
16 #define __UEFI_LIB_H__
18 #include <Protocol/DriverBinding.h>
19 #include <Protocol/DriverConfiguration.h>
20 #include <Protocol/ComponentName.h>
21 #include <Protocol/ComponentName2.h>
22 #include <Protocol/DriverDiagnostics.h>
23 #include <Protocol/DriverDiagnostics2.h>
26 // Unicode String Table
30 CHAR16
*UnicodeString
;
31 } EFI_UNICODE_STRING_TABLE
;
37 EfiLockUninitialized
= 0,
53 This function searches the list of configuration tables stored in the EFI System
54 Table for a table with a GUID that matches TableGuid. If a match is found,
55 then a pointer to the configuration table is returned in Table, and EFI_SUCCESS
56 is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned.
58 @param TableGuid Pointer to table's GUID type..
59 @param Table Pointer to the table associated with TableGuid in the EFI System Table.
61 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
62 @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
67 EfiGetSystemConfigurationTable (
68 IN EFI_GUID
*TableGuid
,
73 This function causes the notification function to be executed for every protocol
74 of type ProtocolGuid instance that exists in the system when this function is
75 invoked. In addition, every time a protocol of type ProtocolGuid instance is
76 installed or reinstalled, the notification function is also executed.
78 @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
79 @param NotifyTpl Supplies the task priority level of the event notifications.
80 @param NotifyFunction Supplies the function to notify when the event is signaled.
81 @param NotifyContext The context parameter to pass to NotifyFunction.
82 @param Registration A pointer to a memory location to receive the registration value.
84 @return The notification event that was created.
89 EfiCreateProtocolNotifyEvent(
90 IN EFI_GUID
*ProtocolGuid
,
92 IN EFI_EVENT_NOTIFY NotifyFunction
,
93 IN VOID
*NotifyContext
, OPTIONAL
94 OUT VOID
**Registration
98 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
99 This event is signaled with EfiNamedEventSignal(). This provide the ability for
100 one or more listeners on the same event named by the GUID specified by Name.
102 @param Name Supplies GUID name of the event.
103 @param NotifyTpl Supplies the task priority level of the event notifications.
104 @param NotifyFunction Supplies the function to notify when the event is signaled.
105 @param NotifyContext The context parameter to pass to NotifyFunction.
106 @param Registration A pointer to a memory location to receive the registration value.
108 @retval EFI_SUCCESS A named event was created.
109 @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.
114 EfiNamedEventListen (
115 IN CONST EFI_GUID
*Name
,
116 IN EFI_TPL NotifyTpl
,
117 IN EFI_EVENT_NOTIFY NotifyFunction
,
118 IN CONST VOID
*NotifyContext
, OPTIONAL
119 OUT VOID
*Registration OPTIONAL
123 This function signals the named event specified by Name. The named event must
124 have been created with EfiNamedEventListen().
126 @param Name Supplies GUID name of the event.
128 @retval EFI_SUCCESS A named event was signaled.
129 @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.
134 EfiNamedEventSignal (
135 IN CONST EFI_GUID
*Name
139 Returns the current TPL.
141 This function returns the current TPL. There is no EFI service to directly
142 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
143 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
144 can then immediately be restored back to the current TPL level with a call
149 @retvale EFI_TPL The current TPL.
159 This function initializes a basic mutual exclusion lock to the released state
160 and returns the lock. Each lock provides mutual exclusion access at its task
161 priority level. Since there is no preemption or multiprocessor support in EFI,
162 acquiring the lock only consists of raising to the locks TPL.
164 @param Lock A pointer to the lock data structure to initialize.
165 @param Priority EFI TPL associated with the lock.
173 IN OUT EFI_LOCK
*Lock
,
178 This macro initializes the contents of a basic mutual exclusion lock to the
179 released state. Each lock provides mutual exclusion access at its task
180 priority level. Since there is no preemption or multiprocessor support in EFI,
181 acquiring the lock only consists of raising to the locks TPL.
183 @param Lock A pointer to the lock data structure to initialize.
184 @param Priority The task priority level of the lock.
189 #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \
190 {Priority, TPL_APPLICATION, EfiLockReleased }
195 Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
197 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
198 then this macro evaluates the EFI_LOCK structure specified by Lock. If Lock
199 is not in the locked state, then DebugAssert() is called passing in the source
200 filename, source line number, and Lock.
202 If Lock is NULL, then ASSERT().
204 @param LockParameter A pointer to the lock to acquire.
207 #define ASSERT_LOCKED(LockParameter) \
209 if (DebugAssertEnabled ()) { \
210 ASSERT (LockParameter != NULL); \
211 if ((LockParameter)->Lock != EfiLockAcquired) { \
212 _ASSERT (LockParameter not locked); \
219 This function raises the system's current task priority level to the task
220 priority level of the mutual exclusion lock. Then, it places the lock in the
223 @param Priority The task priority level of the lock.
233 This function raises the system's current task priority level to the task
234 priority level of the mutual exclusion lock. Then, it attempts to place the
235 lock in the acquired state.
237 @param Lock A pointer to the lock to acquire.
239 @retval EFI_SUCCESS The lock was acquired.
240 @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
245 EfiAcquireLockOrFail (
250 This function transitions a mutual exclusion lock from the acquired state to
251 the released state, and restores the system's task priority level to its
254 @param Lock A pointer to the lock to release.
264 Tests whether a controller handle is being managed by a specific driver.
266 This function tests whether the driver specified by DriverBindingHandle is
267 currently managing the controller specified by ControllerHandle. This test
268 is performed by evaluating if the the protocol specified by ProtocolGuid is
269 present on ControllerHandle and is was opened by DriverBindingHandle with an
270 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
271 If ProtocolGuid is NULL, then ASSERT().
273 @param ControllerHandle A handle for a controller to test.
274 @param DriverBindingHandle Specifies the driver binding handle for the
276 @param ProtocolGuid Specifies the protocol that the driver specified
277 by DriverBindingHandle opens in its Start()
280 @retval EFI_SUCCESS ControllerHandle is managed by the driver
281 specifed by DriverBindingHandle.
282 @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
283 specifed by DriverBindingHandle.
288 EfiTestManagedDevice (
289 IN CONST EFI_HANDLE ControllerHandle
,
290 IN CONST EFI_HANDLE DriverBindingHandle
,
291 IN CONST EFI_GUID
*ProtocolGuid
295 Tests whether a child handle is a child device of the controller.
297 This function tests whether ChildHandle is one of the children of
298 ControllerHandle. This test is performed by checking to see if the protocol
299 specified by ProtocolGuid is present on ControllerHandle and opened by
300 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
301 If ProtocolGuid is NULL, then ASSERT().
303 @param ControllerHandle A handle for a (parent) controller to test.
304 @param ChildHandle A child handle to test.
305 @param ConsumsedGuid Supplies the protocol that the child controller
306 opens on its parent controller.
308 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
309 @retval EFI_UNSUPPORTED ChildHandle is not a child of the
316 IN CONST EFI_HANDLE ControllerHandle
,
317 IN CONST EFI_HANDLE ChildHandle
,
318 IN CONST EFI_GUID
*ProtocolGuid
322 This function looks up a Unicode string in UnicodeStringTable. If Language is
323 a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable
324 that matches the language code specified by Language, then it is returned in
327 @param Language A pointer to the ISO 639-2 language code for the
328 Unicode string to look up and return.
329 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
330 that the Unicode string table supports. Language
331 must be a member of this set.
332 @param UnicodeStringTable A pointer to the table of Unicode strings.
333 @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
334 that matches the language specified by Language.
336 @retval EFI_SUCCESS The Unicode string that matches the language
337 specified by Language was found
338 in the table of Unicoide strings UnicodeStringTable,
339 and it was returned in UnicodeString.
340 @retval EFI_INVALID_PARAMETER Language is NULL.
341 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
342 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
343 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
344 @retval EFI_UNSUPPORTED The language specified by Language is not a
345 member of SupportedLanguages.
346 @retval EFI_UNSUPPORTED The language specified by Language is not
347 supported by UnicodeStringTable.
352 LookupUnicodeString (
353 IN CONST CHAR8
*Language
,
354 IN CONST CHAR8
*SupportedLanguages
,
355 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
356 OUT CHAR16
**UnicodeString
360 This function adds a Unicode string to UnicodeStringTable.
361 If Language is a member of SupportedLanguages then UnicodeString is added to
362 UnicodeStringTable. New buffers are allocated for both Language and
363 UnicodeString. The contents of Language and UnicodeString are copied into
364 these new buffers. These buffers are automatically freed when
365 FreeUnicodeStringTable() is called.
367 @param Language A pointer to the ISO 639-2 language code for the Unicode
369 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
370 that the Unicode string table supports.
371 Language must be a member of this set.
372 @param UnicodeStringTable A pointer to the table of Unicode strings.
373 @param UnicodeString A pointer to the Unicode string to add.
375 @retval EFI_SUCCESS The Unicode string that matches the language
376 specified by Language was found in the table of
377 Unicode strings UnicodeStringTable, and it was
378 returned in UnicodeString.
379 @retval EFI_INVALID_PARAMETER Language is NULL.
380 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
381 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
382 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
383 @retval EFI_ALREADY_STARTED A Unicode string with language Language is
384 already present in UnicodeStringTable.
385 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
386 Unicode string to UnicodeStringTable.
387 @retval EFI_UNSUPPORTED The language specified by Language is not a
388 member of SupportedLanguages.
394 IN CONST CHAR8
*Language
,
395 IN CONST CHAR8
*SupportedLanguages
,
396 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
397 IN CONST CHAR16
*UnicodeString
401 This function frees the table of Unicode strings in UnicodeStringTable.
402 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
403 Otherwise, each language code, and each Unicode string in the Unicode string
404 table are freed, and EFI_SUCCESS is returned.
406 @param UnicodeStringTable A pointer to the table of Unicode strings.
408 @retval EFI_SUCCESS The Unicode string table was freed.
413 FreeUnicodeStringTable (
414 IN EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
418 This function computes and returns the width of the Unicode character
419 specified by UnicodeChar.
421 @param UnicodeChar A Unicode character.
423 @retval 0 The width if UnicodeChar could not be determined.
424 @retval 1 UnicodeChar is a narrow glyph.
425 @retval 2 UnicodeChar is a wide glyph.
431 IN CHAR16 UnicodeChar
435 This function computes and returns the display length of
436 the Null-terminated Unicode string specified by String.
437 If String is NULL, then 0 is returned.
438 If any of the widths of the Unicode characters in String
439 can not be determined, then 0 is returned.
441 @param String A pointer to a Null-terminated Unicode string.
443 @return The display length of the Null-terminated Unicode string specified by String.
448 UnicodeStringDisplayLength (
449 IN CONST CHAR16
*String
453 // Functions that abstract early Framework contamination of UEFI.
456 Signal a Ready to Boot Event.
458 Create a Ready to Boot Event. Signal it and close it. This causes other
459 events of the same event group to be signaled in other modules.
464 EfiSignalEventReadyToBoot (
469 Signal a Legacy Boot Event.
471 Create a legacy Boot Event. Signal it and close it. This causes other
472 events of the same event group to be signaled in other modules.
477 EfiSignalEventLegacyBoot (
482 Create a Legacy Boot Event.
484 Tiano extended the CreateEvent Type enum to add a legacy boot event type.
485 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
486 added and now it's possible to not voilate the UEFI specification by
487 declaring a GUID for the legacy boot event class. This library supports
488 the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to
491 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
493 @retval EFI_SUCCESS Event was created.
494 @retval Other Event was not created.
499 EfiCreateEventLegacyBoot (
500 OUT EFI_EVENT
*LegacyBootEvent
504 Create an EFI event in the Legacy Boot Event Group and allows
505 the caller to specify a notification function.
507 This function abstracts the creation of the Legacy Boot Event.
508 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
509 This library abstracts the caller from how this event is created to prevent
510 to code form having to change with the version of the specification supported.
511 If LegacyBootEvent is NULL, then ASSERT().
513 @param NotifyTpl The task priority level of the event.
514 @param NotifyFunction The notification function to call when the event is signaled.
515 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
516 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
518 @retval EFI_SUCCESS Event was created.
519 @retval Other Event was not created.
524 EfiCreateEventLegacyBootEx (
525 IN EFI_TPL NotifyTpl
,
526 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
527 IN VOID
*NotifyContext
, OPTIONAL
528 OUT EFI_EVENT
*LegacyBootEvent
532 Create a Read to Boot Event.
534 Tiano extended the CreateEvent Type enum to add a ready to boot event type.
535 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
536 added and now it's possible to not voilate the UEFI specification and use
537 the ready to boot event class defined in UEFI 2.0. This library supports
538 the EDK/EFI 1.10 form and EDKII/UEFI 2.0 form and allows common code to
541 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
543 @retval EFI_SUCCESS Event was created.
544 @retval Other Event was not created.
549 EfiCreateEventReadyToBoot (
550 OUT EFI_EVENT
*ReadyToBootEvent
554 Create an EFI event in the Ready To Boot Event Group and allows
555 the caller to specify a notification function.
557 This function abstracts the creation of the Ready to Boot Event.
558 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
559 This library abstracts the caller from how this event is created to prevent
560 to code form having to change with the version of the specification supported.
561 If ReadyToBootEvent is NULL, then ASSERT().
563 @param NotifyTpl The task priority level of the event.
564 @param NotifyFunction The notification function to call when the event is signaled.
565 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
566 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
568 @retval EFI_SUCCESS Event was created.
569 @retval Other Event was not created.
574 EfiCreateEventReadyToBootEx (
575 IN EFI_TPL NotifyTpl
,
576 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
577 IN VOID
*NotifyContext
, OPTIONAL
578 OUT EFI_EVENT
*ReadyToBootEvent
582 Initialize a Firmware Volume (FV) Media Device Path node.
584 Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
585 so as we move to UEFI 2.0 support we must use a mechanism that conforms with
586 the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
587 device path is defined for Tiano extensions of device path. If the code
588 is compiled to conform with the UEFI 2.0 specification use the new device path
589 else use the old form for backwards compatability.
591 @param FvDevicePathNode Pointer to a FV device path node to initialize
592 @param NameGuid FV file name to use in FvDevicePathNode
597 EfiInitializeFwVolDevicepathNode (
598 IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
,
599 IN CONST EFI_GUID
*NameGuid
603 Check to see if the Firmware Volume (FV) Media Device Path is valid
605 Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
606 so as we move to UEFI 2.0 support we must use a mechanism that conforms with
607 the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
608 device path is defined for Tiano extensions of device path. If the code
609 is compiled to conform with the UEFI 2.0 specification use the new device path
610 else use the old form for backwards compatability. The return value to this
611 function points to a location in FvDevicePathNode and it does not allocate
612 new memory for the GUID pointer that is returned.
614 @param FvDevicePathNode Pointer to FV device path to check.
616 @retval NULL FvDevicePathNode is not valid.
617 @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
622 EfiGetNameGuidFromFwVolDevicePathNode (
623 IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
627 Prints a formatted Unicode string to the console output device specified by
628 ConOut defined in the EFI_SYSTEM_TABLE.
630 This function prints a formatted Unicode string to the console output device
631 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
632 characters that printed to ConOut. If the length of the formatted Unicode
633 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
634 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
636 @param Format Null-terminated Unicode format string.
637 @param ... VARARG list consumed to process Format.
638 If Format is NULL, then ASSERT().
639 If Format is not aligned on a 16-bit boundary, then ASSERT().
645 IN CONST CHAR16
*Format
,
650 Prints a formatted Unicode string to the console output device specified by
651 StdErr defined in the EFI_SYSTEM_TABLE.
653 This function prints a formatted Unicode string to the console output device
654 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
655 characters that printed to StdErr. If the length of the formatted Unicode
656 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
657 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
659 @param Format Null-terminated Unicode format string.
660 @param ... VARARG list consumed to process Format.
661 If Format is NULL, then ASSERT().
662 If Format is not aligned on a 16-bit boundary, then ASSERT().
668 IN CONST CHAR16
*Format
,
673 Prints a formatted ASCII string to the console output device specified by
674 ConOut defined in the EFI_SYSTEM_TABLE.
676 This function prints a formatted ASCII string to the console output device
677 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
678 characters that printed to ConOut. If the length of the formatted ASCII
679 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
680 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
682 @param Format Null-terminated ASCII format string.
683 @param ... VARARG list consumed to process Format.
684 If Format is NULL, then ASSERT().
685 If Format is not aligned on a 16-bit boundary, then ASSERT().
691 IN CONST CHAR8
*Format
,
696 Prints a formatted ASCII string to the console output device specified by
697 StdErr defined in the EFI_SYSTEM_TABLE.
699 This function prints a formatted ASCII string to the console output device
700 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
701 characters that printed to StdErr. If the length of the formatted ASCII
702 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
703 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
705 @param Format Null-terminated ASCII format string.
706 @param ... VARARG list consumed to process Format.
707 If Format is NULL, then ASSERT().
708 If Format is not aligned on a 16-bit boundary, then ASSERT().
714 IN CONST CHAR8
*Format
,
719 Intialize a driver by installing the Driver Binding Protocol onto the
720 driver's DriverBindingHandle. This is typically the same as the driver's
721 ImageHandle, but it can be different if the driver produces multiple
722 DriverBinding Protocols. This function also initializes the EFI Driver
723 Library that initializes the global variables gST, gBS, gRT.
725 @param ImageHandle The image handle of the driver
726 @param SystemTable The EFI System Table that was passed to the driver's entry point
727 @param DriverBinding A Driver Binding Protocol instance that this driver is producing
728 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
729 parameter is NULL, then a new handle is created.
731 @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle
732 @retval Other Status from gBS->InstallProtocolInterface()
737 EfiLibInstallDriverBinding (
738 IN CONST EFI_HANDLE ImageHandle
,
739 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
740 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
741 IN EFI_HANDLE DriverBindingHandle
745 Intialize a driver by installing the Driver Binding Protocol onto the
746 driver's DriverBindingHandle. This is typically the same as the driver's
747 ImageHandle, but it can be different if the driver produces multiple
748 DriverBinding Protocols. This function also initializes the EFI Driver
749 Library that initializes the global variables gST, gBS, gRT.
751 @ImageHandle The image handle of the driver
752 @SystemTable The EFI System Table that was passed to the driver's entry point
753 @DriverBinding A Driver Binding Protocol instance that this driver is producing
754 @DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
755 parameter is NULL, then a new handle is created.
756 @ComponentName A Component Name Protocol instance that this driver is producing
757 @DriverConfiguration A Driver Configuration Protocol instance that this driver is producing
758 @DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing
760 @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle
761 @retval Other Status from gBS->InstallProtocolInterface()
766 EfiLibInstallAllDriverProtocols (
767 IN CONST EFI_HANDLE ImageHandle
,
768 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
769 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
770 IN EFI_HANDLE DriverBindingHandle
,
771 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
772 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
773 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics OPTIONAL
778 Intialize a driver by installing the Driver Binding Protocol
779 onto the driver's DriverBindingHandle. This is typically the
780 same as the driver's ImageHandle, but it can be different if
781 the driver produces multiple DriverBinding Protocols. This
782 function also initializes the EFI Driver Library that
783 initializes the global variables gST, gBS, gRT.
785 @ImageHandle The image handle of the driver
787 @SystemTable The EFI System Table that was
788 passed to the driver's entry
791 @DriverBinding A Driver Binding Protocol
792 instance that this driver is
795 @DriverBindingHandle The handle that DriverBinding is
796 to be installe onto. If this
797 parameter is NULL, then a new
800 @ComponentName A Component Name Protocol
801 instance that this driver is
804 @ComponentName2 A Component Name 2 Protocol
805 instance that this driver is
808 @DriverConfiguration A Driver Configuration Protocol
809 instance that this driver is
812 @DriverDiagnostics A Driver Diagnostics Protocol
813 instance that this driver is
816 @DriverDiagnostics2 A Driver Diagnostics 2 Protocol
817 instance that this driver is
820 @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle
821 @retval Other Status from gBS->InstallProtocolInterface()
826 EfiLibInstallAllDriverProtocols2 (
827 IN CONST EFI_HANDLE ImageHandle
,
828 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
829 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
830 IN EFI_HANDLE DriverBindingHandle
,
831 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
832 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2
, OPTIONAL
833 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
834 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics
, OPTIONAL
835 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL
*DriverDiagnostics2 OPTIONAL