2 MDE UEFI library functions and macros
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __UEFI_LIB_H__
16 #define __UEFI_LIB_H__
18 #include <Protocol/DriverBinding.h>
19 #include <Protocol/DriverConfiguration.h>
20 #include <Protocol/ComponentName.h>
21 #include <Protocol/ComponentName2.h>
22 #include <Protocol/DriverDiagnostics.h>
23 #include <Protocol/DriverDiagnostics2.h>
26 // Unicode String Table
30 CHAR16
*UnicodeString
;
31 } EFI_UNICODE_STRING_TABLE
;
37 EfiLockUninitialized
= 0,
53 This function searches the list of configuration tables stored in the EFI System
54 Table for a table with a GUID that matches TableGuid. If a match is found,
55 then a pointer to the configuration table is returned in Table, and EFI_SUCCESS
56 is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned.
58 @param TableGuid Pointer to table's GUID type..
59 @param Table Pointer to the table associated with TableGuid in the EFI System Table.
61 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
62 @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
67 EfiGetSystemConfigurationTable (
68 IN EFI_GUID
*TableGuid
,
73 This function causes the notification function to be executed for every protocol
74 of type ProtocolGuid instance that exists in the system when this function is
75 invoked. In addition, every time a protocol of type ProtocolGuid instance is
76 installed or reinstalled, the notification function is also executed.
78 @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
79 @param NotifyTpl Supplies the task priority level of the event notifications.
80 @param NotifyFunction Supplies the function to notify when the event is signaled.
81 @param NotifyContext The context parameter to pass to NotifyFunction.
82 @param Registration A pointer to a memory location to receive the registration value.
84 @return The notification event that was created.
89 EfiCreateProtocolNotifyEvent(
90 IN EFI_GUID
*ProtocolGuid
,
92 IN EFI_EVENT_NOTIFY NotifyFunction
,
93 IN VOID
*NotifyContext
, OPTIONAL
94 OUT VOID
**Registration
98 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
99 This event is signaled with EfiNamedEventSignal(). This provide the ability for
100 one or more listeners on the same event named by the GUID specified by Name.
102 @param Name Supplies GUID name of the event.
103 @param NotifyTpl Supplies the task priority level of the event notifications.
104 @param NotifyFunction Supplies the function to notify when the event is signaled.
105 @param NotifyContext The context parameter to pass to NotifyFunction.
106 @param Registration A pointer to a memory location to receive the registration value.
108 @retval EFI_SUCCESS A named event was created.
109 @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.
114 EfiNamedEventListen (
115 IN CONST EFI_GUID
*Name
,
116 IN EFI_TPL NotifyTpl
,
117 IN EFI_EVENT_NOTIFY NotifyFunction
,
118 IN CONST VOID
*NotifyContext
, OPTIONAL
119 OUT VOID
*Registration OPTIONAL
123 This function signals the named event specified by Name. The named event must
124 have been created with EfiNamedEventListen().
126 @param Name Supplies GUID name of the event.
128 @retval EFI_SUCCESS A named event was signaled.
129 @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.
134 EfiNamedEventSignal (
135 IN CONST EFI_GUID
*Name
139 Returns the current TPL.
141 This function returns the current TPL. There is no EFI service to directly
142 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
143 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
144 can then immediately be restored back to the current TPL level with a call
149 @retvale EFI_TPL The current TPL.
159 This function initializes a basic mutual exclusion lock to the released state
160 and returns the lock. Each lock provides mutual exclusion access at its task
161 priority level. Since there is no preemption or multiprocessor support in EFI,
162 acquiring the lock only consists of raising to the locks TPL.
164 @param Lock A pointer to the lock data structure to initialize.
165 @param Priority EFI TPL associated with the lock.
173 IN OUT EFI_LOCK
*Lock
,
178 This macro initializes the contents of a basic mutual exclusion lock to the
179 released state. Each lock provides mutual exclusion access at its task
180 priority level. Since there is no preemption or multiprocessor support in EFI,
181 acquiring the lock only consists of raising to the locks TPL.
183 @param Lock A pointer to the lock data structure to initialize.
184 @param Priority The task priority level of the lock.
189 #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \
190 {Priority, TPL_APPLICATION, EfiLockReleased }
195 Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
197 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
198 then this macro evaluates the EFI_LOCK structure specified by Lock. If Lock
199 is not in the locked state, then DebugAssert() is called passing in the source
200 filename, source line number, and Lock.
202 If Lock is NULL, then ASSERT().
204 @param LockParameter A pointer to the lock to acquire.
207 #define ASSERT_LOCKED(LockParameter) \
209 if (DebugAssertEnabled ()) { \
210 ASSERT (LockParameter != NULL); \
211 if ((LockParameter)->Lock != EfiLockAcquired) { \
212 _ASSERT (LockParameter not locked); \
219 This function raises the system's current task priority level to the task
220 priority level of the mutual exclusion lock. Then, it places the lock in the
223 @param Priority The task priority level of the lock.
233 This function raises the system's current task priority level to the task
234 priority level of the mutual exclusion lock. Then, it attempts to place the
235 lock in the acquired state.
237 @param Lock A pointer to the lock to acquire.
239 @retval EFI_SUCCESS The lock was acquired.
240 @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
245 EfiAcquireLockOrFail (
250 This function transitions a mutual exclusion lock from the acquired state to
251 the released state, and restores the system's task priority level to its
254 @param Lock A pointer to the lock to release.
264 Tests whether a controller handle is being managed by a specific driver.
266 This function tests whether the driver specified by DriverBindingHandle is
267 currently managing the controller specified by ControllerHandle. This test
268 is performed by evaluating if the the protocol specified by ProtocolGuid is
269 present on ControllerHandle and is was opened by DriverBindingHandle with an
270 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
271 If ProtocolGuid is NULL, then ASSERT().
273 @param ControllerHandle A handle for a controller to test.
274 @param DriverBindingHandle Specifies the driver binding handle for the
276 @param ProtocolGuid Specifies the protocol that the driver specified
277 by DriverBindingHandle opens in its Start()
280 @retval EFI_SUCCESS ControllerHandle is managed by the driver
281 specifed by DriverBindingHandle.
282 @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
283 specifed by DriverBindingHandle.
288 EfiTestManagedDevice (
289 IN CONST EFI_HANDLE ControllerHandle
,
290 IN CONST EFI_HANDLE DriverBindingHandle
,
291 IN CONST EFI_GUID
*ProtocolGuid
295 Tests whether a child handle is a child device of the controller.
297 This function tests whether ChildHandle is one of the children of
298 ControllerHandle. This test is performed by checking to see if the protocol
299 specified by ProtocolGuid is present on ControllerHandle and opened by
300 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
301 If ProtocolGuid is NULL, then ASSERT().
303 @param ControllerHandle A handle for a (parent) controller to test.
304 @param ChildHandle A child handle to test.
305 @param ConsumsedGuid Supplies the protocol that the child controller
306 opens on its parent controller.
308 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
309 @retval EFI_UNSUPPORTED ChildHandle is not a child of the
316 IN CONST EFI_HANDLE ControllerHandle
,
317 IN CONST EFI_HANDLE ChildHandle
,
318 IN CONST EFI_GUID
*ProtocolGuid
322 This function looks up a Unicode string in UnicodeStringTable. If Language is
323 a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable
324 that matches the language code specified by Language, then it is returned in
327 @param Language A pointer to the ISO 639-2 language code for the
328 Unicode string to look up and return.
329 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
330 that the Unicode string table supports. Language
331 must be a member of this set.
332 @param UnicodeStringTable A pointer to the table of Unicode strings.
333 @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
334 that matches the language specified by Language.
336 @retval EFI_SUCCESS The Unicode string that matches the language
337 specified by Language was found
338 in the table of Unicoide strings UnicodeStringTable,
339 and it was returned in UnicodeString.
340 @retval EFI_INVALID_PARAMETER Language is NULL.
341 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
342 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
343 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
344 @retval EFI_UNSUPPORTED The language specified by Language is not a
345 member of SupportedLanguages.
346 @retval EFI_UNSUPPORTED The language specified by Language is not
347 supported by UnicodeStringTable.
352 LookupUnicodeString (
353 IN CONST CHAR8
*Language
,
354 IN CONST CHAR8
*SupportedLanguages
,
355 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
356 OUT CHAR16
**UnicodeString
360 This function looks up a Unicode string in UnicodeStringTable.
361 If Language is a member of SupportedLanguages and a Unicode
362 string is found in UnicodeStringTable that matches the
363 language code specified by Language, then it is returned in
366 @param Language A pointer to the ISO 639-2 or
367 RFC 3066 language code for the
368 Unicode string to look up and
371 @param SupportedLanguages A pointer to the set of ISO
372 639-2 or RFC 3066 language
373 codes that the Unicode string
374 table supports. Language must
375 be a member of this set.
377 @param UnicodeStringTable A pointer to the table of
380 @param UnicodeString A pointer to the Unicode
381 string from UnicodeStringTable
382 that matches the language
383 specified by Language.
385 @param Iso639Language Specify the language code
386 format supported. If true,
387 then the format follow ISO
388 639-2. If false, then it
391 @retval EFI_SUCCESS The Unicode string that
392 matches the language specified
393 by Language was found in the
394 table of Unicoide strings
395 UnicodeStringTable, and it was
396 returned in UnicodeString.
398 @retval EFI_INVALID_PARAMETER Language is NULL.
400 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
402 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
404 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
406 @retval EFI_UNSUPPORTED The language specified by
407 Language is not a member
408 ofSupportedLanguages.
410 @retval EFI_UNSUPPORTED The language specified by
411 Language is not supported by
417 LookupUnicodeString2 (
418 IN CONST CHAR8
*Language
,
419 IN CONST CHAR8
*SupportedLanguages
,
420 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
421 OUT CHAR16
**UnicodeString
,
422 IN BOOLEAN Iso639Language
427 This function adds a Unicode string to UnicodeStringTable.
428 If Language is a member of SupportedLanguages then UnicodeString is added to
429 UnicodeStringTable. New buffers are allocated for both Language and
430 UnicodeString. The contents of Language and UnicodeString are copied into
431 these new buffers. These buffers are automatically freed when
432 FreeUnicodeStringTable() is called.
434 @param Language A pointer to the ISO 639-2 language code for the Unicode
436 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
437 that the Unicode string table supports.
438 Language must be a member of this set.
439 @param UnicodeStringTable A pointer to the table of Unicode strings.
440 @param UnicodeString A pointer to the Unicode string to add.
442 @retval EFI_SUCCESS The Unicode string that matches the language
443 specified by Language was found in the table of
444 Unicode strings UnicodeStringTable, and it was
445 returned in UnicodeString.
446 @retval EFI_INVALID_PARAMETER Language is NULL.
447 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
448 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
449 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
450 @retval EFI_ALREADY_STARTED A Unicode string with language Language is
451 already present in UnicodeStringTable.
452 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
453 Unicode string to UnicodeStringTable.
454 @retval EFI_UNSUPPORTED The language specified by Language is not a
455 member of SupportedLanguages.
461 IN CONST CHAR8
*Language
,
462 IN CONST CHAR8
*SupportedLanguages
,
463 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
464 IN CONST CHAR16
*UnicodeString
469 This function adds a Unicode string to UnicodeStringTable.
470 If Language is a member of SupportedLanguages then
471 UnicodeString is added to UnicodeStringTable. New buffers are
472 allocated for both Language and UnicodeString. The contents
473 of Language and UnicodeString are copied into these new
474 buffers. These buffers are automatically freed when
475 FreeUnicodeStringTable() is called.
477 @param Language A pointer to the ISO 639-2 or
478 RFC 3066 language code for the
479 Unicode string to add.
481 @param SupportedLanguages A pointer to the set of ISO
482 639-2 or RFC 3066 language
483 codes that the Unicode string
484 table supports. Language must
485 be a member of this set.
487 @param UnicodeStringTable A pointer to the table of
490 @param UnicodeString A pointer to the Unicode
493 @param Iso639Language Specify the language code
494 format supported. If true,
495 then the format follow ISO
496 639-2. If false, then it
499 @retval EFI_SUCCESS The Unicode string that
500 matches the language specified
501 by Language was found in the
502 table of Unicode strings
503 UnicodeStringTable, and it was
504 returned in UnicodeString.
506 @retval EFI_INVALID_PARAMETER Language is NULL.
508 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
510 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
512 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
514 @retval EFI_ALREADY_STARTED A Unicode string with language
515 Language is already present in
518 @retval EFI_OUT_OF_RESOURCES There is not enough memory to
519 add another Unicode string to
522 @retval EFI_UNSUPPORTED The language specified by
523 Language is not a member of
530 IN CONST CHAR8
*Language
,
531 IN CONST CHAR8
*SupportedLanguages
,
532 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
533 IN CONST CHAR16
*UnicodeString
,
534 IN BOOLEAN Iso639Language
539 This function frees the table of Unicode strings in UnicodeStringTable.
540 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
541 Otherwise, each language code, and each Unicode string in the Unicode string
542 table are freed, and EFI_SUCCESS is returned.
544 @param UnicodeStringTable A pointer to the table of Unicode strings.
546 @retval EFI_SUCCESS The Unicode string table was freed.
551 FreeUnicodeStringTable (
552 IN EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
556 This function computes and returns the width of the Unicode character
557 specified by UnicodeChar.
559 @param UnicodeChar A Unicode character.
561 @retval 0 The width if UnicodeChar could not be determined.
562 @retval 1 UnicodeChar is a narrow glyph.
563 @retval 2 UnicodeChar is a wide glyph.
569 IN CHAR16 UnicodeChar
573 This function computes and returns the display length of
574 the Null-terminated Unicode string specified by String.
575 If String is NULL, then 0 is returned.
576 If any of the widths of the Unicode characters in String
577 can not be determined, then 0 is returned.
579 @param String A pointer to a Null-terminated Unicode string.
581 @return The display length of the Null-terminated Unicode string specified by String.
586 UnicodeStringDisplayLength (
587 IN CONST CHAR16
*String
591 // Functions that abstract early Framework contamination of UEFI.
594 Signal a Ready to Boot Event.
596 Create a Ready to Boot Event. Signal it and close it. This causes other
597 events of the same event group to be signaled in other modules.
602 EfiSignalEventReadyToBoot (
607 Signal a Legacy Boot Event.
609 Create a legacy Boot Event. Signal it and close it. This causes other
610 events of the same event group to be signaled in other modules.
615 EfiSignalEventLegacyBoot (
620 Create a Legacy Boot Event.
622 Tiano extended the CreateEvent Type enum to add a legacy boot event type.
623 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
624 added and now it's possible to not voilate the UEFI specification by
625 declaring a GUID for the legacy boot event class. This library supports
626 the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to
629 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
631 @retval EFI_SUCCESS Event was created.
632 @retval Other Event was not created.
637 EfiCreateEventLegacyBoot (
638 OUT EFI_EVENT
*LegacyBootEvent
642 Create an EFI event in the Legacy Boot Event Group and allows
643 the caller to specify a notification function.
645 This function abstracts the creation of the Legacy Boot Event.
646 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
647 This library abstracts the caller from how this event is created to prevent
648 to code form having to change with the version of the specification supported.
649 If LegacyBootEvent is NULL, then ASSERT().
651 @param NotifyTpl The task priority level of the event.
652 @param NotifyFunction The notification function to call when the event is signaled.
653 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
654 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
656 @retval EFI_SUCCESS Event was created.
657 @retval Other Event was not created.
662 EfiCreateEventLegacyBootEx (
663 IN EFI_TPL NotifyTpl
,
664 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
665 IN VOID
*NotifyContext
, OPTIONAL
666 OUT EFI_EVENT
*LegacyBootEvent
670 Create a Read to Boot Event.
672 Tiano extended the CreateEvent Type enum to add a ready to boot event type.
673 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
674 added and now it's possible to not voilate the UEFI specification and use
675 the ready to boot event class defined in UEFI 2.0. This library supports
676 the EDK/EFI 1.10 form and EDKII/UEFI 2.0 form and allows common code to
679 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
681 @retval EFI_SUCCESS Event was created.
682 @retval Other Event was not created.
687 EfiCreateEventReadyToBoot (
688 OUT EFI_EVENT
*ReadyToBootEvent
692 Create an EFI event in the Ready To Boot Event Group and allows
693 the caller to specify a notification function.
695 This function abstracts the creation of the Ready to Boot Event.
696 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
697 This library abstracts the caller from how this event is created to prevent
698 to code form having to change with the version of the specification supported.
699 If ReadyToBootEvent is NULL, then ASSERT().
701 @param NotifyTpl The task priority level of the event.
702 @param NotifyFunction The notification function to call when the event is signaled.
703 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
704 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
706 @retval EFI_SUCCESS Event was created.
707 @retval Other Event was not created.
712 EfiCreateEventReadyToBootEx (
713 IN EFI_TPL NotifyTpl
,
714 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
715 IN VOID
*NotifyContext
, OPTIONAL
716 OUT EFI_EVENT
*ReadyToBootEvent
720 Initialize a Firmware Volume (FV) Media Device Path node.
722 Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
723 so as we move to UEFI 2.0 support we must use a mechanism that conforms with
724 the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
725 device path is defined for Tiano extensions of device path. If the code
726 is compiled to conform with the UEFI 2.0 specification use the new device path
727 else use the old form for backwards compatability.
729 @param FvDevicePathNode Pointer to a FV device path node to initialize
730 @param NameGuid FV file name to use in FvDevicePathNode
735 EfiInitializeFwVolDevicepathNode (
736 IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
,
737 IN CONST EFI_GUID
*NameGuid
741 Check to see if the Firmware Volume (FV) Media Device Path is valid
743 Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
744 so as we move to UEFI 2.0 support we must use a mechanism that conforms with
745 the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
746 device path is defined for Tiano extensions of device path. If the code
747 is compiled to conform with the UEFI 2.0 specification use the new device path
748 else use the old form for backwards compatability. The return value to this
749 function points to a location in FvDevicePathNode and it does not allocate
750 new memory for the GUID pointer that is returned.
752 @param FvDevicePathNode Pointer to FV device path to check.
754 @retval NULL FvDevicePathNode is not valid.
755 @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
760 EfiGetNameGuidFromFwVolDevicePathNode (
761 IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
765 Prints a formatted Unicode string to the console output device specified by
766 ConOut defined in the EFI_SYSTEM_TABLE.
768 This function prints a formatted Unicode string to the console output device
769 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
770 characters that printed to ConOut. If the length of the formatted Unicode
771 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
772 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
774 @param Format Null-terminated Unicode format string.
775 @param ... VARARG list consumed to process Format.
776 If Format is NULL, then ASSERT().
777 If Format is not aligned on a 16-bit boundary, then ASSERT().
783 IN CONST CHAR16
*Format
,
788 Prints a formatted Unicode string to the console output device specified by
789 StdErr defined in the EFI_SYSTEM_TABLE.
791 This function prints a formatted Unicode string to the console output device
792 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
793 characters that printed to StdErr. If the length of the formatted Unicode
794 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
795 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
797 @param Format Null-terminated Unicode format string.
798 @param ... VARARG list consumed to process Format.
799 If Format is NULL, then ASSERT().
800 If Format is not aligned on a 16-bit boundary, then ASSERT().
806 IN CONST CHAR16
*Format
,
811 Prints a formatted ASCII string to the console output device specified by
812 ConOut defined in the EFI_SYSTEM_TABLE.
814 This function prints a formatted ASCII string to the console output device
815 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
816 characters that printed to ConOut. If the length of the formatted ASCII
817 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
818 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
820 @param Format Null-terminated ASCII format string.
821 @param ... VARARG list consumed to process Format.
822 If Format is NULL, then ASSERT().
823 If Format is not aligned on a 16-bit boundary, then ASSERT().
829 IN CONST CHAR8
*Format
,
834 Prints a formatted ASCII string to the console output device specified by
835 StdErr defined in the EFI_SYSTEM_TABLE.
837 This function prints a formatted ASCII string to the console output device
838 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
839 characters that printed to StdErr. If the length of the formatted ASCII
840 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
841 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
843 @param Format Null-terminated ASCII format string.
844 @param ... VARARG list consumed to process Format.
845 If Format is NULL, then ASSERT().
846 If Format is not aligned on a 16-bit boundary, then ASSERT().
852 IN CONST CHAR8
*Format
,
857 Initializes a driver by installing the Driver Binding Protocol onto the driver's
858 DriverBindingHandle. This is typically the same as the driver's ImageHandle, but
859 it can be different if the driver produces multiple DriverBinding Protocols.
860 If the Driver Binding Protocol interface is NULL, then ASSERT ().
861 If the installation fails, then ASSERT ().
863 @param ImageHandle The image handle of the driver.
864 @param SystemTable The EFI System Table that was passed to the driver's entry point.
865 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
866 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
867 parameter is NULL, then a new handle is created.
869 @retval EFI_SUCCESS The protocol installation is completed successfully.
870 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
875 EfiLibInstallDriverBinding (
876 IN CONST EFI_HANDLE ImageHandle
,
877 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
878 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
879 IN EFI_HANDLE DriverBindingHandle
884 Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name,
885 Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle. This is
886 typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple
887 DriverBinding Protocols.
888 If the Driver Binding Protocol interface is NULL, then ASSERT ().
889 If the installation fails, then ASSERT ().
891 @param ImageHandle The image handle of the driver.
892 @param SystemTable The EFI System Table that was passed to the driver's entry point.
893 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
894 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
895 parameter is NULL, then a new handle is created.
896 @param ComponentName A Component Name Protocol instance that this driver is producing.
897 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
898 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
900 @retval EFI_SUCCESS The protocol installation is completed successfully.
901 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
906 EfiLibInstallAllDriverProtocols (
907 IN CONST EFI_HANDLE ImageHandle
,
908 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
909 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
910 IN EFI_HANDLE DriverBindingHandle
,
911 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
912 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
913 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics OPTIONAL
919 Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name,
920 Component Name 2 onto the driver's DriverBindingHandle. This is typically the same as the driver's
921 ImageHandle, but it can be different if the driver produces multiple DriverBinding Protocols.
922 If the Driver Binding Protocol interface is NULL, then ASSERT ().
923 If the installation fails, then ASSERT ().
925 @param ImageHandle The image handle of the driver.
926 @param SystemTable The EFI System Table that was passed to the driver's entry point.
927 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
928 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
929 parameter is NULL, then a new handle is created.
930 @param ComponentName A Component Name Protocol instance that this driver is producing.
931 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
933 @retval EFI_SUCCESS The protocol installation is completed successfully.
934 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
939 EfiLibInstallDriverBindingComponentName2 (
940 IN CONST EFI_HANDLE ImageHandle
,
941 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
942 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
943 IN EFI_HANDLE DriverBindingHandle
,
944 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
945 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2 OPTIONAL
950 Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name,
951 Component Name 2, Driver Configure, Driver Diagnostic and Driver Diagnostic 2 Protocols onto the driver's
952 DriverBindingHandle. This is typically the same as the driver's ImageHandle, but it can be different if
953 the driver produces multiple DriverBinding Protocols.
954 If the Driver Binding Protocol interface is NULL, then ASSERT ().
955 If the installation fails, then ASSERT ().
957 @param ImageHandle The image handle of the driver.
958 @param SystemTable The EFI System Table that was passed to the driver's entry point.
959 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
960 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
961 parameter is NULL, then a new handle is created.
962 @param ComponentName A Component Name Protocol instance that this driver is producing.
963 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
964 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
965 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
966 @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.
968 @retval EFI_SUCCESS The protocol installation is completed successfully.
969 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
974 EfiLibInstallAllDriverProtocols2 (
975 IN CONST EFI_HANDLE ImageHandle
,
976 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
977 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
978 IN EFI_HANDLE DriverBindingHandle
,
979 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
980 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2
, OPTIONAL
981 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
982 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics
, OPTIONAL
983 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL
*DriverDiagnostics2 OPTIONAL