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>
33 /// Unicode String Table
37 CHAR16
*UnicodeString
;
38 } EFI_UNICODE_STRING_TABLE
;
44 EfiLockUninitialized
= 0,
60 This function searches the list of configuration tables stored in the EFI System
61 Table for a table with a GUID that matches TableGuid. If a match is found,
62 then a pointer to the configuration table is returned in Table, and EFI_SUCCESS
63 is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned.
65 @param TableGuid Pointer to table's GUID type..
66 @param Table Pointer to the table associated with TableGuid in the EFI System Table.
68 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
69 @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
74 EfiGetSystemConfigurationTable (
75 IN EFI_GUID
*TableGuid
,
80 This function causes the notification function to be executed for every protocol
81 of type ProtocolGuid instance that exists in the system when this function is
82 invoked. In addition, every time a protocol of type ProtocolGuid instance is
83 installed or reinstalled, the notification function is also executed.
85 @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
86 @param NotifyTpl Supplies the task priority level of the event notifications.
87 @param NotifyFunction Supplies the function to notify when the event is signaled.
88 @param NotifyContext The context parameter to pass to NotifyFunction.
89 @param Registration A pointer to a memory location to receive the registration value.
91 @return The notification event that was created.
96 EfiCreateProtocolNotifyEvent(
97 IN EFI_GUID
*ProtocolGuid
,
99 IN EFI_EVENT_NOTIFY NotifyFunction
,
100 IN VOID
*NotifyContext
, OPTIONAL
101 OUT VOID
**Registration
105 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
106 This event is signaled with EfiNamedEventSignal(). This provide the ability for
107 one or more listeners on the same event named by the GUID specified by Name.
109 @param Name Supplies GUID name of the event.
110 @param NotifyTpl Supplies the task priority level of the event notifications.
111 @param NotifyFunction Supplies the function to notify when the event is signaled.
112 @param NotifyContext The context parameter to pass to NotifyFunction.
113 @param Registration A pointer to a memory location to receive the registration value.
115 @retval EFI_SUCCESS A named event was created.
116 @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.
121 EfiNamedEventListen (
122 IN CONST EFI_GUID
*Name
,
123 IN EFI_TPL NotifyTpl
,
124 IN EFI_EVENT_NOTIFY NotifyFunction
,
125 IN CONST VOID
*NotifyContext
, OPTIONAL
126 OUT VOID
*Registration OPTIONAL
130 This function signals the named event specified by Name. The named event must
131 have been created with EfiNamedEventListen().
133 @param Name Supplies GUID name of the event.
135 @retval EFI_SUCCESS A named event was signaled.
136 @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.
141 EfiNamedEventSignal (
142 IN CONST EFI_GUID
*Name
146 Returns the current TPL.
148 This function returns the current TPL. There is no EFI service to directly
149 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
150 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
151 can then immediately be restored back to the current TPL level with a call
154 @return The current TPL.
164 This function initializes a basic mutual exclusion lock to the released state
165 and returns the lock. Each lock provides mutual exclusion access at its task
166 priority level. Since there is no preemption or multiprocessor support in EFI,
167 acquiring the lock only consists of raising to the locks TPL.
169 @param Lock A pointer to the lock data structure to initialize.
170 @param Priority EFI TPL associated with the lock.
178 IN OUT EFI_LOCK
*Lock
,
183 This macro initializes the contents of a basic mutual exclusion lock to the
184 released state. Each lock provides mutual exclusion access at its task
185 priority level. Since there is no preemption or multiprocessor support in EFI,
186 acquiring the lock only consists of raising to the locks TPL.
188 @param Priority The task priority level of the lock.
193 #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \
194 {Priority, TPL_APPLICATION, EfiLockReleased }
199 Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
201 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
202 then this macro evaluates the EFI_LOCK structure specified by Lock. If Lock
203 is not in the locked state, then DebugAssert() is called passing in the source
204 filename, source line number, and Lock.
206 If Lock is NULL, then ASSERT().
208 @param LockParameter A pointer to the lock to acquire.
211 #define ASSERT_LOCKED(LockParameter) \
213 if (DebugAssertEnabled ()) { \
214 ASSERT (LockParameter != NULL); \
215 if ((LockParameter)->Lock != EfiLockAcquired) { \
216 _ASSERT (LockParameter not locked); \
223 This function raises the system's current task priority level to the task
224 priority level of the mutual exclusion lock. Then, it places the lock in the
227 @param Lock A pointer to the lock to acquire.
237 This function raises the system's current task priority level to the task
238 priority level of the mutual exclusion lock. Then, it attempts to place the
239 lock in the acquired state.
241 @param Lock A pointer to the lock to acquire.
243 @retval EFI_SUCCESS The lock was acquired.
244 @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
249 EfiAcquireLockOrFail (
254 This function transitions a mutual exclusion lock from the acquired state to
255 the released state, and restores the system's task priority level to its
258 @param Lock A pointer to the lock to release.
268 Tests whether a controller handle is being managed by a specific driver.
270 This function tests whether the driver specified by DriverBindingHandle is
271 currently managing the controller specified by ControllerHandle. This test
272 is performed by evaluating if the the protocol specified by ProtocolGuid is
273 present on ControllerHandle and is was opened by DriverBindingHandle with an
274 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
275 If ProtocolGuid is NULL, then ASSERT().
277 @param ControllerHandle A handle for a controller to test.
278 @param DriverBindingHandle Specifies the driver binding handle for the
280 @param ProtocolGuid Specifies the protocol that the driver specified
281 by DriverBindingHandle opens in its Start()
284 @retval EFI_SUCCESS ControllerHandle is managed by the driver
285 specifed by DriverBindingHandle.
286 @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
287 specifed by DriverBindingHandle.
292 EfiTestManagedDevice (
293 IN CONST EFI_HANDLE ControllerHandle
,
294 IN CONST EFI_HANDLE DriverBindingHandle
,
295 IN CONST EFI_GUID
*ProtocolGuid
299 Tests whether a child handle is a child device of the controller.
301 This function tests whether ChildHandle is one of the children of
302 ControllerHandle. This test is performed by checking to see if the protocol
303 specified by ProtocolGuid is present on ControllerHandle and opened by
304 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
305 If ProtocolGuid is NULL, then ASSERT().
307 @param ControllerHandle A handle for a (parent) controller to test.
308 @param ChildHandle A child handle to test.
309 @param ProtocolGuid Supplies the protocol that the child controller
310 opens on its parent controller.
312 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
313 @retval EFI_UNSUPPORTED ChildHandle is not a child of the
320 IN CONST EFI_HANDLE ControllerHandle
,
321 IN CONST EFI_HANDLE ChildHandle
,
322 IN CONST EFI_GUID
*ProtocolGuid
326 This function looks up a Unicode string in UnicodeStringTable. If Language is
327 a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable
328 that matches the language code specified by Language, then it is returned in
331 @param Language A pointer to the ISO 639-2 language code for the
332 Unicode string to look up and return.
333 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
334 that the Unicode string table supports. Language
335 must be a member of this set.
336 @param UnicodeStringTable A pointer to the table of Unicode strings.
337 @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
338 that matches the language specified by Language.
340 @retval EFI_SUCCESS The Unicode string that matches the language
341 specified by Language was found
342 in the table of Unicoide strings UnicodeStringTable,
343 and it was returned in UnicodeString.
344 @retval EFI_INVALID_PARAMETER Language is NULL.
345 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
346 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
347 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
348 @retval EFI_UNSUPPORTED The language specified by Language is not a
349 member of SupportedLanguages.
350 @retval EFI_UNSUPPORTED The language specified by Language is not
351 supported by UnicodeStringTable.
356 LookupUnicodeString (
357 IN CONST CHAR8
*Language
,
358 IN CONST CHAR8
*SupportedLanguages
,
359 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
360 OUT CHAR16
**UnicodeString
364 This function looks up a Unicode string in UnicodeStringTable.
365 If Language is a member of SupportedLanguages and a Unicode
366 string is found in UnicodeStringTable that matches the
367 language code specified by Language, then it is returned in
370 @param Language A pointer to the ISO 639-2 or
371 RFC 3066 language code for the
372 Unicode string to look up and
375 @param SupportedLanguages A pointer to the set of ISO
376 639-2 or RFC 3066 language
377 codes that the Unicode string
378 table supports. Language must
379 be a member of this set.
381 @param UnicodeStringTable A pointer to the table of
384 @param UnicodeString A pointer to the Unicode
385 string from UnicodeStringTable
386 that matches the language
387 specified by Language.
389 @param Iso639Language Specify the language code
390 format supported. If true,
391 then the format follow ISO
392 639-2. If false, then it
395 @retval EFI_SUCCESS The Unicode string that
396 matches the language specified
397 by Language was found in the
398 table of Unicoide strings
399 UnicodeStringTable, and it was
400 returned in UnicodeString.
402 @retval EFI_INVALID_PARAMETER Language is NULL.
404 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
406 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
408 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
410 @retval EFI_UNSUPPORTED The language specified by
411 Language is not a member
412 ofSupportedLanguages.
414 @retval EFI_UNSUPPORTED The language specified by
415 Language is not supported by
421 LookupUnicodeString2 (
422 IN CONST CHAR8
*Language
,
423 IN CONST CHAR8
*SupportedLanguages
,
424 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
425 OUT CHAR16
**UnicodeString
,
426 IN BOOLEAN Iso639Language
430 This function adds a Unicode string to UnicodeStringTable.
431 If Language is a member of SupportedLanguages then UnicodeString is added to
432 UnicodeStringTable. New buffers are allocated for both Language and
433 UnicodeString. The contents of Language and UnicodeString are copied into
434 these new buffers. These buffers are automatically freed when
435 FreeUnicodeStringTable() is called.
437 @param Language A pointer to the ISO 639-2 language code for the Unicode
439 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
440 that the Unicode string table supports.
441 Language must be a member of this set.
442 @param UnicodeStringTable A pointer to the table of Unicode strings.
443 @param UnicodeString A pointer to the Unicode string to add.
445 @retval EFI_SUCCESS The Unicode string that matches the language
446 specified by Language was found in the table of
447 Unicode strings UnicodeStringTable, and it was
448 returned in UnicodeString.
449 @retval EFI_INVALID_PARAMETER Language is NULL.
450 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
451 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
452 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
453 @retval EFI_ALREADY_STARTED A Unicode string with language Language is
454 already present in UnicodeStringTable.
455 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
456 Unicode string to UnicodeStringTable.
457 @retval EFI_UNSUPPORTED The language specified by Language is not a
458 member of SupportedLanguages.
464 IN CONST CHAR8
*Language
,
465 IN CONST CHAR8
*SupportedLanguages
,
466 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
467 IN CONST CHAR16
*UnicodeString
472 This function adds a Unicode string to UnicodeStringTable.
473 If Language is a member of SupportedLanguages then
474 UnicodeString is added to UnicodeStringTable. New buffers are
475 allocated for both Language and UnicodeString. The contents
476 of Language and UnicodeString are copied into these new
477 buffers. These buffers are automatically freed when
478 FreeUnicodeStringTable() is called.
480 @param Language A pointer to the ISO 639-2 or
481 RFC 3066 language code for the
482 Unicode string to add.
484 @param SupportedLanguages A pointer to the set of ISO
485 639-2 or RFC 3066 language
486 codes that the Unicode string
487 table supports. Language must
488 be a member of this set.
490 @param UnicodeStringTable A pointer to the table of
493 @param UnicodeString A pointer to the Unicode
496 @param Iso639Language Specify the language code
497 format supported. If true,
498 then the format follow ISO
499 639-2. If false, then it
502 @retval EFI_SUCCESS The Unicode string that
503 matches the language specified
504 by Language was found in the
505 table of Unicode strings
506 UnicodeStringTable, and it was
507 returned in UnicodeString.
509 @retval EFI_INVALID_PARAMETER Language is NULL.
511 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
513 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
515 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
517 @retval EFI_ALREADY_STARTED A Unicode string with language
518 Language is already present in
521 @retval EFI_OUT_OF_RESOURCES There is not enough memory to
522 add another Unicode string to
525 @retval EFI_UNSUPPORTED The language specified by
526 Language is not a member of
533 IN CONST CHAR8
*Language
,
534 IN CONST CHAR8
*SupportedLanguages
,
535 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
536 IN CONST CHAR16
*UnicodeString
,
537 IN BOOLEAN Iso639Language
541 This function frees the table of Unicode strings in UnicodeStringTable.
542 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
543 Otherwise, each language code, and each Unicode string in the Unicode string
544 table are freed, and EFI_SUCCESS is returned.
546 @param UnicodeStringTable A pointer to the table of Unicode strings.
548 @retval EFI_SUCCESS The Unicode string table was freed.
553 FreeUnicodeStringTable (
554 IN EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
558 This function computes and returns the width of the Unicode character
559 specified by UnicodeChar.
561 @param UnicodeChar A Unicode character.
563 @retval 0 The width if UnicodeChar could not be determined.
564 @retval 1 UnicodeChar is a narrow glyph.
565 @retval 2 UnicodeChar is a wide glyph.
571 IN CHAR16 UnicodeChar
575 This function computes and returns the display length of
576 the Null-terminated Unicode string specified by String.
577 If String is NULL, then 0 is returned.
578 If any of the widths of the Unicode characters in String
579 can not be determined, then 0 is returned.
581 @param String A pointer to a Null-terminated Unicode string.
583 @return The display length of the Null-terminated Unicode string specified by String.
588 UnicodeStringDisplayLength (
589 IN CONST CHAR16
*String
593 // Functions that abstract early Framework contamination of UEFI.
596 Signal a Ready to Boot Event.
598 Create a Ready to Boot Event. Signal it and close it. This causes other
599 events of the same event group to be signaled in other modules.
604 EfiSignalEventReadyToBoot (
609 Signal a Legacy Boot Event.
611 Create a legacy Boot Event. Signal it and close it. This causes other
612 events of the same event group to be signaled in other modules.
617 EfiSignalEventLegacyBoot (
622 Creates an EFI event in the Legacy Boot Event Group. Prior to UEFI 2.0 this
623 was done via a non blessed UEFI extensions and this library abstracts the
624 implementation mechanism of this event from the caller.
626 This function abstracts the creation of the Legacy Boot Event. The Framework
627 moved from a proprietary to UEFI 2.0 based mechanism. This library abstracts
628 the caller from how this event is created to prevent to code form having to
629 change with the version of the specification supported.
630 If LegacyBootEvent is NULL, then ASSERT().
632 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
634 @retval EFI_SUCCESS Event was created.
635 @retval Other Event was not created.
640 EfiCreateEventLegacyBoot (
641 OUT EFI_EVENT
*LegacyBootEvent
645 Create an EFI event in the Legacy Boot Event Group and allows
646 the caller to specify a notification function.
648 This function abstracts the creation of the Legacy Boot Event.
649 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
650 This library abstracts the caller from how this event is created to prevent
651 to code form having to change with the version of the specification supported.
652 If LegacyBootEvent is NULL, then ASSERT().
654 @param NotifyTpl The task priority level of the event.
655 @param NotifyFunction The notification function to call when the event is signaled.
656 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
657 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
659 @retval EFI_SUCCESS Event was created.
660 @retval Other Event was not created.
665 EfiCreateEventLegacyBootEx (
666 IN EFI_TPL NotifyTpl
,
667 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
668 IN VOID
*NotifyContext
, OPTIONAL
669 OUT EFI_EVENT
*LegacyBootEvent
673 Create an EFI event in the Ready To Boot Event Group. Prior to UEFI 2.0 this
674 was done via a non-standard UEFI extension, and this library abstracts the
675 implementation mechanism of this event from the caller.
677 This function abstracts the creation of the Ready to Boot Event. The Framework
678 moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts
679 the caller from how this event is created to prevent the code form having to
680 change with the version of the specification supported.
681 If ReadyToBootEvent is NULL, then ASSERT().
683 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
685 @retval EFI_SUCCESS Event was created.
686 @retval Other Event was not created.
691 EfiCreateEventReadyToBoot (
692 OUT EFI_EVENT
*ReadyToBootEvent
696 Create an EFI event in the Ready To Boot Event Group and allows
697 the caller to specify a notification function.
699 This function abstracts the creation of the Ready to Boot Event.
700 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
701 This library abstracts the caller from how this event is created to prevent
702 to code form having to change with the version of the specification supported.
703 If ReadyToBootEvent is NULL, then ASSERT().
705 @param NotifyTpl The task priority level of the event.
706 @param NotifyFunction The notification function to call when the event is signaled.
707 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
708 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
710 @retval EFI_SUCCESS Event was created.
711 @retval Other Event was not created.
716 EfiCreateEventReadyToBootEx (
717 IN EFI_TPL NotifyTpl
,
718 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
719 IN VOID
*NotifyContext
, OPTIONAL
720 OUT EFI_EVENT
*ReadyToBootEvent
724 Initialize a Firmware Volume (FV) Media Device Path node.
726 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
727 This library function abstracts initializing a device path node.
729 Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device
730 path changed in the DXE CIS version 0.92 in a non back ward compatible way to
731 not conflict with the UEFI 2.0 specification. This function abstracts the
732 differences from the caller.
734 If FvDevicePathNode is NULL, then ASSERT().
735 If NameGuid is NULL, then ASSERT().
737 @param FvDevicePathNode Pointer to a FV device path node to initialize
738 @param NameGuid FV file name to use in FvDevicePathNode
743 EfiInitializeFwVolDevicepathNode (
744 IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
,
745 IN CONST EFI_GUID
*NameGuid
749 Check to see if the Firmware Volume (FV) Media Device Path is valid
751 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
752 This library function abstracts validating a device path node.
754 Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid.
755 If it is valid, then return the GUID file name from the device path node. Otherwise,
756 return NULL. This device path changed in the DXE CIS version 0.92 in a non back ward
757 compatible way to not conflict with the UEFI 2.0 specification. This function abstracts
758 the differences from the caller.
759 If FvDevicePathNode is NULL, then ASSERT().
761 @param FvDevicePathNode Pointer to FV device path to check.
763 @retval NULL FvDevicePathNode is not valid.
764 @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
769 EfiGetNameGuidFromFwVolDevicePathNode (
770 IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
774 Prints a formatted Unicode string to the console output device specified by
775 ConOut defined in the EFI_SYSTEM_TABLE.
777 This function prints a formatted Unicode string to the console output device
778 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
779 characters that printed to ConOut. If the length of the formatted Unicode
780 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
781 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
783 @param Format Null-terminated Unicode format string.
784 @param ... VARARG list consumed to process Format.
785 If Format is NULL, then ASSERT().
786 If Format is not aligned on a 16-bit boundary, then ASSERT().
788 @return Number of Unicode characters printed to ConOut.
794 IN CONST CHAR16
*Format
,
799 Prints a formatted Unicode string to the console output device specified by
800 StdErr defined in the EFI_SYSTEM_TABLE.
802 This function prints a formatted Unicode string to the console output device
803 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
804 characters that printed to StdErr. If the length of the formatted Unicode
805 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
806 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
808 @param Format Null-terminated Unicode format string.
809 @param ... VARARG list consumed to process Format.
810 If Format is NULL, then ASSERT().
811 If Format is not aligned on a 16-bit boundary, then ASSERT().
813 @return Number of Unicode characters printed to StdErr.
819 IN CONST CHAR16
*Format
,
824 Prints a formatted ASCII string to the console output device specified by
825 ConOut defined in the EFI_SYSTEM_TABLE.
827 This function prints a formatted ASCII string to the console output device
828 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
829 characters that printed to ConOut. If the length of the formatted ASCII
830 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
831 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
833 @param Format Null-terminated ASCII format string.
834 @param ... VARARG list consumed to process Format.
835 If Format is NULL, then ASSERT().
836 If Format is not aligned on a 16-bit boundary, then ASSERT().
838 @return Number of ASCII characters printed to ConOut.
844 IN CONST CHAR8
*Format
,
849 Prints a formatted ASCII string to the console output device specified by
850 StdErr defined in the EFI_SYSTEM_TABLE.
852 This function prints a formatted ASCII string to the console output device
853 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
854 characters that printed to StdErr. If the length of the formatted ASCII
855 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
856 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
858 @param Format Null-terminated ASCII format string.
859 @param ... VARARG list consumed to process Format.
860 If Format is NULL, then ASSERT().
861 If Format is not aligned on a 16-bit boundary, then ASSERT().
863 @return Number of ASCII characters printed to ConErr.
869 IN CONST CHAR8
*Format
,
874 Initializes a driver by installing the Driver Binding Protocol onto the driver's
875 DriverBindingHandle. This is typically the same as the driver's ImageHandle, but
876 it can be different if the driver produces multiple DriverBinding Protocols.
877 If the Driver Binding Protocol interface is NULL, then ASSERT ().
878 If the installation fails, then ASSERT ().
880 @param ImageHandle The image handle of the driver.
881 @param SystemTable The EFI System Table that was passed to the driver's entry point.
882 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
883 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
884 parameter is NULL, then a new handle is created.
886 @retval EFI_SUCCESS The protocol installation is completed successfully.
887 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
892 EfiLibInstallDriverBinding (
893 IN CONST EFI_HANDLE ImageHandle
,
894 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
895 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
896 IN EFI_HANDLE DriverBindingHandle
901 Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name,
902 Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle. This is
903 typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple
904 DriverBinding Protocols.
905 If the Driver Binding Protocol interface is NULL, then ASSERT ().
906 If the installation fails, then ASSERT ().
908 @param ImageHandle The image handle of the driver.
909 @param SystemTable The EFI System Table that was passed to the driver's entry point.
910 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
911 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
912 parameter is NULL, then a new handle is created.
913 @param ComponentName A Component Name Protocol instance that this driver is producing.
914 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
915 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
917 @retval EFI_SUCCESS The protocol installation is completed successfully.
918 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
923 EfiLibInstallAllDriverProtocols (
924 IN CONST EFI_HANDLE ImageHandle
,
925 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
926 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
927 IN EFI_HANDLE DriverBindingHandle
,
928 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
929 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
930 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics OPTIONAL
936 Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name,
937 Component Name 2 onto the driver's DriverBindingHandle. This is typically the same as the driver's
938 ImageHandle, but it can be different if the driver produces multiple DriverBinding Protocols.
939 If the Driver Binding Protocol interface is NULL, then ASSERT ().
940 If the installation fails, then ASSERT ().
942 @param ImageHandle The image handle of the driver.
943 @param SystemTable The EFI System Table that was passed to the driver's entry point.
944 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
945 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
946 parameter is NULL, then a new handle is created.
947 @param ComponentName A Component Name Protocol instance that this driver is producing.
948 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
950 @retval EFI_SUCCESS The protocol installation is completed successfully.
951 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
956 EfiLibInstallDriverBindingComponentName2 (
957 IN CONST EFI_HANDLE ImageHandle
,
958 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
959 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
960 IN EFI_HANDLE DriverBindingHandle
,
961 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
962 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2 OPTIONAL
967 Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,
968 Component Name 2, Driver Configure, Driver Diagnostic and Driver Diagnostic 2 Protocols onto the driver's
969 DriverBindingHandle. This is typically the same as the driver's ImageHandle, but it can be different if
970 the driver produces multiple DriverBinding Protocols.
971 If the Drvier Binding Protocol interface is NULL, then ASSERT ().
972 If the installation fails, then ASSERT ().
974 @param ImageHandle The image handle of the driver.
975 @param SystemTable The EFI System Table that was passed to the driver's entry point.
976 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
977 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
978 parameter is NULL, then a new handle is created.
979 @param ComponentName A Component Name Protocol instance that this driver is producing.
980 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
981 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
982 @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver is producing.
983 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
984 @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.
986 @retval EFI_SUCCESS The protocol installation is completed successfully.
987 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
992 EfiLibInstallAllDriverProtocols2 (
993 IN CONST EFI_HANDLE ImageHandle
,
994 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
995 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
996 IN EFI_HANDLE DriverBindingHandle
,
997 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
998 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2
, OPTIONAL
999 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
1000 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration2
, OPTIONAL
1001 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics
, OPTIONAL
1002 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL
*DriverDiagnostics2 OPTIONAL
1006 Determine what is the current language setting. The space reserved for Lang
1007 must be at least RFC_3066_ENTRY_SIZE bytes;
1009 If Lang is NULL, then ASSERT.
1011 @param Lang Pointer of system language. Lang will always be filled with
1012 a valid RFC 3066 language string. If "PlatformLang" is not
1013 set in the system, the default language specifed by PcdUefiVariableDefaultPlatformLang
1016 @return EFI_SUCCESS If the EFI Variable with "PlatformLang" is set and return in Lang.
1017 @return EFI_NOT_FOUND If the EFI Variable with "PlatformLang" is not set, but a valid default language is return in Lang.
1022 GetCurrentLanguage (