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 Copyright (c) 2006 - 2008, Intel Corporation
12 All rights reserved. This program and the accompanying materials
13 are licensed and made available under the terms and conditions of the BSD License
14 which accompanies this distribution. The full text of the license may be found at
15 http://opensource.org/licenses/bsd-license.php
17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
22 #ifndef __UEFI_LIB_H__
23 #define __UEFI_LIB_H__
25 #include <Protocol/DriverBinding.h>
26 #include <Protocol/DriverConfiguration.h>
27 #include <Protocol/ComponentName.h>
28 #include <Protocol/ComponentName2.h>
29 #include <Protocol/DriverDiagnostics.h>
30 #include <Protocol/DriverDiagnostics2.h>
32 #include <Library/BaseLib.h>
35 /// Unicode String Table
39 CHAR16
*UnicodeString
;
40 } EFI_UNICODE_STRING_TABLE
;
46 EfiLockUninitialized
= 0,
62 Macro that returns the number of 100 ns units for a specified number of microseconds.
63 Useful for managing EFI timer events.
65 @param Microseconds Number of microseonds.
67 @return The number of 100 ns units equivalent to the number of microseconds specified
71 #define EFI_TIMER_PERIOD_MICROSECONDS(Microseconds) MultU64x32((UINT64)(Microseconds), 10)
75 Macro that returns the number of 100 ns units for a specified number of milliseoconds.
76 Useful for managing EFI timer events.
78 @param Milliseconds Number of milliseconds.
80 @return The number of 100 ns units equivalent to the number of milliseconds specified
84 #define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds) MultU64x32((UINT64)(Milliseconds), 10000)
88 Macro that returns the number of 100 ns units for a specified number of seoconds.
89 Useful for managing EFI timer events.
91 @param Seconds Number of seconds.
93 @return The number of 100 ns units equivalent to the number of seconds specified
97 #define EFI_TIMER_PERIOD_SECONDS(Seconds) MultU64x32((UINT64)(Seconds), 10000000)
101 This function searches the list of configuration tables stored in the EFI System
102 Table for a table with a GUID that matches TableGuid. If a match is found,
103 then a pointer to the configuration table is returned in Table, and EFI_SUCCESS
104 is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned.
106 @param TableGuid Pointer to table's GUID type..
107 @param Table Pointer to the table associated with TableGuid in the EFI System Table.
109 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
110 @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
115 EfiGetSystemConfigurationTable (
116 IN EFI_GUID
*TableGuid
,
121 This function causes the notification function to be executed for every protocol
122 of type ProtocolGuid instance that exists in the system when this function is
123 invoked. In addition, every time a protocol of type ProtocolGuid instance is
124 installed or reinstalled, the notification function is also executed.
126 @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
127 @param NotifyTpl Supplies the task priority level of the event notifications.
128 @param NotifyFunction Supplies the function to notify when the event is signaled.
129 @param NotifyContext The context parameter to pass to NotifyFunction.
130 @param Registration A pointer to a memory location to receive the registration value.
132 @return The notification event that was created.
137 EfiCreateProtocolNotifyEvent(
138 IN EFI_GUID
*ProtocolGuid
,
139 IN EFI_TPL NotifyTpl
,
140 IN EFI_EVENT_NOTIFY NotifyFunction
,
141 IN VOID
*NotifyContext
, OPTIONAL
142 OUT VOID
**Registration
146 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
147 This event is signaled with EfiNamedEventSignal(). This provide the ability for
148 one or more listeners on the same event named by the GUID specified by Name.
150 @param Name Supplies GUID name of the event.
151 @param NotifyTpl Supplies the task priority level of the event notifications.
152 @param NotifyFunction Supplies the function to notify when the event is signaled.
153 @param NotifyContext The context parameter to pass to NotifyFunction.
154 @param Registration A pointer to a memory location to receive the registration value.
156 @retval EFI_SUCCESS A named event was created.
157 @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.
162 EfiNamedEventListen (
163 IN CONST EFI_GUID
*Name
,
164 IN EFI_TPL NotifyTpl
,
165 IN EFI_EVENT_NOTIFY NotifyFunction
,
166 IN CONST VOID
*NotifyContext
, OPTIONAL
167 OUT VOID
*Registration OPTIONAL
171 This function signals the named event specified by Name. The named event must
172 have been created with EfiNamedEventListen().
174 @param Name Supplies GUID name of the event.
176 @retval EFI_SUCCESS A named event was signaled.
177 @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.
182 EfiNamedEventSignal (
183 IN CONST EFI_GUID
*Name
187 Returns the current TPL.
189 This function returns the current TPL. There is no EFI service to directly
190 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
191 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
192 can then immediately be restored back to the current TPL level with a call
195 @return The current TPL.
205 This function initializes a basic mutual exclusion lock to the released state
206 and returns the lock. Each lock provides mutual exclusion access at its task
207 priority level. Since there is no preemption or multiprocessor support in EFI,
208 acquiring the lock only consists of raising to the locks TPL.
210 @param Lock A pointer to the lock data structure to initialize.
211 @param Priority EFI TPL associated with the lock.
219 IN OUT EFI_LOCK
*Lock
,
224 This macro initializes the contents of a basic mutual exclusion lock to the
225 released state. Each lock provides mutual exclusion access at its task
226 priority level. Since there is no preemption or multiprocessor support in EFI,
227 acquiring the lock only consists of raising to the locks TPL.
229 @param Priority The task priority level of the lock.
234 #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \
235 {Priority, TPL_APPLICATION, EfiLockReleased }
240 Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
242 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
243 then this macro evaluates the EFI_LOCK structure specified by Lock. If Lock
244 is not in the locked state, then DebugAssert() is called passing in the source
245 filename, source line number, and Lock.
247 If Lock is NULL, then ASSERT().
249 @param LockParameter A pointer to the lock to acquire.
252 #define ASSERT_LOCKED(LockParameter) \
254 if (DebugAssertEnabled ()) { \
255 ASSERT (LockParameter != NULL); \
256 if ((LockParameter)->Lock != EfiLockAcquired) { \
257 _ASSERT (LockParameter not locked); \
264 This function raises the system's current task priority level to the task
265 priority level of the mutual exclusion lock. Then, it places the lock in the
268 @param Lock A pointer to the lock to acquire.
278 This function raises the system's current task priority level to the task
279 priority level of the mutual exclusion lock. Then, it attempts to place the
280 lock in the acquired state.
282 @param Lock A pointer to the lock to acquire.
284 @retval EFI_SUCCESS The lock was acquired.
285 @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
290 EfiAcquireLockOrFail (
295 This function transitions a mutual exclusion lock from the acquired state to
296 the released state, and restores the system's task priority level to its
299 @param Lock A pointer to the lock to release.
309 Tests whether a controller handle is being managed by a specific driver.
311 This function tests whether the driver specified by DriverBindingHandle is
312 currently managing the controller specified by ControllerHandle. This test
313 is performed by evaluating if the the protocol specified by ProtocolGuid is
314 present on ControllerHandle and is was opened by DriverBindingHandle with an
315 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
316 If ProtocolGuid is NULL, then ASSERT().
318 @param ControllerHandle A handle for a controller to test.
319 @param DriverBindingHandle Specifies the driver binding handle for the
321 @param ProtocolGuid Specifies the protocol that the driver specified
322 by DriverBindingHandle opens in its Start()
325 @retval EFI_SUCCESS ControllerHandle is managed by the driver
326 specifed by DriverBindingHandle.
327 @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
328 specifed by DriverBindingHandle.
333 EfiTestManagedDevice (
334 IN CONST EFI_HANDLE ControllerHandle
,
335 IN CONST EFI_HANDLE DriverBindingHandle
,
336 IN CONST EFI_GUID
*ProtocolGuid
340 Tests whether a child handle is a child device of the controller.
342 This function tests whether ChildHandle is one of the children of
343 ControllerHandle. This test is performed by checking to see if the protocol
344 specified by ProtocolGuid is present on ControllerHandle and opened by
345 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
346 If ProtocolGuid is NULL, then ASSERT().
348 @param ControllerHandle A handle for a (parent) controller to test.
349 @param ChildHandle A child handle to test.
350 @param ProtocolGuid Supplies the protocol that the child controller
351 opens on its parent controller.
353 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
354 @retval EFI_UNSUPPORTED ChildHandle is not a child of the
361 IN CONST EFI_HANDLE ControllerHandle
,
362 IN CONST EFI_HANDLE ChildHandle
,
363 IN CONST EFI_GUID
*ProtocolGuid
367 This function looks up a Unicode string in UnicodeStringTable. If Language is
368 a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable
369 that matches the language code specified by Language, then it is returned in
372 @param Language A pointer to the ISO 639-2 language code for the
373 Unicode string to look up and return.
374 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
375 that the Unicode string table supports. Language
376 must be a member of this set.
377 @param UnicodeStringTable A pointer to the table of Unicode strings.
378 @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
379 that matches the language specified by Language.
381 @retval EFI_SUCCESS The Unicode string that matches the language
382 specified by Language was found
383 in the table of Unicoide strings UnicodeStringTable,
384 and it was returned in UnicodeString.
385 @retval EFI_INVALID_PARAMETER Language is NULL.
386 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
387 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
388 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
389 @retval EFI_UNSUPPORTED The language specified by Language is not a
390 member of SupportedLanguages.
391 @retval EFI_UNSUPPORTED The language specified by Language is not
392 supported by UnicodeStringTable.
397 LookupUnicodeString (
398 IN CONST CHAR8
*Language
,
399 IN CONST CHAR8
*SupportedLanguages
,
400 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
401 OUT CHAR16
**UnicodeString
405 This function looks up a Unicode string in UnicodeStringTable.
406 If Language is a member of SupportedLanguages and a Unicode
407 string is found in UnicodeStringTable that matches the
408 language code specified by Language, then it is returned in
411 @param Language A pointer to the ISO 639-2 or
412 RFC 3066 language code for the
413 Unicode string to look up and
416 @param SupportedLanguages A pointer to the set of ISO
417 639-2 or RFC 3066 language
418 codes that the Unicode string
419 table supports. Language must
420 be a member of this set.
422 @param UnicodeStringTable A pointer to the table of
425 @param UnicodeString A pointer to the Unicode
426 string from UnicodeStringTable
427 that matches the language
428 specified by Language.
430 @param Iso639Language Specify the language code
431 format supported. If true,
432 then the format follow ISO
433 639-2. If false, then it
436 @retval EFI_SUCCESS The Unicode string that
437 matches the language specified
438 by Language was found in the
439 table of Unicoide strings
440 UnicodeStringTable, and it was
441 returned in UnicodeString.
443 @retval EFI_INVALID_PARAMETER Language is NULL.
445 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
447 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
449 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
451 @retval EFI_UNSUPPORTED The language specified by
452 Language is not a member
453 ofSupportedLanguages.
455 @retval EFI_UNSUPPORTED The language specified by
456 Language is not supported by
462 LookupUnicodeString2 (
463 IN CONST CHAR8
*Language
,
464 IN CONST CHAR8
*SupportedLanguages
,
465 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
466 OUT CHAR16
**UnicodeString
,
467 IN BOOLEAN Iso639Language
471 This function adds a Unicode string to UnicodeStringTable.
472 If Language is a member of SupportedLanguages then UnicodeString is added to
473 UnicodeStringTable. New buffers are allocated for both Language and
474 UnicodeString. The contents of Language and UnicodeString are copied into
475 these new buffers. These buffers are automatically freed when
476 FreeUnicodeStringTable() is called.
478 @param Language A pointer to the ISO 639-2 language code for the Unicode
480 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
481 that the Unicode string table supports.
482 Language must be a member of this set.
483 @param UnicodeStringTable A pointer to the table of Unicode strings.
484 @param UnicodeString A pointer to the Unicode string to add.
486 @retval EFI_SUCCESS The Unicode string that matches the language
487 specified by Language was found in the table of
488 Unicode strings UnicodeStringTable, and it was
489 returned in UnicodeString.
490 @retval EFI_INVALID_PARAMETER Language is NULL.
491 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
492 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
493 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
494 @retval EFI_ALREADY_STARTED A Unicode string with language Language is
495 already present in UnicodeStringTable.
496 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
497 Unicode string to UnicodeStringTable.
498 @retval EFI_UNSUPPORTED The language specified by Language is not a
499 member of SupportedLanguages.
505 IN CONST CHAR8
*Language
,
506 IN CONST CHAR8
*SupportedLanguages
,
507 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
508 IN CONST CHAR16
*UnicodeString
513 This function adds a Unicode string to UnicodeStringTable.
514 If Language is a member of SupportedLanguages then
515 UnicodeString is added to UnicodeStringTable. New buffers are
516 allocated for both Language and UnicodeString. The contents
517 of Language and UnicodeString are copied into these new
518 buffers. These buffers are automatically freed when
519 FreeUnicodeStringTable() is called.
521 @param Language A pointer to the ISO 639-2 or
522 RFC 3066 language code for the
523 Unicode string to add.
525 @param SupportedLanguages A pointer to the set of ISO
526 639-2 or RFC 3066 language
527 codes that the Unicode string
528 table supports. Language must
529 be a member of this set.
531 @param UnicodeStringTable A pointer to the table of
534 @param UnicodeString A pointer to the Unicode
537 @param Iso639Language Specify the language code
538 format supported. If true,
539 then the format follow ISO
540 639-2. If false, then it
543 @retval EFI_SUCCESS The Unicode string that
544 matches the language specified
545 by Language was found in the
546 table of Unicode strings
547 UnicodeStringTable, and it was
548 returned in UnicodeString.
550 @retval EFI_INVALID_PARAMETER Language is NULL.
552 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
554 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
556 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
558 @retval EFI_ALREADY_STARTED A Unicode string with language
559 Language is already present in
562 @retval EFI_OUT_OF_RESOURCES There is not enough memory to
563 add another Unicode string to
566 @retval EFI_UNSUPPORTED The language specified by
567 Language is not a member of
574 IN CONST CHAR8
*Language
,
575 IN CONST CHAR8
*SupportedLanguages
,
576 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
577 IN CONST CHAR16
*UnicodeString
,
578 IN BOOLEAN Iso639Language
582 This function frees the table of Unicode strings in UnicodeStringTable.
583 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
584 Otherwise, each language code, and each Unicode string in the Unicode string
585 table are freed, and EFI_SUCCESS is returned.
587 @param UnicodeStringTable A pointer to the table of Unicode strings.
589 @retval EFI_SUCCESS The Unicode string table was freed.
594 FreeUnicodeStringTable (
595 IN EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
599 This function computes and returns the width of the Unicode character
600 specified by UnicodeChar.
602 @param UnicodeChar A Unicode character.
604 @retval 0 The width if UnicodeChar could not be determined.
605 @retval 1 UnicodeChar is a narrow glyph.
606 @retval 2 UnicodeChar is a wide glyph.
612 IN CHAR16 UnicodeChar
616 This function computes and returns the display length of
617 the Null-terminated Unicode string specified by String.
618 If String is NULL, then 0 is returned.
619 If any of the widths of the Unicode characters in String
620 can not be determined, then 0 is returned.
622 @param String A pointer to a Null-terminated Unicode string.
624 @return The display length of the Null-terminated Unicode string specified by String.
629 UnicodeStringDisplayLength (
630 IN CONST CHAR16
*String
634 // Functions that abstract early Framework contamination of UEFI.
637 Signal a Ready to Boot Event.
639 Create a Ready to Boot Event. Signal it and close it. This causes other
640 events of the same event group to be signaled in other modules.
645 EfiSignalEventReadyToBoot (
650 Signal a Legacy Boot Event.
652 Create a legacy Boot Event. Signal it and close it. This causes other
653 events of the same event group to be signaled in other modules.
658 EfiSignalEventLegacyBoot (
663 Creates an EFI event in the Legacy Boot Event Group. Prior to UEFI 2.0 this
664 was done via a non blessed UEFI extensions and this library abstracts the
665 implementation mechanism of this event from the caller.
667 This function abstracts the creation of the Legacy Boot Event. The Framework
668 moved from a proprietary to UEFI 2.0 based mechanism. This library abstracts
669 the caller from how this event is created to prevent to code form having to
670 change with the version of the specification supported.
671 If LegacyBootEvent is NULL, then ASSERT().
673 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
675 @retval EFI_SUCCESS Event was created.
676 @retval Other Event was not created.
681 EfiCreateEventLegacyBoot (
682 OUT EFI_EVENT
*LegacyBootEvent
686 Create an EFI event in the Legacy Boot Event Group and allows
687 the caller to specify a notification function.
689 This function abstracts the creation of the Legacy Boot Event.
690 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
691 This library abstracts the caller from how this event is created to prevent
692 to code form having to change with the version of the specification supported.
693 If LegacyBootEvent is NULL, then ASSERT().
695 @param NotifyTpl The task priority level of the event.
696 @param NotifyFunction The notification function to call when the event is signaled.
697 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
698 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
700 @retval EFI_SUCCESS Event was created.
701 @retval Other Event was not created.
706 EfiCreateEventLegacyBootEx (
707 IN EFI_TPL NotifyTpl
,
708 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
709 IN VOID
*NotifyContext
, OPTIONAL
710 OUT EFI_EVENT
*LegacyBootEvent
714 Create an EFI event in the Ready To Boot Event Group. Prior to UEFI 2.0 this
715 was done via a non-standard UEFI extension, and this library abstracts the
716 implementation mechanism of this event from the caller.
718 This function abstracts the creation of the Ready to Boot Event. The Framework
719 moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts
720 the caller from how this event is created to prevent the code form having to
721 change with the version of the specification supported.
722 If ReadyToBootEvent is NULL, then ASSERT().
724 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
726 @retval EFI_SUCCESS Event was created.
727 @retval Other Event was not created.
732 EfiCreateEventReadyToBoot (
733 OUT EFI_EVENT
*ReadyToBootEvent
737 Create an EFI event in the Ready To Boot Event Group and allows
738 the caller to specify a notification function.
740 This function abstracts the creation of the Ready to Boot Event.
741 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
742 This library abstracts the caller from how this event is created to prevent
743 to code form having to change with the version of the specification supported.
744 If ReadyToBootEvent is NULL, then ASSERT().
746 @param NotifyTpl The task priority level of the event.
747 @param NotifyFunction The notification function to call when the event is signaled.
748 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
749 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
751 @retval EFI_SUCCESS Event was created.
752 @retval Other Event was not created.
757 EfiCreateEventReadyToBootEx (
758 IN EFI_TPL NotifyTpl
,
759 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
760 IN VOID
*NotifyContext
, OPTIONAL
761 OUT EFI_EVENT
*ReadyToBootEvent
765 Initialize a Firmware Volume (FV) Media Device Path node.
767 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
768 This library function abstracts initializing a device path node.
770 Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device
771 path changed in the DXE CIS version 0.92 in a non back ward compatible way to
772 not conflict with the UEFI 2.0 specification. This function abstracts the
773 differences from the caller.
775 If FvDevicePathNode is NULL, then ASSERT().
776 If NameGuid is NULL, then ASSERT().
778 @param FvDevicePathNode Pointer to a FV device path node to initialize
779 @param NameGuid FV file name to use in FvDevicePathNode
784 EfiInitializeFwVolDevicepathNode (
785 IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
,
786 IN CONST EFI_GUID
*NameGuid
790 Check to see if the Firmware Volume (FV) Media Device Path is valid
792 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
793 This library function abstracts validating a device path node.
795 Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid.
796 If it is valid, then return the GUID file name from the device path node. Otherwise,
797 return NULL. This device path changed in the DXE CIS version 0.92 in a non back ward
798 compatible way to not conflict with the UEFI 2.0 specification. This function abstracts
799 the differences from the caller.
800 If FvDevicePathNode is NULL, then ASSERT().
802 @param FvDevicePathNode Pointer to FV device path to check.
804 @retval NULL FvDevicePathNode is not valid.
805 @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
810 EfiGetNameGuidFromFwVolDevicePathNode (
811 IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
815 Prints a formatted Unicode string to the console output device specified by
816 ConOut defined in the EFI_SYSTEM_TABLE.
818 This function prints a formatted Unicode string to the console output device
819 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
820 characters that printed to ConOut. If the length of the formatted Unicode
821 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
822 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
824 @param Format Null-terminated Unicode format string.
825 @param ... VARARG list consumed to process Format.
826 If Format is NULL, then ASSERT().
827 If Format is not aligned on a 16-bit boundary, then ASSERT().
829 @return Number of Unicode characters printed to ConOut.
835 IN CONST CHAR16
*Format
,
840 Prints a formatted Unicode string to the console output device specified by
841 StdErr defined in the EFI_SYSTEM_TABLE.
843 This function prints a formatted Unicode string to the console output device
844 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
845 characters that printed to StdErr. If the length of the formatted Unicode
846 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
847 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
849 @param Format Null-terminated Unicode format string.
850 @param ... VARARG list consumed to process Format.
851 If Format is NULL, then ASSERT().
852 If Format is not aligned on a 16-bit boundary, then ASSERT().
854 @return Number of Unicode characters printed to StdErr.
860 IN CONST CHAR16
*Format
,
865 Prints a formatted ASCII string to the console output device specified by
866 ConOut defined in the EFI_SYSTEM_TABLE.
868 This function prints a formatted ASCII string to the console output device
869 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
870 characters that printed to ConOut. If the length of the formatted ASCII
871 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
872 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
874 @param Format Null-terminated ASCII format string.
875 @param ... VARARG list consumed to process Format.
876 If Format is NULL, then ASSERT().
877 If Format is not aligned on a 16-bit boundary, then ASSERT().
879 @return Number of ASCII characters printed to ConOut.
885 IN CONST CHAR8
*Format
,
890 Prints a formatted ASCII string to the console output device specified by
891 StdErr defined in the EFI_SYSTEM_TABLE.
893 This function prints a formatted ASCII string to the console output device
894 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
895 characters that printed to StdErr. If the length of the formatted ASCII
896 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
897 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
899 @param Format Null-terminated ASCII format string.
900 @param ... VARARG list consumed to process Format.
901 If Format is NULL, then ASSERT().
902 If Format is not aligned on a 16-bit boundary, then ASSERT().
904 @return Number of ASCII characters printed to ConErr.
910 IN CONST CHAR8
*Format
,
915 Initializes a driver by installing the Driver Binding Protocol onto the driver's
916 DriverBindingHandle. This is typically the same as the driver's ImageHandle, but
917 it can be different if the driver produces multiple DriverBinding Protocols.
918 If the Driver Binding Protocol interface is NULL, then ASSERT ().
919 If the installation fails, then ASSERT ().
921 @param ImageHandle The image handle of the driver.
922 @param SystemTable The EFI System Table that was passed to the driver's entry point.
923 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
924 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
925 parameter is NULL, then a new handle is created.
927 @retval EFI_SUCCESS The protocol installation is completed successfully.
928 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
933 EfiLibInstallDriverBinding (
934 IN CONST EFI_HANDLE ImageHandle
,
935 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
936 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
937 IN EFI_HANDLE DriverBindingHandle
942 Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name,
943 Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle. This is
944 typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple
945 DriverBinding Protocols.
946 If the Driver Binding Protocol interface is NULL, then ASSERT ().
947 If the installation fails, then ASSERT ().
949 @param ImageHandle The image handle of the driver.
950 @param SystemTable The EFI System Table that was passed to the driver's entry point.
951 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
952 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
953 parameter is NULL, then a new handle is created.
954 @param ComponentName A Component Name Protocol instance that this driver is producing.
955 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
956 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
958 @retval EFI_SUCCESS The protocol installation is completed successfully.
959 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
964 EfiLibInstallAllDriverProtocols (
965 IN CONST EFI_HANDLE ImageHandle
,
966 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
967 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
968 IN EFI_HANDLE DriverBindingHandle
,
969 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
970 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
971 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics OPTIONAL
977 Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name,
978 Component Name 2 onto the driver's DriverBindingHandle. This is typically the same as the driver's
979 ImageHandle, but it can be different if the driver produces multiple DriverBinding Protocols.
980 If the Driver Binding Protocol interface is NULL, then ASSERT ().
981 If the installation fails, then ASSERT ().
983 @param ImageHandle The image handle of the driver.
984 @param SystemTable The EFI System Table that was passed to the driver's entry point.
985 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
986 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
987 parameter is NULL, then a new handle is created.
988 @param ComponentName A Component Name Protocol instance that this driver is producing.
989 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
991 @retval EFI_SUCCESS The protocol installation is completed successfully.
992 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
997 EfiLibInstallDriverBindingComponentName2 (
998 IN CONST EFI_HANDLE ImageHandle
,
999 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
1000 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
1001 IN EFI_HANDLE DriverBindingHandle
,
1002 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
1003 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2 OPTIONAL
1008 Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,
1009 Component Name 2, Driver Configure, Driver Diagnostic and Driver Diagnostic 2 Protocols onto the driver's
1010 DriverBindingHandle. This is typically the same as the driver's ImageHandle, but it can be different if
1011 the driver produces multiple DriverBinding Protocols.
1012 If the Drvier Binding Protocol interface is NULL, then ASSERT ().
1013 If the installation fails, then ASSERT ().
1015 @param ImageHandle The image handle of the driver.
1016 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1017 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1018 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
1019 parameter is NULL, then a new handle is created.
1020 @param ComponentName A Component Name Protocol instance that this driver is producing.
1021 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
1022 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
1023 @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver is producing.
1024 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
1025 @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.
1027 @retval EFI_SUCCESS The protocol installation is completed successfully.
1028 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
1033 EfiLibInstallAllDriverProtocols2 (
1034 IN CONST EFI_HANDLE ImageHandle
,
1035 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
1036 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
1037 IN EFI_HANDLE DriverBindingHandle
,
1038 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
1039 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2
, OPTIONAL
1040 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
1041 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration2
, OPTIONAL
1042 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics
, OPTIONAL
1043 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL
*DriverDiagnostics2 OPTIONAL
1047 Determine what is the current language setting. The space reserved for Lang
1048 must be at least RFC_3066_ENTRY_SIZE bytes;
1050 If Lang is NULL, then ASSERT.
1052 @param Lang Pointer of system language. Lang will always be filled with
1053 a valid RFC 3066 language string. If "PlatformLang" is not
1054 set in the system, the default language specifed by PcdUefiVariableDefaultPlatformLang
1057 @return EFI_SUCCESS If the EFI Variable with "PlatformLang" is set and return in Lang.
1058 @return EFI_NOT_FOUND If the EFI Variable with "PlatformLang" is not set, but a valid default language is return in Lang.
1063 GetCurrentLanguage (