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<BR>
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>
31 #include <Protocol/GraphicsOutput.h>
33 #include <Library/BaseLib.h>
36 /// Unicode String Table
40 CHAR16
*UnicodeString
;
41 } EFI_UNICODE_STRING_TABLE
;
47 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 microseconds.
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)
74 Macro that returns the number of 100 ns units for a specified number of milliseconds.
75 Useful for managing EFI timer events.
77 @param Milliseconds Number of milliseconds.
79 @return The number of 100 ns units equivalent to the number of milliseconds specified
83 #define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds) MultU64x32((UINT64)(Milliseconds), 10000)
86 Macro that returns the number of 100 ns units for a specified number of seconds.
87 Useful for managing EFI timer events.
89 @param Seconds Number of seconds.
91 @return The number of 100 ns units equivalent to the number of seconds specified
95 #define EFI_TIMER_PERIOD_SECONDS(Seconds) MultU64x32((UINT64)(Seconds), 10000000)
98 Macro that returns the a pointer to the next EFI_MEMORY_DESCRIPTOR in an array
99 returned from GetMemoryMap().
101 @param MemoryDescriptor A pointer to an EFI_MEMORY_DESCRIPTOR.
103 @param Size The size, in bytes, of the current EFI_MEMORY_DESCRIPTOR.
105 @return A pointer to the next EFI_MEMORY_DESCRIPTOR.
108 #define NEXT_MEMORY_DESCRIPTOR(MemoryDescriptor, Size) \
109 ((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) + (Size)))
112 Retrieves a pointer to the system configuration table from the EFI System Table
113 based on a specified GUID.
115 This function searches the list of configuration tables stored in the EFI System Table
116 for a table with a GUID that matches TableGuid. If a match is found, then a pointer to
117 the configuration table is returned in Table., and EFI_SUCCESS is returned. If a matching GUID
118 is not found, then EFI_NOT_FOUND is returned.
119 If TableGuid is NULL, then ASSERT().
120 If Table is NULL, then ASSERT().
122 @param TableGuid Pointer to table's GUID type..
123 @param Table Pointer to the table associated with TableGuid in the EFI System Table.
125 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
126 @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
131 EfiGetSystemConfigurationTable (
132 IN EFI_GUID
*TableGuid
,
137 Creates and returns a notification event and registers that event with all the protocol
138 instances specified by ProtocolGuid.
140 This function causes the notification function to be executed for every protocol of type
141 ProtocolGuid instance that exists in the system when this function is invoked. If there are
142 no instances of ProtocolGuid in the handle database at the time this function is invoked,
143 then the notification function is still executed one time. In addition, every time a protocol
144 of type ProtocolGuid instance is installed or reinstalled, the notification function is also
145 executed. This function returns the notification event that was created.
146 If ProtocolGuid is NULL, then ASSERT().
147 If NotifyTpl is not a legal TPL value, then ASSERT().
148 If NotifyFunction is NULL, then ASSERT().
149 If Registration is NULL, then ASSERT().
152 @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
153 @param NotifyTpl Supplies the task priority level of the event notifications.
154 @param NotifyFunction Supplies the function to notify when the event is signaled.
155 @param NotifyContext The context parameter to pass to NotifyFunction.
156 @param Registration A pointer to a memory location to receive the registration value.
157 This value is passed to LocateHandle() to obtain new handles that
158 have been added that support the ProtocolGuid-specified protocol.
160 @return The notification event that was created.
165 EfiCreateProtocolNotifyEvent(
166 IN EFI_GUID
*ProtocolGuid
,
167 IN EFI_TPL NotifyTpl
,
168 IN EFI_EVENT_NOTIFY NotifyFunction
,
169 IN VOID
*NotifyContext
, OPTIONAL
170 OUT VOID
**Registration
174 Creates a named event that can be signaled with EfiNamedEventSignal().
176 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
177 This event is signaled with EfiNamedEventSignal(). This provides the ability for one or more
178 listeners on the same event named by the GUID specified by Name.
179 If Name is NULL, then ASSERT().
180 If NotifyTpl is not a legal TPL value, then ASSERT().
181 If NotifyFunction is NULL, then ASSERT().
183 @param Name Supplies GUID name of the event.
184 @param NotifyTpl Supplies the task priority level of the event notifications.
185 @param NotifyFunction Supplies the function to notify when the event is signaled.
186 @param NotifyContext The context parameter to pass to NotifyFunction.
187 @param Registration A pointer to a memory location to receive the registration value.
189 @retval EFI_SUCCESS A named event was created.
190 @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.
195 EfiNamedEventListen (
196 IN CONST EFI_GUID
*Name
,
197 IN EFI_TPL NotifyTpl
,
198 IN EFI_EVENT_NOTIFY NotifyFunction
,
199 IN CONST VOID
*NotifyContext
, OPTIONAL
200 OUT VOID
*Registration OPTIONAL
204 Signals a named event created with EfiNamedEventListen().
206 This function signals the named event specified by Name. The named event must have been
207 created with EfiNamedEventListen().
208 If Name is NULL, then ASSERT().
210 @param Name Supplies GUID name of the event.
212 @retval EFI_SUCCESS A named event was signaled.
213 @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.
218 EfiNamedEventSignal (
219 IN CONST EFI_GUID
*Name
223 Returns the current TPL.
225 This function returns the current TPL. There is no EFI service to directly
226 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
227 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
228 can then immediately be restored back to the current TPL level with a call
231 @return The current TPL.
241 Initializes a basic mutual exclusion lock.
243 This function initializes a basic mutual exclusion lock to the released state
244 and returns the lock. Each lock provides mutual exclusion access at its task
245 priority level. Since there is no preemption or multiprocessor support in EFI,
246 acquiring the lock only consists of raising to the locks TPL.
247 If Lock is NULL, then ASSERT().
248 If Priority is not a valid TPL value, then ASSERT().
250 @param Lock A pointer to the lock data structure to initialize.
251 @param Priority EFI TPL associated with the lock.
259 IN OUT EFI_LOCK
*Lock
,
264 Initializes a basic mutual exclusion lock.
266 This macro initializes the contents of a basic mutual exclusion lock to the
267 released state. Each lock provides mutual exclusion access at its task
268 priority level. Since there is no preemption or multiprocessor support in EFI,
269 acquiring the lock only consists of raising to the locks TPL.
271 @param Priority The task priority level of the lock.
276 #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \
277 {Priority, TPL_APPLICATION, EfiLockReleased }
281 Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
283 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
284 then this macro evaluates the EFI_LOCK structure specified by Lock. If Lock
285 is not in the locked state, then DebugAssert() is called passing in the source
286 filename, source line number, and Lock.
287 If Lock is NULL, then ASSERT().
289 @param LockParameter A pointer to the lock to acquire.
292 #define ASSERT_LOCKED(LockParameter) \
294 if (DebugAssertEnabled ()) { \
295 ASSERT (LockParameter != NULL); \
296 if ((LockParameter)->Lock != EfiLockAcquired) { \
297 _ASSERT (LockParameter not locked); \
304 Acquires ownership of a lock.
306 This function raises the system's current task priority level to the task
307 priority level of the mutual exclusion lock. Then, it places the lock in the
309 If Lock is NULL, then ASSERT().
310 If Lock is not initialized, then ASSERT().
311 If Lock is already in the acquired state, then ASSERT().
313 @param Lock A pointer to the lock to acquire.
323 Acquires ownership of a lock.
325 This function raises the system's current task priority level to the task priority
326 level of the mutual exclusion lock. Then, it attempts to place the lock in the acquired state.
327 If the lock is already in the acquired state, then EFI_ACCESS_DENIED is returned.
328 Otherwise, EFI_SUCCESS is returned.
329 If Lock is NULL, then ASSERT().
330 If Lock is not initialized, then ASSERT().
332 @param Lock A pointer to the lock to acquire.
334 @retval EFI_SUCCESS The lock was acquired.
335 @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
340 EfiAcquireLockOrFail (
345 Releases ownership of a lock.
347 This function transitions a mutual exclusion lock from the acquired state to
348 the released state, and restores the system's task priority level to its
350 If Lock is NULL, then ASSERT().
351 If Lock is not initialized, then ASSERT().
352 If Lock is already in the released state, then ASSERT().
354 @param Lock A pointer to the lock to release.
364 Tests whether a controller handle is being managed by a specific driver.
366 This function tests whether the driver specified by DriverBindingHandle is
367 currently managing the controller specified by ControllerHandle. This test
368 is performed by evaluating if the the protocol specified by ProtocolGuid is
369 present on ControllerHandle and is was opened by DriverBindingHandle with an
370 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
371 If ProtocolGuid is NULL, then ASSERT().
373 @param ControllerHandle A handle for a controller to test.
374 @param DriverBindingHandle Specifies the driver binding handle for the
376 @param ProtocolGuid Specifies the protocol that the driver specified
377 by DriverBindingHandle opens in its Start()
380 @retval EFI_SUCCESS ControllerHandle is managed by the driver
381 specified by DriverBindingHandle.
382 @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
383 specified by DriverBindingHandle.
388 EfiTestManagedDevice (
389 IN CONST EFI_HANDLE ControllerHandle
,
390 IN CONST EFI_HANDLE DriverBindingHandle
,
391 IN CONST EFI_GUID
*ProtocolGuid
395 Tests whether a child handle is a child device of the controller.
397 This function tests whether ChildHandle is one of the children of
398 ControllerHandle. This test is performed by checking to see if the protocol
399 specified by ProtocolGuid is present on ControllerHandle and opened by
400 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
401 If ProtocolGuid is NULL, then ASSERT().
403 @param ControllerHandle A handle for a (parent) controller to test.
404 @param ChildHandle A child handle to test.
405 @param ProtocolGuid Supplies the protocol that the child controller
406 opens on its parent controller.
408 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
409 @retval EFI_UNSUPPORTED ChildHandle is not a child of the
416 IN CONST EFI_HANDLE ControllerHandle
,
417 IN CONST EFI_HANDLE ChildHandle
,
418 IN CONST EFI_GUID
*ProtocolGuid
422 This function looks up a Unicode string in UnicodeStringTable.
424 If Language is a member of SupportedLanguages and a Unicode string is found in
425 UnicodeStringTable that matches the language code specified by Language, then it
426 is returned in UnicodeString.
428 @param Language A pointer to the ISO 639-2 language code for the
429 Unicode string to look up and return.
430 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
431 that the Unicode string table supports. Language
432 must be a member of this set.
433 @param UnicodeStringTable A pointer to the table of Unicode strings.
434 @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
435 that matches the language specified by Language.
437 @retval EFI_SUCCESS The Unicode string that matches the language
438 specified by Language was found
439 in the table of Unicode strings UnicodeStringTable,
440 and it was returned in UnicodeString.
441 @retval EFI_INVALID_PARAMETER Language is NULL.
442 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
443 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
444 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
445 @retval EFI_UNSUPPORTED The language specified by Language is not a
446 member of SupportedLanguages.
447 @retval EFI_UNSUPPORTED The language specified by Language is not
448 supported by UnicodeStringTable.
453 LookupUnicodeString (
454 IN CONST CHAR8
*Language
,
455 IN CONST CHAR8
*SupportedLanguages
,
456 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
457 OUT CHAR16
**UnicodeString
461 This function looks up a Unicode string in UnicodeStringTable.
463 If Language is a member of SupportedLanguages and a Unicode string is found in
464 UnicodeStringTable that matches the language code specified by Language, then
465 it is returned in UnicodeString.
467 @param Language A pointer to an ASCII string containing the ISO 639-2 or the
468 RFC 4646 language code for the Unicode string to look up and
469 return. If Iso639Language is TRUE, then this ASCII string is
470 not assumed to be Null-terminated, and only the first three
471 characters are used. If Iso639Language is FALSE, then this ASCII
472 string must be Null-terminated.
473 @param SupportedLanguages A pointer to a Null-terminated ASCII string that contains a
474 set of ISO 639-2 or RFC 4646 language codes that the Unicode
475 string table supports. Language must be a member of this set.
476 If Iso639Language is TRUE, then this string contains one or more
477 ISO 639-2 language codes with no separator characters. If Iso639Language
478 is FALSE, then is string contains one or more RFC 4646 language
479 codes separated by ';'.
480 @param UnicodeStringTable A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE
481 is defined in "Related Definitions".
482 @param UnicodeString A pointer to the Null-terminated Unicode string from UnicodeStringTable
483 that matches the language specified by Language.
484 @param Iso639Language Specifies the supported language code format. If it is TRUE, then
485 Language and SupportedLanguages follow ISO 639-2 language code format.
486 Otherwise, they follow RFC 4646 language code format.
489 @retval EFI_SUCCESS The Unicode string that matches the language specified by Language
490 was found in the table of Unicode strings UnicodeStringTable, and
491 it was returned in UnicodeString.
492 @retval EFI_INVALID_PARAMETER Language is NULL.
493 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
494 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
495 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
496 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages.
497 @retval EFI_UNSUPPORTED The language specified by Language is not supported by UnicodeStringTable.
502 LookupUnicodeString2 (
503 IN CONST CHAR8
*Language
,
504 IN CONST CHAR8
*SupportedLanguages
,
505 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
506 OUT CHAR16
**UnicodeString
,
507 IN BOOLEAN Iso639Language
511 This function adds a Unicode string to UnicodeStringTable.
513 If Language is a member of SupportedLanguages then UnicodeString is added to
514 UnicodeStringTable. New buffers are allocated for both Language and
515 UnicodeString. The contents of Language and UnicodeString are copied into
516 these new buffers. These buffers are automatically freed when
517 FreeUnicodeStringTable() is called.
519 @param Language A pointer to the ISO 639-2 language code for the Unicode
521 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
522 that the Unicode string table supports.
523 Language must be a member of this set.
524 @param UnicodeStringTable A pointer to the table of Unicode strings.
525 @param UnicodeString A pointer to the Unicode string to add.
527 @retval EFI_SUCCESS The Unicode string that matches the language
528 specified by Language was found in the table of
529 Unicode strings UnicodeStringTable, and it was
530 returned in UnicodeString.
531 @retval EFI_INVALID_PARAMETER Language is NULL.
532 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
533 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
534 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
535 @retval EFI_ALREADY_STARTED A Unicode string with language Language is
536 already present in UnicodeStringTable.
537 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
538 Unicode string to UnicodeStringTable.
539 @retval EFI_UNSUPPORTED The language specified by Language is not a
540 member of SupportedLanguages.
546 IN CONST CHAR8
*Language
,
547 IN CONST CHAR8
*SupportedLanguages
,
548 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
549 IN CONST CHAR16
*UnicodeString
553 This function adds the Null-terminated Unicode string specified by UnicodeString
554 to UnicodeStringTable.
556 If Language is a member of SupportedLanguages then UnicodeString is added to
557 UnicodeStringTable. New buffers are allocated for both Language and UnicodeString.
558 The contents of Language and UnicodeString are copied into these new buffers.
559 These buffers are automatically freed when EfiLibFreeUnicodeStringTable() is called.
561 @param Language A pointer to an ASCII string containing the ISO 639-2 or
562 the RFC 4646 language code for the Unicode string to add.
563 If Iso639Language is TRUE, then this ASCII string is not
564 assumed to be Null-terminated, and only the first three
565 chacters are used. If Iso639Language is FALSE, then this
566 ASCII string must be Null-terminated.
567 @param SupportedLanguages A pointer to a Null-terminated ASCII string that contains
568 a set of ISO 639-2 or RFC 4646 language codes that the Unicode
569 string table supports. Language must be a member of this set.
570 If Iso639Language is TRUE, then this string contains one or more
571 ISO 639-2 language codes with no separator characters.
572 If Iso639Language is FALSE, then is string contains one or more
573 RFC 4646 language codes separated by ';'.
574 @param UnicodeStringTable A pointer to the table of Unicode strings. Type EFI_UNICODE_STRING_TABLE
575 is defined in "Related Definitions".
576 @param UnicodeString A pointer to the Unicode string to add.
577 @param Iso639Language Specifies the supported language code format. If it is TRUE,
578 then Language and SupportedLanguages follow ISO 639-2 language code format.
579 Otherwise, they follow RFC 4646 language code format.
581 @retval EFI_SUCCESS The Unicode string that matches the language specified by
582 Language was found in the table of Unicode strings UnicodeStringTable,
583 and it was returned in UnicodeString.
584 @retval EFI_INVALID_PARAMETER Language is NULL.
585 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
586 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
587 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
588 @retval EFI_ALREADY_STARTED A Unicode string with language Language is already present in
590 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another Unicode string UnicodeStringTable.
591 @retval EFI_UNSUPPORTED The language specified by Language is not a member of SupportedLanguages.
597 IN CONST CHAR8
*Language
,
598 IN CONST CHAR8
*SupportedLanguages
,
599 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
600 IN CONST CHAR16
*UnicodeString
,
601 IN BOOLEAN Iso639Language
605 This function frees the table of Unicode strings in UnicodeStringTable.
607 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
608 Otherwise, each language code, and each Unicode string in the Unicode string
609 table are freed, and EFI_SUCCESS is returned.
611 @param UnicodeStringTable A pointer to the table of Unicode strings.
613 @retval EFI_SUCCESS The Unicode string table was freed.
618 FreeUnicodeStringTable (
619 IN EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
624 Returns a pointer to an allocated buffer that contains the contents of a
625 variable retrieved through the UEFI Runtime Service GetVariable(). The
626 returned buffer is allocated using AllocatePool(). The caller is responsible
627 for freeing this buffer with FreePool().
629 If Name is NULL, then ASSERT().
630 If Guid is NULL, then ASSERT().
632 @param[in] Name Pointer to a Null-terminated Unicode string.
633 @param[in] Guid Pointer to an EFI_GUID structure
635 @retval NULL The variable could not be retrieved.
636 @retval NULL There are not enough resources available for the variable contents.
637 @retval Other A pointer to allocated buffer containing the variable contents.
643 IN CONST CHAR16
*Name
,
644 IN CONST EFI_GUID
*Guid
648 Returns a pointer to an allocated buffer that contains the contents of a
649 variable retrieved through the UEFI Runtime Service GetVariable(). This
650 function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
651 The returned buffer is allocated using AllocatePool(). The caller is
652 responsible for freeing this buffer with FreePool().
654 If Name is NULL, then ASSERT().
656 @param[in] Name Pointer to a Null-terminated Unicode string.
658 @retval NULL The variable could not be retrieved.
659 @retval NULL There are not enough resources available for the variable contents.
660 @retval Other A pointer to allocated buffer containing the variable contents.
665 GetEfiGlobalVariable (
666 IN CONST CHAR16
*Name
671 Returns a pointer to an allocated buffer that contains the best matching language
672 from a set of supported languages.
674 This function supports both ISO 639-2 and RFC 4646 language codes, but language
675 code types may not be mixed in a single call to this function. The language
676 code returned is allocated using AllocatePool(). The caller is responsible for
677 freeing the allocated buffer using FreePool(). This function supports a variable
678 argument list that allows the caller to pass in a prioritized list of language
679 codes to test against all the language codes in SupportedLanguages.
681 If SupportedLanguages is NULL, then ASSERT().
683 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string that
684 contains a set of language codes in the format
685 specified by Iso639Language.
686 @param[in] Iso639Language If TRUE, then all language codes are assumed to be
687 in ISO 639-2 format. If FALSE, then all language
688 codes are assumed to be in RFC 4646 language format
689 @param[in] ... A variable argument list that contains pointers to
690 Null-terminated ASCII strings that contain one or more
691 language codes in the format specified by Iso639Language.
692 The first language code from each of these language
693 code lists is used to determine if it is an exact or
694 close match to any of the language codes in
695 SupportedLanguages. Close matches only apply to RFC 4646
696 language codes, and the matching algorithm from RFC 4647
697 is used to determine if a close match is present. If
698 an exact or close match is found, then the matching
699 language code from SupportedLanguages is returned. If
700 no matches are found, then the next variable argument
701 parameter is evaluated. The variable argument list
702 is terminated by a NULL.
704 @retval NULL The best matching language could not be found in SupportedLanguages.
705 @retval NULL There are not enough resources available to return the best matching
707 @retval Other A pointer to a Null-terminated ASCII string that is the best matching
708 language in SupportedLanguages.
714 IN CONST CHAR8
*SupportedLanguages
,
715 IN BOOLEAN Iso639Language
,
720 Draws a dialog box to the console output device specified by
721 ConOut defined in the EFI_SYSTEM_TABLE and waits for a keystroke
722 from the console input device specified by ConIn defined in the
725 If there are no strings in the variable argument list, then ASSERT().
726 If all the strings in the variable argument list are empty, then ASSERT().
728 @param[in] Attribute Specifies the foreground and background color of the popup.
729 @param[out] Key A pointer to the EFI_KEY value of the key that was
730 pressed. This is an optional parameter that may be NULL.
731 If it is NULL then no wait for a keypress will be performed.
732 @param[in] ... The variable argument list that contains pointers to Null-
733 terminated Unicode strings to display in the dialog box.
734 The variable argument list is terminated by a NULL.
741 OUT EFI_INPUT_KEY
*Key
, OPTIONAL
746 Retrieves the width of a Unicode character.
748 This function computes and returns the width of the Unicode character specified
751 @param UnicodeChar A Unicode character.
753 @retval 0 The width if UnicodeChar could not be determined.
754 @retval 1 UnicodeChar is a narrow glyph.
755 @retval 2 UnicodeChar is a wide glyph.
761 IN CHAR16 UnicodeChar
765 Computes the display length of a Null-terminated Unicode String.
767 This function computes and returns the display length of the Null-terminated Unicode
768 string specified by String. If String is NULL then 0 is returned. If any of the widths
769 of the Unicode characters in String can not be determined, then 0 is returned. The display
770 width of String can be computed by summing the display widths of each Unicode character
771 in String. Unicode characters that are narrow glyphs have a width of 1, and Unicode
772 characters that are width glyphs have a width of 2.
773 If String is not aligned on a 16-bit boundary, then ASSERT().
775 @param String A pointer to a Null-terminated Unicode string.
777 @return The display length of the Null-terminated Unicode string specified by String.
782 UnicodeStringDisplayLength (
783 IN CONST CHAR16
*String
787 // Functions that abstract early Framework contamination of UEFI.
790 Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot().
792 This function abstracts the signaling of the Ready to Boot Event. The Framework moved
793 from a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller
794 from how this event is created to prevent to code form having to change with the
795 version of the specification supported.
800 EfiSignalEventReadyToBoot (
805 Create, Signal, and Close the Ready to Boot event using EfiSignalEventLegacyBoot().
807 This function abstracts the signaling of the Legacy Boot Event. The Framework moved from
808 a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller from how
809 this event is created to prevent to code form having to change with the version of the
810 specification supported.
815 EfiSignalEventLegacyBoot (
820 Creates an EFI event in the Legacy Boot Event Group.
822 Prior to UEFI 2.0 this was done via a non blessed UEFI extensions and this library
823 abstracts the implementation mechanism of this event from the caller. This function
824 abstracts the creation of the Legacy Boot Event. The Framework moved from a proprietary
825 to UEFI 2.0 based mechanism. This library abstracts the caller from how this event
826 is created to prevent to code form having to change with the version of the
827 specification supported.
828 If LegacyBootEvent is NULL, then ASSERT().
830 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
832 @retval EFI_SUCCESS Event was created.
833 @retval Other Event was not created.
838 EfiCreateEventLegacyBoot (
839 OUT EFI_EVENT
*LegacyBootEvent
843 Create an EFI event in the Legacy Boot Event Group and allows
844 the caller to specify a notification function.
846 This function abstracts the creation of the Legacy Boot Event.
847 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
848 This library abstracts the caller from how this event is created to prevent
849 to code form having to change with the version of the specification supported.
850 If LegacyBootEvent is NULL, then ASSERT().
852 @param NotifyTpl The task priority level of the event.
853 @param NotifyFunction The notification function to call when the event is signaled.
854 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
855 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
857 @retval EFI_SUCCESS Event was created.
858 @retval Other Event was not created.
863 EfiCreateEventLegacyBootEx (
864 IN EFI_TPL NotifyTpl
,
865 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
866 IN VOID
*NotifyContext
, OPTIONAL
867 OUT EFI_EVENT
*LegacyBootEvent
871 Create an EFI event in the Ready To Boot Event Group.
873 Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library
874 abstracts the implementation mechanism of this event from the caller.
875 This function abstracts the creation of the Ready to Boot Event. The Framework
876 moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts
877 the caller from how this event is created to prevent the code form having to
878 change with the version of the specification supported.
879 If ReadyToBootEvent is NULL, then ASSERT().
881 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
883 @retval EFI_SUCCESS Event was created.
884 @retval Other Event was not created.
889 EfiCreateEventReadyToBoot (
890 OUT EFI_EVENT
*ReadyToBootEvent
894 Create an EFI event in the Ready To Boot Event Group and allows
895 the caller to specify a notification function.
897 This function abstracts the creation of the Ready to Boot Event.
898 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
899 This library abstracts the caller from how this event is created to prevent
900 to code form having to change with the version of the specification supported.
901 If ReadyToBootEvent is NULL, then ASSERT().
903 @param NotifyTpl The task priority level of the event.
904 @param NotifyFunction The notification function to call when the event is signaled.
905 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
906 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
908 @retval EFI_SUCCESS Event was created.
909 @retval Other Event was not created.
914 EfiCreateEventReadyToBootEx (
915 IN EFI_TPL NotifyTpl
,
916 IN EFI_EVENT_NOTIFY NotifyFunction
, OPTIONAL
917 IN VOID
*NotifyContext
, OPTIONAL
918 OUT EFI_EVENT
*ReadyToBootEvent
922 Initialize a Firmware Volume (FV) Media Device Path node.
924 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
925 This library function abstracts initializing a device path node.
926 Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device
927 path changed in the DXE CIS version 0.92 in a non back ward compatible way to
928 not conflict with the UEFI 2.0 specification. This function abstracts the
929 differences from the caller.
930 If FvDevicePathNode is NULL, then ASSERT().
931 If NameGuid is NULL, then ASSERT().
933 @param FvDevicePathNode Pointer to a FV device path node to initialize
934 @param NameGuid FV file name to use in FvDevicePathNode
939 EfiInitializeFwVolDevicepathNode (
940 IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
,
941 IN CONST EFI_GUID
*NameGuid
945 Check to see if the Firmware Volume (FV) Media Device Path is valid
947 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
948 This library function abstracts validating a device path node.
949 Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid.
950 If it is valid, then return the GUID file name from the device path node. Otherwise,
951 return NULL. This device path changed in the DXE CIS version 0.92 in a non back ward
952 compatible way to not conflict with the UEFI 2.0 specification. This function abstracts
953 the differences from the caller.
954 If FvDevicePathNode is NULL, then ASSERT().
956 @param FvDevicePathNode Pointer to FV device path to check.
958 @retval NULL FvDevicePathNode is not valid.
959 @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
964 EfiGetNameGuidFromFwVolDevicePathNode (
965 IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvDevicePathNode
969 Prints a formatted Unicode string to the console output device specified by
970 ConOut defined in the EFI_SYSTEM_TABLE.
972 This function prints a formatted Unicode string to the console output device
973 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
974 characters that printed to ConOut. If the length of the formatted Unicode
975 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
976 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
977 If Format is NULL, then ASSERT().
978 If Format is not aligned on a 16-bit boundary, then ASSERT().
980 @param Format Null-terminated Unicode format string.
981 @param ... Variable argument list whose contents are accessed based
982 on the format string specified by Format.
984 @return Number of Unicode characters printed to ConOut.
990 IN CONST CHAR16
*Format
,
995 Prints a formatted Unicode string to the console output device specified by
996 StdErr defined in the EFI_SYSTEM_TABLE.
998 This function prints a formatted Unicode string to the console output device
999 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
1000 characters that printed to StdErr. If the length of the formatted Unicode
1001 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
1002 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
1003 If Format is NULL, then ASSERT().
1004 If Format is not aligned on a 16-bit boundary, then ASSERT().
1006 @param Format Null-terminated Unicode format string.
1007 @param ... Variable argument list whose contents are accessed based
1008 on the format string specified by Format.
1010 @return Number of Unicode characters printed to StdErr.
1016 IN CONST CHAR16
*Format
,
1021 Prints a formatted ASCII string to the console output device specified by
1022 ConOut defined in the EFI_SYSTEM_TABLE.
1024 This function prints a formatted ASCII string to the console output device
1025 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
1026 characters that printed to ConOut. If the length of the formatted ASCII
1027 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
1028 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
1029 If Format is NULL, then ASSERT().
1031 @param Format Null-terminated ASCII format string.
1032 @param ... Variable argument list whose contents are accessed based
1033 on the format string specified by Format.
1035 @return Number of ASCII characters printed to ConOut.
1041 IN CONST CHAR8
*Format
,
1046 Prints a formatted ASCII string to the console output device specified by
1047 StdErr defined in the EFI_SYSTEM_TABLE.
1049 This function prints a formatted ASCII string to the console output device
1050 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
1051 characters that printed to StdErr. If the length of the formatted ASCII
1052 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
1053 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
1054 If Format is NULL, then ASSERT().
1056 @param Format Null-terminated ASCII format string.
1057 @param ... Variable argument list whose contents are accessed based
1058 on the format string specified by Format.
1060 @return Number of ASCII characters printed to ConErr.
1066 IN CONST CHAR8
*Format
,
1072 Prints a formatted Unicode string to a graphics console device specified by
1073 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
1075 This function prints a formatted Unicode string to the graphics console device
1076 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
1077 Unicode characters displayed, not including partial characters that may be clipped
1078 by the right edge of the display. If the length of the formatted Unicode string is
1079 greater than PcdUefiLibMaxPrintBufferSize, then at most the first
1080 PcdUefiLibMaxPrintBufferSize characters are printed. The EFI_HII_FONT_PROTOCOL
1081 is used to convert the string to a bitmap using the glyphs registered with the
1082 HII database. No wrapping is performed, so any portions of the string the fall
1083 outside the active display region will not be displayed.
1085 If a graphics console device is not associated with the ConsoleOutputHandle
1086 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
1087 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
1088 string is printed, and 0 is returned.
1089 If Format is NULL, then ASSERT().
1090 If Format is not aligned on a 16-bit boundary, then ASSERT().
1092 @param PointX X coordinate to print the string.
1093 @param PointY Y coordinate to print the string.
1094 @param ForeGround The foreground color of the string being printed. This is
1095 an optional parameter that may be NULL. If it is NULL,
1096 then the foreground color of the current ConOut device
1097 in the EFI_SYSTEM_TABLE is used.
1098 @param BackGround The background color of the string being printed. This is
1099 an optional parameter that may be NULL. If it is NULL,
1100 then the background color of the current ConOut device
1101 in the EFI_SYSTEM_TABLE is used.
1102 @param Format Null-terminated Unicode format string. See Print Library
1103 for the supported format string syntax.
1104 @param ... Variable argument list whose contents are accessed based on
1105 the format string specified by Format.
1107 @return The number of Unicode characters printed.
1115 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*ForeGround
, OPTIONAL
1116 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BackGround
, OPTIONAL
1117 IN CONST CHAR16
*Format
,
1122 Prints a formatted ASCII string to a graphics console device specified by
1123 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
1125 This function prints a formatted ASCII string to the graphics console device
1126 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
1127 ASCII characters displayed, not including partial characters that may be clipped
1128 by the right edge of the display. If the length of the formatted ASCII string is
1129 greater than PcdUefiLibMaxPrintBufferSize, then at most the first
1130 PcdUefiLibMaxPrintBufferSize characters are printed. The EFI_HII_FONT_PROTOCOL
1131 is used to convert the string to a bitmap using the glyphs registered with the
1132 HII database. No wrapping is performed, so any portions of the string the fall
1133 outside the active display region will not be displayed.
1135 If a graphics console device is not associated with the ConsoleOutputHandle
1136 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
1137 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
1138 string is printed, and 0 is returned.
1139 If Format is NULL, then ASSERT().
1141 @param PointX X coordinate to print the string.
1142 @param PointY Y coordinate to print the string.
1143 @param ForeGround The foreground color of the string being printed. This is
1144 an optional parameter that may be NULL. If it is NULL,
1145 then the foreground color of the current ConOut device
1146 in the EFI_SYSTEM_TABLE is used.
1147 @param BackGround The background color of the string being printed. This is
1148 an optional parameter that may be NULL. If it is NULL,
1149 then the background color of the current ConOut device
1150 in the EFI_SYSTEM_TABLE is used.
1151 @param Format Null-terminated ASCII format string. See Print Library
1152 for the supported format string syntax.
1153 @param ... Variable argument list whose contents are accessed based on
1154 the format string specified by Format.
1156 @return The number of ASCII characters printed.
1164 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*ForeGround
, OPTIONAL
1165 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BackGround
, OPTIONAL
1166 IN CONST CHAR8
*Format
,
1171 Installs and completes the initialization of a Driver Binding Protocol instance.
1173 Installs the Driver Binding Protocol specified by DriverBinding onto the handle
1174 specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding
1175 is installed onto a newly created handle. DriverBindingHandle is typically the same
1176 as the driver's ImageHandle, but it can be different if the driver produces multiple
1177 Driver Binding Protocols.
1178 If DriverBinding is NULL, then ASSERT().
1179 If DriverBinding can not be installed onto a handle, then ASSERT().
1181 @param ImageHandle The image handle of the driver.
1182 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1183 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1184 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1185 parameter is NULL, then a new handle is created.
1187 @retval EFI_SUCCESS The protocol installation is completed successfully.
1188 @retval EFI_OUT_OF_RESOURCES There was not enough system resources to install the protocol.
1189 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
1194 EfiLibInstallDriverBinding (
1195 IN CONST EFI_HANDLE ImageHandle
,
1196 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
1197 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
1198 IN EFI_HANDLE DriverBindingHandle
1203 Installs and completes the initialization of a Driver Binding Protocol instance and
1204 optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.
1206 Initializes a driver by installing the Driver Binding Protocol together with the
1207 optional Component Name, optional Driver Configure and optional Driver Diagnostic
1208 Protocols onto the driver's DriverBindingHandle. If DriverBindingHandle is NULL,
1209 then the protocols are installed onto a newly created handle. DriverBindingHandle
1210 is typically the same as the driver's ImageHandle, but it can be different if the
1211 driver produces multiple Driver Binding Protocols.
1212 If DriverBinding is NULL, then ASSERT().
1213 If the installation fails, then ASSERT().
1215 @param ImageHandle The image handle of the driver.
1216 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1217 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1218 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1219 parameter is NULL, then a new handle is created.
1220 @param ComponentName A Component Name Protocol instance that this driver is producing.
1221 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
1222 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
1224 @retval EFI_SUCCESS The protocol installation is completed successfully.
1225 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
1230 EfiLibInstallAllDriverProtocols (
1231 IN CONST EFI_HANDLE ImageHandle
,
1232 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
1233 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
1234 IN EFI_HANDLE DriverBindingHandle
,
1235 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
1236 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
1237 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics OPTIONAL
1243 Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.
1245 Initializes a driver by installing the Driver Binding Protocol together with the
1246 optional Component Name and optional Component Name 2 protocols onto the driver's
1247 DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed
1248 onto a newly created handle. DriverBindingHandle is typically the same as the driver's
1249 ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols.
1250 If DriverBinding is NULL, then ASSERT().
1251 If the installation fails, then ASSERT().
1253 @param ImageHandle The image handle of the driver.
1254 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1255 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1256 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1257 parameter is NULL, then a new handle is created.
1258 @param ComponentName A Component Name Protocol instance that this driver is producing.
1259 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
1261 @retval EFI_SUCCESS The protocol installation is completed successfully.
1262 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
1267 EfiLibInstallDriverBindingComponentName2 (
1268 IN CONST EFI_HANDLE ImageHandle
,
1269 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
1270 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
1271 IN EFI_HANDLE DriverBindingHandle
,
1272 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
1273 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2 OPTIONAL
1278 Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver
1279 Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.
1281 Initializes a driver by installing the Driver Binding Protocol together with the optional
1282 Component Name, optional Component Name 2, optional Driver Configuration, optional Driver Configuration 2,
1283 optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols onto the driver's DriverBindingHandle.
1284 DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver
1285 produces multiple Driver Binding Protocols.
1286 If DriverBinding is NULL, then ASSERT().
1287 If the installation fails, then ASSERT().
1290 @param ImageHandle The image handle of the driver.
1291 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1292 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1293 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1294 parameter is NULL, then a new handle is created.
1295 @param ComponentName A Component Name Protocol instance that this driver is producing.
1296 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
1297 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
1298 @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver is producing.
1299 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
1300 @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.
1302 @retval EFI_SUCCESS The protocol installation is completed successfully.
1303 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
1308 EfiLibInstallAllDriverProtocols2 (
1309 IN CONST EFI_HANDLE ImageHandle
,
1310 IN CONST EFI_SYSTEM_TABLE
*SystemTable
,
1311 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
1312 IN EFI_HANDLE DriverBindingHandle
,
1313 IN CONST EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
1314 IN CONST EFI_COMPONENT_NAME2_PROTOCOL
*ComponentName2
, OPTIONAL
1315 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
1316 IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL
*DriverConfiguration2
, OPTIONAL
1317 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics
, OPTIONAL
1318 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL
*DriverDiagnostics2 OPTIONAL