2 Provides library functions for common UEFI operations. Only available to DXE
5 The UEFI Library provides functions and macros that simplify the development of
6 UEFI Drivers and UEFI Applications. These functions and macros help manage EFI
7 events, build simple locks utilizing EFI Task Priority Levels (TPLs), install
8 EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers,
9 and print messages on the console output and standard error devices.
11 Note that a reserved macro named MDEPKG_NDEBUG is introduced for the intention
12 of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is
13 defined, then debug and assert related macros wrapped by it are the NULL implementations.
15 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
16 This program and the accompanying materials are licensed and made available under
17 the terms and conditions of the BSD License that accompanies this distribution.
18 The full text of the license may be found at
19 http://opensource.org/licenses/bsd-license.php.
21 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
22 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
26 #ifndef __UEFI_LIB_H__
27 #define __UEFI_LIB_H__
29 #include <Protocol/DriverBinding.h>
30 #include <Protocol/DriverConfiguration.h>
31 #include <Protocol/ComponentName.h>
32 #include <Protocol/ComponentName2.h>
33 #include <Protocol/DriverDiagnostics.h>
34 #include <Protocol/DriverDiagnostics2.h>
35 #include <Protocol/GraphicsOutput.h>
37 #include <Library/BaseLib.h>
40 /// Unicode String Table
44 CHAR16
*UnicodeString
;
45 } EFI_UNICODE_STRING_TABLE
;
51 EfiLockUninitialized
= 0,
66 Macro that returns the number of 100 ns units for a specified number of microseconds.
67 This is useful for managing EFI timer events.
69 @param Microseconds The number of microseconds.
71 @return The number of 100 ns units equivalent to the number of microseconds specified
75 #define EFI_TIMER_PERIOD_MICROSECONDS(Microseconds) MultU64x32((UINT64)(Microseconds), 10)
78 Macro that returns the number of 100 ns units for a specified number of milliseconds.
79 This is useful for managing EFI timer events.
81 @param Milliseconds The number of milliseconds.
83 @return The number of 100 ns units equivalent to the number of milliseconds specified
87 #define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds) MultU64x32((UINT64)(Milliseconds), 10000)
90 Macro that returns the number of 100 ns units for a specified number of seconds.
91 This is useful for managing EFI timer events.
93 @param Seconds The number of seconds.
95 @return The number of 100 ns units equivalent to the number of seconds specified
99 #define EFI_TIMER_PERIOD_SECONDS(Seconds) MultU64x32((UINT64)(Seconds), 10000000)
102 Macro that returns the a pointer to the next EFI_MEMORY_DESCRIPTOR in an array
103 returned from GetMemoryMap().
105 @param MemoryDescriptor A pointer to an EFI_MEMORY_DESCRIPTOR.
107 @param Size The size, in bytes, of the current EFI_MEMORY_DESCRIPTOR.
109 @return A pointer to the next EFI_MEMORY_DESCRIPTOR.
112 #define NEXT_MEMORY_DESCRIPTOR(MemoryDescriptor, Size) \
113 ((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) + (Size)))
116 Retrieves a pointer to the system configuration table from the EFI System Table
117 based on a specified GUID.
119 This function searches the list of configuration tables stored in the EFI System Table
120 for a table with a GUID that matches TableGuid. If a match is found, then a pointer to
121 the configuration table is returned in Table, and EFI_SUCCESS is returned. If a matching GUID
122 is not found, then EFI_NOT_FOUND is returned.
123 If TableGuid is NULL, then ASSERT().
124 If Table is NULL, then ASSERT().
126 @param TableGuid The pointer to table's GUID type..
127 @param Table The pointer to the table associated with TableGuid in the EFI System Table.
129 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
130 @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
135 EfiGetSystemConfigurationTable (
136 IN EFI_GUID
*TableGuid
,
141 Creates and returns a notification event and registers that event with all the protocol
142 instances specified by ProtocolGuid.
144 This function causes the notification function to be executed for every protocol of type
145 ProtocolGuid instance that exists in the system when this function is invoked. If there are
146 no instances of ProtocolGuid in the handle database at the time this function is invoked,
147 then the notification function is still executed one time. In addition, every time a protocol
148 of type ProtocolGuid instance is installed or reinstalled, the notification function is also
149 executed. This function returns the notification event that was created.
150 If ProtocolGuid is NULL, then ASSERT().
151 If NotifyTpl is not a legal TPL value, then ASSERT().
152 If NotifyFunction is NULL, then ASSERT().
153 If Registration is NULL, then ASSERT().
156 @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
157 @param NotifyTpl Supplies the task priority level of the event notifications.
158 @param NotifyFunction Supplies the function to notify when the event is signaled.
159 @param NotifyContext The context parameter to pass to NotifyFunction.
160 @param Registration A pointer to a memory location to receive the registration value.
161 This value is passed to LocateHandle() to obtain new handles that
162 have been added that support the ProtocolGuid-specified protocol.
164 @return The notification event that was created.
169 EfiCreateProtocolNotifyEvent(
170 IN EFI_GUID
*ProtocolGuid
,
171 IN EFI_TPL NotifyTpl
,
172 IN EFI_EVENT_NOTIFY NotifyFunction
,
173 IN VOID
*NotifyContext
, OPTIONAL
174 OUT VOID
**Registration
178 Creates a named event that can be signaled with EfiNamedEventSignal().
180 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
181 This event is signaled with EfiNamedEventSignal(). This provides the ability for one or more
182 listeners on the same event named by the GUID specified by Name.
183 If Name is NULL, then ASSERT().
184 If NotifyTpl is not a legal TPL value, then ASSERT().
185 If NotifyFunction is NULL, then ASSERT().
187 @param Name Supplies GUID name of the event.
188 @param NotifyTpl Supplies the task priority level of the event notifications.
189 @param NotifyFunction Supplies the function to notify when the event is signaled.
190 @param NotifyContext The context parameter to pass to NotifyFunction.
191 @param Registration A pointer to a memory location to receive the registration value.
193 @retval EFI_SUCCESS A named event was created.
194 @retval EFI_OUT_OF_RESOURCES There are not enough resources to create the named event.
199 EfiNamedEventListen (
200 IN CONST EFI_GUID
*Name
,
201 IN EFI_TPL NotifyTpl
,
202 IN EFI_EVENT_NOTIFY NotifyFunction
,
203 IN CONST VOID
*NotifyContext
, OPTIONAL
204 OUT VOID
*Registration OPTIONAL
208 Signals a named event created with EfiNamedEventListen().
210 This function signals the named event specified by Name. The named event must have been
211 created with EfiNamedEventListen().
212 If Name is NULL, then ASSERT().
214 @param Name Supplies the GUID name of the event.
216 @retval EFI_SUCCESS A named event was signaled.
217 @retval EFI_OUT_OF_RESOURCES There are not enough resources to signal the named event.
222 EfiNamedEventSignal (
223 IN CONST EFI_GUID
*Name
227 Returns the current TPL.
229 This function returns the current TPL. There is no EFI service to directly
230 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
231 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
232 can then immediately be restored back to the current TPL level with a call
235 @return The current TPL.
245 Initializes a basic mutual exclusion lock.
247 This function initializes a basic mutual exclusion lock to the released state
248 and returns the lock. Each lock provides mutual exclusion access at its task
249 priority level. Since there is no preemption or multiprocessor support in EFI,
250 acquiring the lock only consists of raising to the locks TPL.
251 If Lock is NULL, then ASSERT().
252 If Priority is not a valid TPL value, then ASSERT().
254 @param Lock A pointer to the lock data structure to initialize.
255 @param Priority The EFI TPL associated with the lock.
263 IN OUT EFI_LOCK
*Lock
,
268 Initializes a basic mutual exclusion lock.
270 This macro initializes the contents of a basic mutual exclusion lock to the
271 released state. Each lock provides mutual exclusion access at its task
272 priority level. Since there is no preemption or multiprocessor support in EFI,
273 acquiring the lock only consists of raising to the locks TPL.
275 @param Priority The task priority level of the lock.
280 #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \
281 {Priority, TPL_APPLICATION, EfiLockReleased }
285 Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
287 If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED
288 bit of PcdDebugProperyMask is set, then this macro evaluates the EFI_LOCK
289 structure specified by Lock. If Lock is not in the locked state, then
290 DebugAssert() is called passing in the source filename, source line number,
293 If Lock is NULL, then ASSERT().
295 @param LockParameter A pointer to the lock to acquire.
298 #if !defined(MDEPKG_NDEBUG)
299 #define ASSERT_LOCKED(LockParameter) \
301 if (DebugAssertEnabled ()) { \
302 ASSERT (LockParameter != NULL); \
303 if ((LockParameter)->Lock != EfiLockAcquired) { \
304 _ASSERT (LockParameter not locked); \
309 #define ASSERT_LOCKED(LockParameter)
314 Acquires ownership of a lock.
316 This function raises the system's current task priority level to the task
317 priority level of the mutual exclusion lock. Then, it places the lock in the
319 If Lock is NULL, then ASSERT().
320 If Lock is not initialized, then ASSERT().
321 If Lock is already in the acquired state, then ASSERT().
323 @param Lock A pointer to the lock to acquire.
333 Acquires ownership of a lock.
335 This function raises the system's current task priority level to the task priority
336 level of the mutual exclusion lock. Then, it attempts to place the lock in the acquired state.
337 If the lock is already in the acquired state, then EFI_ACCESS_DENIED is returned.
338 Otherwise, EFI_SUCCESS is returned.
339 If Lock is NULL, then ASSERT().
340 If Lock is not initialized, then ASSERT().
342 @param Lock A pointer to the lock to acquire.
344 @retval EFI_SUCCESS The lock was acquired.
345 @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
350 EfiAcquireLockOrFail (
355 Releases ownership of a lock.
357 This function transitions a mutual exclusion lock from the acquired state to
358 the released state, and restores the system's task priority level to its
360 If Lock is NULL, then ASSERT().
361 If Lock is not initialized, then ASSERT().
362 If Lock is already in the released state, then ASSERT().
364 @param Lock A pointer to the lock to release.
374 Tests whether a controller handle is being managed by a specific driver.
376 This function tests whether the driver specified by DriverBindingHandle is
377 currently managing the controller specified by ControllerHandle. This test
378 is performed by evaluating if the the protocol specified by ProtocolGuid is
379 present on ControllerHandle and is was opened by DriverBindingHandle with an
380 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
381 If ProtocolGuid is NULL, then ASSERT().
383 @param ControllerHandle A handle for a controller to test.
384 @param DriverBindingHandle Specifies the driver binding handle for the
386 @param ProtocolGuid Specifies the protocol that the driver specified
387 by DriverBindingHandle opens in its Start()
390 @retval EFI_SUCCESS ControllerHandle is managed by the driver
391 specified by DriverBindingHandle.
392 @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
393 specified by DriverBindingHandle.
398 EfiTestManagedDevice (
399 IN CONST EFI_HANDLE ControllerHandle
,
400 IN CONST EFI_HANDLE DriverBindingHandle
,
401 IN CONST EFI_GUID
*ProtocolGuid
405 Tests whether a child handle is a child device of the controller.
407 This function tests whether ChildHandle is one of the children of
408 ControllerHandle. This test is performed by checking to see if the protocol
409 specified by ProtocolGuid is present on ControllerHandle and opened by
410 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
411 If ProtocolGuid is NULL, then ASSERT().
413 @param ControllerHandle A handle for a (parent) controller to test.
414 @param ChildHandle A child handle to test.
415 @param ProtocolGuid Supplies the protocol that the child controller
416 opens on its parent controller.
418 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
419 @retval EFI_UNSUPPORTED ChildHandle is not a child of the
426 IN CONST EFI_HANDLE ControllerHandle
,
427 IN CONST EFI_HANDLE ChildHandle
,
428 IN CONST EFI_GUID
*ProtocolGuid
432 This function looks up a Unicode string in UnicodeStringTable.
434 If Language is a member of SupportedLanguages and a Unicode string is found in
435 UnicodeStringTable that matches the language code specified by Language, then it
436 is returned in UnicodeString.
438 @param Language A pointer to the ISO 639-2 language code for the
439 Unicode string to look up and return.
440 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
441 that the Unicode string table supports. Language
442 must be a member of this set.
443 @param UnicodeStringTable A pointer to the table of Unicode strings.
444 @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
445 that matches the language specified by Language.
447 @retval EFI_SUCCESS The Unicode string that matches the language
448 specified by Language was found
449 in the table of Unicode strings UnicodeStringTable,
450 and it was returned in UnicodeString.
451 @retval EFI_INVALID_PARAMETER Language is NULL.
452 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
453 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
454 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
455 @retval EFI_UNSUPPORTED The language specified by Language is not a
456 member of SupportedLanguages.
457 @retval EFI_UNSUPPORTED The language specified by Language is not
458 supported by UnicodeStringTable.
463 LookupUnicodeString (
464 IN CONST CHAR8
*Language
,
465 IN CONST CHAR8
*SupportedLanguages
,
466 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
467 OUT CHAR16
**UnicodeString
471 This function looks up a Unicode string in UnicodeStringTable.
473 If Language is a member of SupportedLanguages and a Unicode string is found in
474 UnicodeStringTable that matches the language code specified by Language, then
475 it is returned in UnicodeString.
477 @param Language A pointer to an ASCII string containing the ISO 639-2 or the
478 RFC 4646 language code for the Unicode string to look up and
479 return. If Iso639Language is TRUE, then this ASCII string is
480 not assumed to be Null-terminated, and only the first three
481 characters are used. If Iso639Language is FALSE, then this ASCII
482 string must be Null-terminated.
483 @param SupportedLanguages A pointer to a Null-terminated ASCII string that contains a
484 set of ISO 639-2 or RFC 4646 language codes that the Unicode
485 string table supports. Language must be a member of this set.
486 If Iso639Language is TRUE, then this string contains one or more
487 ISO 639-2 language codes with no separator characters. If Iso639Language
488 is FALSE, then is string contains one or more RFC 4646 language
489 codes separated by ';'.
490 @param UnicodeStringTable A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE
491 is defined in "Related Definitions".
492 @param UnicodeString A pointer to the Null-terminated Unicode string from UnicodeStringTable
493 that matches the language specified by Language.
494 @param Iso639Language Specifies the supported language code format. If it is TRUE, then
495 Language and SupportedLanguages follow ISO 639-2 language code format.
496 Otherwise, they follow the RFC 4646 language code format.
499 @retval EFI_SUCCESS The Unicode string that matches the language specified by Language
500 was found in the table of Unicode strings UnicodeStringTable, and
501 it was returned in UnicodeString.
502 @retval EFI_INVALID_PARAMETER Language is NULL.
503 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
504 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
505 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
506 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages.
507 @retval EFI_UNSUPPORTED The language specified by Language is not supported by UnicodeStringTable.
512 LookupUnicodeString2 (
513 IN CONST CHAR8
*Language
,
514 IN CONST CHAR8
*SupportedLanguages
,
515 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
516 OUT CHAR16
**UnicodeString
,
517 IN BOOLEAN Iso639Language
521 This function adds a Unicode string to UnicodeStringTable.
523 If Language is a member of SupportedLanguages then UnicodeString is added to
524 UnicodeStringTable. New buffers are allocated for both Language and
525 UnicodeString. The contents of Language and UnicodeString are copied into
526 these new buffers. These buffers are automatically freed when
527 FreeUnicodeStringTable() is called.
529 @param Language A pointer to the ISO 639-2 language code for the Unicode
531 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
532 that the Unicode string table supports.
533 Language must be a member of this set.
534 @param UnicodeStringTable A pointer to the table of Unicode strings.
535 @param UnicodeString A pointer to the Unicode string to add.
537 @retval EFI_SUCCESS The Unicode string that matches the language
538 specified by Language was found in the table of
539 Unicode strings UnicodeStringTable, and it was
540 returned in UnicodeString.
541 @retval EFI_INVALID_PARAMETER Language is NULL.
542 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
543 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
544 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
545 @retval EFI_ALREADY_STARTED A Unicode string with language Language is
546 already present in UnicodeStringTable.
547 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
548 Unicode string to UnicodeStringTable.
549 @retval EFI_UNSUPPORTED The language specified by Language is not a
550 member of SupportedLanguages.
556 IN CONST CHAR8
*Language
,
557 IN CONST CHAR8
*SupportedLanguages
,
558 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
559 IN CONST CHAR16
*UnicodeString
563 This function adds the Null-terminated Unicode string specified by UnicodeString
564 to UnicodeStringTable.
566 If Language is a member of SupportedLanguages then UnicodeString is added to
567 UnicodeStringTable. New buffers are allocated for both Language and UnicodeString.
568 The contents of Language and UnicodeString are copied into these new buffers.
569 These buffers are automatically freed when EfiLibFreeUnicodeStringTable() is called.
571 @param Language A pointer to an ASCII string containing the ISO 639-2 or
572 the RFC 4646 language code for the Unicode string to add.
573 If Iso639Language is TRUE, then this ASCII string is not
574 assumed to be Null-terminated, and only the first three
575 chacters are used. If Iso639Language is FALSE, then this
576 ASCII string must be Null-terminated.
577 @param SupportedLanguages A pointer to a Null-terminated ASCII string that contains
578 a set of ISO 639-2 or RFC 4646 language codes that the Unicode
579 string table supports. Language must be a member of this set.
580 If Iso639Language is TRUE, then this string contains one or more
581 ISO 639-2 language codes with no separator characters.
582 If Iso639Language is FALSE, then is string contains one or more
583 RFC 4646 language codes separated by ';'.
584 @param UnicodeStringTable A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE
585 is defined in "Related Definitions".
586 @param UnicodeString A pointer to the Unicode string to add.
587 @param Iso639Language Specifies the supported language code format. If it is TRUE,
588 then Language and SupportedLanguages follow ISO 639-2 language code format.
589 Otherwise, they follow RFC 4646 language code format.
591 @retval EFI_SUCCESS The Unicode string that matches the language specified by
592 Language was found in the table of Unicode strings UnicodeStringTable,
593 and it was returned in UnicodeString.
594 @retval EFI_INVALID_PARAMETER Language is NULL.
595 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
596 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
597 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
598 @retval EFI_ALREADY_STARTED A Unicode string with language Language is already present in
600 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another Unicode string UnicodeStringTable.
601 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages.
607 IN CONST CHAR8
*Language
,
608 IN CONST CHAR8
*SupportedLanguages
,
609 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
610 IN CONST CHAR16
*UnicodeString
,
611 IN BOOLEAN Iso639Language
615 This function frees the table of Unicode strings in UnicodeStringTable.
617 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
618 Otherwise, each language code, and each Unicode string in the Unicode string
619 table are freed, and EFI_SUCCESS is returned.
621 @param UnicodeStringTable A pointer to the table of Unicode strings.
623 @retval EFI_SUCCESS The Unicode string table was freed.
628 FreeUnicodeStringTable (
629 IN EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
632 #ifndef DISABLE_NEW_DEPRECATED_INTERFACES
635 [ATTENTION] This function will be deprecated for security reason.
637 Returns a pointer to an allocated buffer that contains the contents of a
638 variable retrieved through the UEFI Runtime Service GetVariable(). The
639 returned buffer is allocated using AllocatePool(). The caller is responsible
640 for freeing this buffer with FreePool().
642 If Name is NULL, then ASSERT().
643 If Guid is NULL, then ASSERT().
645 @param[in] Name The pointer to a Null-terminated Unicode string.
646 @param[in] Guid The pointer to an EFI_GUID structure.
648 @retval NULL The variable could not be retrieved.
649 @retval NULL There are not enough resources available for the variable contents.
650 @retval Other A pointer to allocated buffer containing the variable contents.
656 IN CONST CHAR16
*Name
,
657 IN CONST EFI_GUID
*Guid
661 [ATTENTION] This function will be deprecated for security reason.
663 Returns a pointer to an allocated buffer that contains the contents of a
664 variable retrieved through the UEFI Runtime Service GetVariable(). This
665 function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
666 The returned buffer is allocated using AllocatePool(). The caller is
667 responsible for freeing this buffer with FreePool().
669 If Name is NULL, then ASSERT().
671 @param[in] Name The pointer to a Null-terminated Unicode string.
673 @retval NULL The variable could not be retrieved.
674 @retval NULL There are not enough resources available for the variable contents.
675 @retval Other A pointer to allocated buffer containing the variable contents.
680 GetEfiGlobalVariable (
681 IN CONST CHAR16
*Name
687 Returns the status whether get the variable success. The function retrieves
688 variable through the UEFI Runtime Service GetVariable(). The
689 returned buffer is allocated using AllocatePool(). The caller is responsible
690 for freeing this buffer with FreePool().
692 If Name is NULL, then ASSERT().
693 If Guid is NULL, then ASSERT().
694 If Value is NULL, then ASSERT().
696 @param[in] Name The pointer to a Null-terminated Unicode string.
697 @param[in] Guid The pointer to an EFI_GUID structure
698 @param[out] Value The buffer point saved the variable info.
699 @param[out] Size The buffer size of the variable.
701 @return EFI_OUT_OF_RESOURCES Allocate buffer failed.
702 @return EFI_SUCCESS Find the specified variable.
703 @return Others Errors Return errors from call to gRT->GetVariable.
709 IN CONST CHAR16
*Name
,
710 IN CONST EFI_GUID
*Guid
,
712 OUT UINTN
*Size OPTIONAL
716 Returns a pointer to an allocated buffer that contains the contents of a
717 variable retrieved through the UEFI Runtime Service GetVariable(). This
718 function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
719 The returned buffer is allocated using AllocatePool(). The caller is
720 responsible for freeing this buffer with FreePool().
722 If Name is NULL, then ASSERT().
723 If Value is NULL, then ASSERT().
725 @param[in] Name The pointer to a Null-terminated Unicode string.
726 @param[out] Value The buffer point saved the variable info.
727 @param[out] Size The buffer size of the variable.
729 @return EFI_OUT_OF_RESOURCES Allocate buffer failed.
730 @return EFI_SUCCESS Find the specified variable.
731 @return Others Errors Return errors from call to gRT->GetVariable.
736 GetEfiGlobalVariable2 (
737 IN CONST CHAR16
*Name
,
739 OUT UINTN
*Size OPTIONAL
743 Returns a pointer to an allocated buffer that contains the best matching language
744 from a set of supported languages.
746 This function supports both ISO 639-2 and RFC 4646 language codes, but language
747 code types may not be mixed in a single call to this function. The language
748 code returned is allocated using AllocatePool(). The caller is responsible for
749 freeing the allocated buffer using FreePool(). This function supports a variable
750 argument list that allows the caller to pass in a prioritized list of language
751 codes to test against all the language codes in SupportedLanguages.
753 If SupportedLanguages is NULL, then ASSERT().
755 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string that
756 contains a set of language codes in the format
757 specified by Iso639Language.
758 @param[in] Iso639Language If TRUE, then all language codes are assumed to be
759 in ISO 639-2 format. If FALSE, then all language
760 codes are assumed to be in RFC 4646 language format
761 @param[in] ... A variable argument list that contains pointers to
762 Null-terminated ASCII strings that contain one or more
763 language codes in the format specified by Iso639Language.
764 The first language code from each of these language
765 code lists is used to determine if it is an exact or
766 close match to any of the language codes in
767 SupportedLanguages. Close matches only apply to RFC 4646
768 language codes, and the matching algorithm from RFC 4647
769 is used to determine if a close match is present. If
770 an exact or close match is found, then the matching
771 language code from SupportedLanguages is returned. If
772 no matches are found, then the next variable argument
773 parameter is evaluated. The variable argument list
774 is terminated by a NULL.
776 @retval NULL The best matching language could not be found in SupportedLanguages.
777 @retval NULL There are not enough resources available to return the best matching
779 @retval Other A pointer to a Null-terminated ASCII string that is the best matching
780 language in SupportedLanguages.
786 IN CONST CHAR8
*SupportedLanguages
,
787 IN BOOLEAN Iso639Language
,
792 Draws a dialog box to the console output device specified by
793 ConOut defined in the EFI_SYSTEM_TABLE and waits for a keystroke
794 from the console input device specified by ConIn defined in the
797 If there are no strings in the variable argument list, then ASSERT().
798 If all the strings in the variable argument list are empty, then ASSERT().
800 @param[in] Attribute Specifies the foreground and background color of the popup.
801 @param[out] Key A pointer to the EFI_KEY value of the key that was
802 pressed. This is an optional parameter that may be NULL.
803 If it is NULL then no wait for a keypress will be performed.
804 @param[in] ... The variable argument list that contains pointers to Null-
805 terminated Unicode strings to display in the dialog box.
806 The variable argument list is terminated by a NULL.
813 OUT EFI_INPUT_KEY
*Key
, OPTIONAL
818 Retrieves the width of a Unicode character.
820 This function computes and returns the width of the Unicode character specified
823 @param UnicodeChar A Unicode character.
825 @retval 0 The width if UnicodeChar could not be determined.
826 @retval 1 UnicodeChar is a narrow glyph.
827 @retval 2 UnicodeChar is a wide glyph.
833 IN CHAR16 UnicodeChar
837 Computes the display length of a Null-terminated Unicode String.
839 This function computes and returns the display length of the Null-terminated Unicode
840 string specified by String. If String is NULL then 0 is returned. If any of the widths
841 of the Unicode characters in String can not be determined, then 0 is returned. The display
842 width of String can be computed by summing the display widths of each Unicode character
843 in String. Unicode characters that are narrow glyphs have a width of 1, and Unicode
844 characters that are width glyphs have a width of 2.
845 If String is not aligned on a 16-bit boundary, then ASSERT().
847 @param String A pointer to a Null-terminated Unicode string.
849 @return The display length of the Null-terminated Unicode string specified by String.
854 UnicodeStringDisplayLength (
855 IN CONST CHAR16
*String
859 // Functions that abstract early Framework contamination of UEFI.
862 Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot().
864 This function abstracts the signaling of the Ready to Boot Event. The Framework moved
865 from a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller
866 from how this event is created to prevent to code form having to change with the
867 version of the specification supported.
872 EfiSignalEventReadyToBoot (
877 Create, Signal, and Close the Ready to Boot event using EfiSignalEventLegacyBoot().
879 This function abstracts the signaling of the Legacy Boot Event. The Framework moved from
880 a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller from how
881 this event is created to prevent to code form having to change with the version of the
882 specification supported.
887 EfiSignalEventLegacyBoot (
892 Creates an EFI event in the Legacy Boot Event Group.
894 Prior to UEFI 2.0 this was done via a non blessed UEFI extensions and this library
895 abstracts the implementation mechanism of this event from the caller. This function
896 abstracts the creation of the Legacy Boot Event. The Framework moved from a proprietary
897 to UEFI 2.0 based mechanism. This library abstracts the caller from how this event
898 is created to prevent to code form having to change with the version of the
899 specification supported.
900 If LegacyBootEvent is NULL, then ASSERT().
902 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
904 @retval EFI_SUCCESS The event was created.
905 @retval Other The event was not created.
910 EfiCreateEventLegacyBoot (
911 OUT EFI_EVENT
*LegacyBootEvent
915 Create an EFI event in the Legacy Boot Event Group and allows
916 the caller to specify a notification function.
918 This function abstracts the creation of the Legacy Boot Event.
919 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
920 This library abstracts the caller from how this event is created to prevent
921 to code form having to change with the version of the specification supported.
922 If LegacyBootEvent is NULL, then ASSERT().
924 @param NotifyTpl The task priority level of the event.
925 @param NotifyFunction The notification function to call when the event is signaled.
926 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
927 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
929 @retval EFI_SUCCESS The event was created.
930 @retval Other The event was not created.
935 EfiCreateEventLegacyBootEx (
936 IN EFI_TPL NotifyTpl
,
937 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
938 IN VOID
*NotifyContext
, OPTIONAL
939 OUT EFI_EVENT
*LegacyBootEvent
943 Create an EFI event in the Ready To Boot Event Group.
945 Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library
946 abstracts the implementation mechanism of this event from the caller.
947 This function abstracts the creation of the Ready to Boot Event. The Framework
948 moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts
949 the caller from how this event is created to prevent the code form having to
950 change with the version of the specification supported.
951 If ReadyToBootEvent is NULL, then ASSERT().
953 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
955 @retval EFI_SUCCESS The event was created.
956 @retval Other The event was not created.
961 EfiCreateEventReadyToBoot (
962 OUT EFI_EVENT
*ReadyToBootEvent
966 Create an EFI event in the Ready To Boot Event Group and allows
967 the caller to specify a notification function.
969 This function abstracts the creation of the Ready to Boot Event.
970 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
971 This library abstracts the caller from how this event is created to prevent
972 to code form having to change with the version of the specification supported.
973 If ReadyToBootEvent is NULL, then ASSERT().
975 @param NotifyTpl The task priority level of the event.
976 @param NotifyFunction The notification function to call when the event is signaled.
977 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
978 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
980 @retval EFI_SUCCESS The event was created.
981 @retval Other The event was not created.
986 EfiCreateEventReadyToBootEx (
987 IN EFI_TPL NotifyTpl
,
988 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
989 IN VOID
*NotifyContext
, OPTIONAL
990 OUT EFI_EVENT
*ReadyToBootEvent
994 Initialize a Firmware Volume (FV) Media Device Path node.
996 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
997 This library function abstracts initializing a device path node.
998 Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device
999 path changed in the DXE CIS version 0.92 in a non back ward compatible way to
1000 not conflict with the UEFI 2.0 specification. This function abstracts the
1001 differences from the caller.
1002 If FvDevicePathNode is NULL, then ASSERT().
1003 If NameGuid is NULL, then ASSERT().
1005 @param FvDevicePathNode The pointer to a FV device path node to initialize
1006 @param NameGuid FV file name to use in FvDevicePathNode
1011 EfiInitializeFwVolDevicepathNode (
1012 IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
,
1013 IN CONST EFI_GUID
*NameGuid
1017 Check to see if the Firmware Volume (FV) Media Device Path is valid
1019 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
1020 This library function abstracts validating a device path node.
1021 Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid.
1022 If it is valid, then return the GUID file name from the device path node. Otherwise,
1023 return NULL. This device path changed in the DXE CIS version 0.92 in a non backward
1024 compatible way to not conflict with the UEFI 2.0 specification. This function abstracts
1025 the differences from the caller.
1026 If FvDevicePathNode is NULL, then ASSERT().
1028 @param FvDevicePathNode The pointer to FV device path to check.
1030 @retval NULL FvDevicePathNode is not valid.
1031 @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
1036 EfiGetNameGuidFromFwVolDevicePathNode (
1037 IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
1041 Prints a formatted Unicode string to the console output device specified by
1042 ConOut defined in the EFI_SYSTEM_TABLE.
1044 This function prints a formatted Unicode string to the console output device
1045 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
1046 characters that printed to ConOut. If the length of the formatted Unicode
1047 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
1048 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
1049 If Format is NULL, then ASSERT().
1050 If Format is not aligned on a 16-bit boundary, then ASSERT().
1051 If gST->ConOut is NULL, then ASSERT().
1053 @param Format A null-terminated Unicode format string.
1054 @param ... The variable argument list whose contents are accessed based
1055 on the format string specified by Format.
1057 @return Number of Unicode characters printed to ConOut.
1063 IN CONST CHAR16
*Format
,
1068 Prints a formatted Unicode string to the console output device specified by
1069 StdErr defined in the EFI_SYSTEM_TABLE.
1071 This function prints a formatted Unicode string to the console output device
1072 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
1073 characters that printed to StdErr. If the length of the formatted Unicode
1074 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
1075 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
1076 If Format is NULL, then ASSERT().
1077 If Format is not aligned on a 16-bit boundary, then ASSERT().
1078 If gST->StdErr is NULL, then ASSERT().
1080 @param Format A null-terminated Unicode format string.
1081 @param ... The variable argument list whose contents are accessed based
1082 on the format string specified by Format.
1084 @return Number of Unicode characters printed to StdErr.
1090 IN CONST CHAR16
*Format
,
1095 Prints a formatted ASCII string to the console output device specified by
1096 ConOut defined in the EFI_SYSTEM_TABLE.
1098 This function prints a formatted ASCII string to the console output device
1099 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
1100 characters that printed to ConOut. If the length of the formatted ASCII
1101 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
1102 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
1103 If Format is NULL, then ASSERT().
1104 If gST->ConOut is NULL, then ASSERT().
1106 @param Format A null-terminated ASCII format string.
1107 @param ... The variable argument list whose contents are accessed based
1108 on the format string specified by Format.
1110 @return Number of ASCII characters printed to ConOut.
1116 IN CONST CHAR8
*Format
,
1121 Prints a formatted ASCII string to the console output device specified by
1122 StdErr defined in the EFI_SYSTEM_TABLE.
1124 This function prints a formatted ASCII string to the console output device
1125 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
1126 characters that printed to StdErr. If the length of the formatted ASCII
1127 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
1128 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
1129 If Format is NULL, then ASSERT().
1130 If gST->StdErr is NULL, then ASSERT().
1132 @param Format A null-terminated ASCII format string.
1133 @param ... The variable argument list whose contents are accessed based
1134 on the format string specified by Format.
1136 @return Number of ASCII characters printed to ConErr.
1142 IN CONST CHAR8
*Format
,
1148 Prints a formatted Unicode string to a graphics console device specified by
1149 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
1151 This function prints a formatted Unicode string to the graphics console device
1152 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
1153 Unicode characters displayed, not including partial characters that may be clipped
1154 by the right edge of the display. If the length of the formatted Unicode string is
1155 greater than PcdUefiLibMaxPrintBufferSize, then at most the first
1156 PcdUefiLibMaxPrintBufferSize characters are printed. The EFI_HII_FONT_PROTOCOL
1157 is used to convert the string to a bitmap using the glyphs registered with the
1158 HII database. No wrapping is performed, so any portions of the string the fall
1159 outside the active display region will not be displayed.
1161 If a graphics console device is not associated with the ConsoleOutputHandle
1162 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
1163 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
1164 string is printed, and 0 is returned.
1165 If Format is NULL, then ASSERT().
1166 If Format is not aligned on a 16-bit boundary, then ASSERT().
1167 If gST->ConsoleOutputHandle is NULL, then ASSERT().
1169 @param PointX X coordinate to print the string.
1170 @param PointY Y coordinate to print the string.
1171 @param ForeGround The foreground color of the string being printed. This is
1172 an optional parameter that may be NULL. If it is NULL,
1173 then the foreground color of the current ConOut device
1174 in the EFI_SYSTEM_TABLE is used.
1175 @param BackGround The background color of the string being printed. This is
1176 an optional parameter that may be NULL. If it is NULL,
1177 then the background color of the current ConOut device
1178 in the EFI_SYSTEM_TABLE is used.
1179 @param Format A null-terminated Unicode format string. See Print Library
1180 for the supported format string syntax.
1181 @param ... Variable argument list whose contents are accessed based on
1182 the format string specified by Format.
1184 @return The number of Unicode characters printed.
1192 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*ForeGround
, OPTIONAL
1193 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BackGround
, OPTIONAL
1194 IN CONST CHAR16
*Format
,
1199 Prints a formatted ASCII string to a graphics console device specified by
1200 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
1202 This function prints a formatted ASCII string to the graphics console device
1203 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
1204 ASCII characters displayed, not including partial characters that may be clipped
1205 by the right edge of the display. If the length of the formatted ASCII string is
1206 greater than PcdUefiLibMaxPrintBufferSize, then at most the first
1207 PcdUefiLibMaxPrintBufferSize characters are printed. The EFI_HII_FONT_PROTOCOL
1208 is used to convert the string to a bitmap using the glyphs registered with the
1209 HII database. No wrapping is performed, so any portions of the string the fall
1210 outside the active display region will not be displayed.
1212 If a graphics console device is not associated with the ConsoleOutputHandle
1213 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
1214 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
1215 string is printed, and 0 is returned.
1216 If Format is NULL, then ASSERT().
1217 If gST->ConsoleOutputHandle is NULL, then ASSERT().
1219 @param PointX X coordinate to print the string.
1220 @param PointY Y coordinate to print the string.
1221 @param ForeGround The foreground color of the string being printed. This is
1222 an optional parameter that may be NULL. If it is NULL,
1223 then the foreground color of the current ConOut device
1224 in the EFI_SYSTEM_TABLE is used.
1225 @param BackGround The background color of the string being printed. This is
1226 an optional parameter that may be NULL. If it is NULL,
1227 then the background color of the current ConOut device
1228 in the EFI_SYSTEM_TABLE is used.
1229 @param Format A null-terminated ASCII format string. See Print Library
1230 for the supported format string syntax.
1231 @param ... The variable argument list whose contents are accessed based on
1232 the format string specified by Format.
1234 @return The number of ASCII characters printed.
1242 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*ForeGround
, OPTIONAL
1243 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BackGround
, OPTIONAL
1244 IN CONST CHAR8
*Format
,
1249 Installs and completes the initialization of a Driver Binding Protocol instance.
1251 Installs the Driver Binding Protocol specified by DriverBinding onto the handle
1252 specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding
1253 is installed onto a newly created handle. DriverBindingHandle is typically the same
1254 as the driver's ImageHandle, but it can be different if the driver produces multiple
1255 Driver Binding Protocols.
1256 If DriverBinding is NULL, then ASSERT().
1257 If DriverBinding can not be installed onto a handle, then ASSERT().
1259 @param ImageHandle The image handle of the driver.
1260 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1261 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1262 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1263 parameter is NULL, then a new handle is created.
1265 @retval EFI_SUCCESS The protocol installation completed successfully.
1266 @retval EFI_OUT_OF_RESOURCES There was not enough system resources to install the protocol.
1267 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
1272 EfiLibInstallDriverBinding (
1273 IN CONST EFI_HANDLE ImageHandle
,
1274 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
1275 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
1276 IN EFI_HANDLE DriverBindingHandle
1281 Installs and completes the initialization of a Driver Binding Protocol instance and
1282 optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.
1284 Initializes a driver by installing the Driver Binding Protocol together with the
1285 optional Component Name, optional Driver Configure and optional Driver Diagnostic
1286 Protocols onto the driver's DriverBindingHandle. If DriverBindingHandle is NULL,
1287 then the protocols are installed onto a newly created handle. DriverBindingHandle
1288 is typically the same as the driver's ImageHandle, but it can be different if the
1289 driver produces multiple Driver Binding Protocols.
1290 If DriverBinding is NULL, then ASSERT().
1291 If the installation fails, then ASSERT().
1293 @param ImageHandle The image handle of the driver.
1294 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1295 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1296 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1297 parameter is NULL, then a new handle is created.
1298 @param ComponentName A Component Name Protocol instance that this driver is producing.
1299 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
1300 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
1302 @retval EFI_SUCCESS The protocol installation completed successfully.
1303 @retval EFI_OUT_OF_RESOURCES There was not enough memory in the pool to install all the protocols.
1308 EfiLibInstallAllDriverProtocols (
1309 IN CONST EFI_HANDLE ImageHandle
,
1310 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
1311 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
1312 IN EFI_HANDLE DriverBindingHandle
,
1313 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
1314 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
1315 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics OPTIONAL
1321 Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.
1323 Initializes a driver by installing the Driver Binding Protocol together with the
1324 optional Component Name and optional Component Name 2 protocols onto the driver's
1325 DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed
1326 onto a newly created handle. DriverBindingHandle is typically the same as the driver's
1327 ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols.
1328 If DriverBinding is NULL, then ASSERT().
1329 If the installation fails, then ASSERT().
1331 @param ImageHandle The image handle of the driver.
1332 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1333 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1334 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1335 parameter is NULL, then a new handle is created.
1336 @param ComponentName A Component Name Protocol instance that this driver is producing.
1337 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
1339 @retval EFI_SUCCESS The protocol installation completed successfully.
1340 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
1345 EfiLibInstallDriverBindingComponentName2 (
1346 IN CONST EFI_HANDLE ImageHandle
,
1347 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
1348 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
1349 IN EFI_HANDLE DriverBindingHandle
,
1350 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
1351 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2 OPTIONAL
1356 Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver
1357 Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.
1359 Initializes a driver by installing the Driver Binding Protocol together with the optional
1360 Component Name, optional Component Name 2, optional Driver Configuration, optional Driver Configuration 2,
1361 optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols onto the driver's DriverBindingHandle.
1362 DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver
1363 produces multiple Driver Binding Protocols.
1364 If DriverBinding is NULL, then ASSERT().
1365 If the installation fails, then ASSERT().
1368 @param ImageHandle The image handle of the driver.
1369 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1370 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1371 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1372 parameter is NULL, then a new handle is created.
1373 @param ComponentName A Component Name Protocol instance that this driver is producing.
1374 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
1375 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
1376 @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver is producing.
1377 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
1378 @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.
1380 @retval EFI_SUCCESS The protocol installation completed successfully.
1381 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
1386 EfiLibInstallAllDriverProtocols2 (
1387 IN CONST EFI_HANDLE ImageHandle
,
1388 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
1389 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
1390 IN EFI_HANDLE DriverBindingHandle
,
1391 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
1392 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2
, OPTIONAL
1393 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
1394 IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL
*DriverConfiguration2
, OPTIONAL
1395 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics
, OPTIONAL
1396 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL
*DriverDiagnostics2 OPTIONAL
1400 Appends a formatted Unicode string to a Null-terminated Unicode string
1402 This function appends a formatted Unicode string to the Null-terminated
1403 Unicode string specified by String. String is optional and may be NULL.
1404 Storage for the formatted Unicode string returned is allocated using
1405 AllocatePool(). The pointer to the appended string is returned. The caller
1406 is responsible for freeing the returned string.
1408 If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().
1409 If FormatString is NULL, then ASSERT().
1410 If FormatString is not aligned on a 16-bit boundary, then ASSERT().
1412 @param[in] String A Null-terminated Unicode string.
1413 @param[in] FormatString A Null-terminated Unicode format string.
1414 @param[in] Marker VA_LIST marker for the variable argument list.
1416 @retval NULL There was not enough available memory.
1417 @return Null-terminated Unicode string is that is the formatted
1418 string appended to String.
1423 IN CHAR16
*String
, OPTIONAL
1424 IN CONST CHAR16
*FormatString
,
1429 Appends a formatted Unicode string to a Null-terminated Unicode string
1431 This function appends a formatted Unicode string to the Null-terminated
1432 Unicode string specified by String. String is optional and may be NULL.
1433 Storage for the formatted Unicode string returned is allocated using
1434 AllocatePool(). The pointer to the appended string is returned. The caller
1435 is responsible for freeing the returned string.
1437 If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().
1438 If FormatString is NULL, then ASSERT().
1439 If FormatString is not aligned on a 16-bit boundary, then ASSERT().
1441 @param[in] String A Null-terminated Unicode string.
1442 @param[in] FormatString A Null-terminated Unicode format string.
1443 @param[in] ... The variable argument list whose contents are
1444 accessed based on the format string specified by
1447 @retval NULL There was not enough available memory.
1448 @return Null-terminated Unicode string is that is the formatted
1449 string appended to String.
1454 IN CHAR16
*String
, OPTIONAL
1455 IN CONST CHAR16
*FormatString
,