2 Mde UEFI library functions.
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>
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.
13 Module Name: UefiLib.c
18 // Include common header file for this module.
20 #include "CommonHeader.h"
23 Compare whether two names of languages are identical.
25 @param Language1 Name of language 1.
26 @param Language2 Name of language 2.
28 @retval TRUE Language 1 and language 2 are the same.
29 @retval FALSE Language 1 and language 2 are not the same.
34 CompareIso639LanguageCode (
35 IN CONST CHAR8
*Language1
,
36 IN CONST CHAR8
*Language2
42 Name1
= ReadUnaligned24 ((CONST UINT32
*) Language1
);
43 Name2
= ReadUnaligned24 ((CONST UINT32
*) Language2
);
45 return (BOOLEAN
) (Name1
== Name2
);
49 This function searches the list of configuration tables stored in the EFI System
50 Table for a table with a GUID that matches TableGuid. If a match is found,
51 then a pointer to the configuration table is returned in Table, and EFI_SUCCESS
52 is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned.
54 @param TableGuid Pointer to table's GUID type..
55 @param Table Pointer to the table associated with TableGuid in the EFI System Table.
57 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
58 @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
63 EfiGetSystemConfigurationTable (
64 IN EFI_GUID
*TableGuid
,
68 EFI_SYSTEM_TABLE
*SystemTable
;
71 ASSERT (TableGuid
!= NULL
);
72 ASSERT (Table
!= NULL
);
76 for (Index
= 0; Index
< SystemTable
->NumberOfTableEntries
; Index
++) {
77 if (CompareGuid (TableGuid
, &(SystemTable
->ConfigurationTable
[Index
].VendorGuid
))) {
78 *Table
= SystemTable
->ConfigurationTable
[Index
].VendorTable
;
87 This function causes the notification function to be executed for every protocol
88 of type ProtocolGuid instance that exists in the system when this function is
89 invoked. In addition, every time a protocol of type ProtocolGuid instance is
90 installed or reinstalled, the notification function is also executed.
92 @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
93 @param NotifyTpl Supplies the task priority level of the event notifications.
94 @param NotifyFunction Supplies the function to notify when the event is signaled.
95 @param NotifyContext The context parameter to pass to NotifyFunction.
96 @param Registration A pointer to a memory location to receive the registration value.
98 @return The notification event that was created.
103 EfiCreateProtocolNotifyEvent(
104 IN EFI_GUID
*ProtocolGuid
,
105 IN EFI_TPL NotifyTpl
,
106 IN EFI_EVENT_NOTIFY NotifyFunction
,
107 IN VOID
*NotifyContext
, OPTIONAL
108 OUT VOID
**Registration
118 Status
= gBS
->CreateEvent (
125 ASSERT_EFI_ERROR (Status
);
128 // Register for protocol notifactions on this event
131 Status
= gBS
->RegisterProtocolNotify (
137 ASSERT_EFI_ERROR (Status
);
140 // Kick the event so we will perform an initial pass of
141 // current installed drivers
144 gBS
->SignalEvent (Event
);
149 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
150 This event is signaled with EfiNamedEventSignal(). This provide the ability for
151 one or more listeners on the same event named by the GUID specified by Name.
153 @param Name Supplies GUID name of the event.
154 @param NotifyTpl Supplies the task priority level of the event notifications.
155 @param NotifyFunction Supplies the function to notify when the event is signaled.
156 @param NotifyContext The context parameter to pass to NotifyFunction.
157 @param Registration A pointer to a memory location to receive the registration value.
159 @retval EFI_SUCCESS A named event was created.
160 @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.
165 EfiNamedEventListen (
166 IN CONST EFI_GUID
*Name
,
167 IN EFI_TPL NotifyTpl
,
168 IN EFI_EVENT_NOTIFY NotifyFunction
,
169 IN CONST VOID
*NotifyContext
, OPTIONAL
170 OUT VOID
*Registration OPTIONAL
175 VOID
*RegistrationLocal
;
180 Status
= gBS
->CreateEvent (
184 (VOID
*) NotifyContext
,
187 ASSERT_EFI_ERROR (Status
);
190 // The Registration is not optional to RegisterProtocolNotify().
191 // To make it optional to EfiNamedEventListen(), may need to substitute with a local.
193 if (Registration
!= NULL
) {
194 RegistrationLocal
= Registration
;
196 RegistrationLocal
= &RegistrationLocal
;
200 // Register for an installation of protocol interface
203 Status
= gBS
->RegisterProtocolNotify (
208 ASSERT_EFI_ERROR (Status
);
214 This function signals the named event specified by Name. The named event must
215 have been created with EfiNamedEventListen().
217 @param Name Supplies GUID name of the event.
219 @retval EFI_SUCCESS A named event was signaled.
220 @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.
225 EfiNamedEventSignal (
226 IN CONST EFI_GUID
*Name
233 Status
= gBS
->InstallProtocolInterface (
236 EFI_NATIVE_INTERFACE
,
239 ASSERT_EFI_ERROR (Status
);
241 Status
= gBS
->UninstallProtocolInterface (
246 ASSERT_EFI_ERROR (Status
);
252 Returns the current TPL.
254 This function returns the current TPL. There is no EFI service to directly
255 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
256 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
257 can then immediately be restored back to the current TPL level with a call
262 @retvale EFI_TPL The current TPL.
273 Tpl
= gBS
->RaiseTPL (TPL_HIGH_LEVEL
);
274 gBS
->RestoreTPL (Tpl
);
281 This function initializes a basic mutual exclusion lock to the released state
282 and returns the lock. Each lock provides mutual exclusion access at its task
283 priority level. Since there is no preemption or multiprocessor support in EFI,
284 acquiring the lock only consists of raising to the locks TPL.
286 @param Lock A pointer to the lock data structure to initialize.
287 @param Priority EFI TPL associated with the lock.
295 IN OUT EFI_LOCK
*Lock
,
299 ASSERT (Lock
!= NULL
);
300 ASSERT (Priority
<= TPL_HIGH_LEVEL
);
302 Lock
->Tpl
= Priority
;
303 Lock
->OwnerTpl
= TPL_APPLICATION
;
304 Lock
->Lock
= EfiLockReleased
;
309 This function raises the system's current task priority level to the task
310 priority level of the mutual exclusion lock. Then, it places the lock in the
313 @param Priority The task priority level of the lock.
322 ASSERT (Lock
!= NULL
);
323 ASSERT (Lock
->Lock
== EfiLockReleased
);
325 Lock
->OwnerTpl
= gBS
->RaiseTPL (Lock
->Tpl
);
326 Lock
->Lock
= EfiLockAcquired
;
330 This function raises the system's current task priority level to the task
331 priority level of the mutual exclusion lock. Then, it attempts to place the
332 lock in the acquired state.
334 @param Lock A pointer to the lock to acquire.
336 @retval EFI_SUCCESS The lock was acquired.
337 @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
342 EfiAcquireLockOrFail (
347 ASSERT (Lock
!= NULL
);
348 ASSERT (Lock
->Lock
!= EfiLockUninitialized
);
350 if (Lock
->Lock
== EfiLockAcquired
) {
352 // Lock is already owned, so bail out
354 return EFI_ACCESS_DENIED
;
357 Lock
->OwnerTpl
= gBS
->RaiseTPL (Lock
->Tpl
);
359 Lock
->Lock
= EfiLockAcquired
;
365 This function transitions a mutual exclusion lock from the acquired state to
366 the released state, and restores the system's task priority level to its
369 @param Lock A pointer to the lock to release.
380 ASSERT (Lock
!= NULL
);
381 ASSERT (Lock
->Lock
== EfiLockAcquired
);
383 Tpl
= Lock
->OwnerTpl
;
385 Lock
->Lock
= EfiLockReleased
;
387 gBS
->RestoreTPL (Tpl
);
391 Tests whether a controller handle is being managed by a specific driver.
393 This function tests whether the driver specified by DriverBindingHandle is
394 currently managing the controller specified by ControllerHandle. This test
395 is performed by evaluating if the the protocol specified by ProtocolGuid is
396 present on ControllerHandle and is was opened by DriverBindingHandle with an
397 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
398 If ProtocolGuid is NULL, then ASSERT().
400 @param ControllerHandle A handle for a controller to test.
401 @param DriverBindingHandle Specifies the driver binding handle for the
403 @param ProtocolGuid Specifies the protocol that the driver specified
404 by DriverBindingHandle opens in its Start()
407 @retval EFI_SUCCESS ControllerHandle is managed by the driver
408 specifed by DriverBindingHandle.
409 @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
410 specifed by DriverBindingHandle.
415 EfiTestManagedDevice (
416 IN CONST EFI_HANDLE ControllerHandle
,
417 IN CONST EFI_HANDLE DriverBindingHandle
,
418 IN CONST EFI_GUID
*ProtocolGuid
422 VOID
*ManagedInterface
;
424 ASSERT (ProtocolGuid
!= NULL
);
426 Status
= gBS
->OpenProtocol (
428 (EFI_GUID
*) ProtocolGuid
,
432 EFI_OPEN_PROTOCOL_BY_DRIVER
434 if (!EFI_ERROR (Status
)) {
437 (EFI_GUID
*) ProtocolGuid
,
441 return EFI_UNSUPPORTED
;
444 if (Status
!= EFI_ALREADY_STARTED
) {
445 return EFI_UNSUPPORTED
;
452 Tests whether a child handle is a child device of the controller.
454 This function tests whether ChildHandle is one of the children of
455 ControllerHandle. This test is performed by checking to see if the protocol
456 specified by ProtocolGuid is present on ControllerHandle and opened by
457 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
458 If ProtocolGuid is NULL, then ASSERT().
460 @param ControllerHandle A handle for a (parent) controller to test.
461 @param ChildHandle A child handle to test.
462 @param ConsumsedGuid Supplies the protocol that the child controller
463 opens on its parent controller.
465 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
466 @retval EFI_UNSUPPORTED ChildHandle is not a child of the
473 IN CONST EFI_HANDLE ControllerHandle
,
474 IN CONST EFI_HANDLE ChildHandle
,
475 IN CONST EFI_GUID
*ProtocolGuid
479 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
*OpenInfoBuffer
;
483 ASSERT (ProtocolGuid
!= NULL
);
486 // Retrieve the list of agents that are consuming the specific protocol
487 // on ControllerHandle.
489 Status
= gBS
->OpenProtocolInformation (
491 (EFI_GUID
*) ProtocolGuid
,
495 if (EFI_ERROR (Status
)) {
496 return EFI_UNSUPPORTED
;
500 // Inspect if ChildHandle is one of the agents.
502 Status
= EFI_UNSUPPORTED
;
503 for (Index
= 0; Index
< EntryCount
; Index
++) {
504 if ((OpenInfoBuffer
[Index
].ControllerHandle
== ChildHandle
) &&
505 (OpenInfoBuffer
[Index
].Attributes
& EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
) != 0) {
506 Status
= EFI_SUCCESS
;
511 FreePool (OpenInfoBuffer
);
516 This function looks up a Unicode string in UnicodeStringTable. If Language is
517 a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable
518 that matches the language code specified by Language, then it is returned in
521 @param Language A pointer to the ISO 639-2 language code for the
522 Unicode string to look up and return.
523 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
524 that the Unicode string table supports. Language
525 must be a member of this set.
526 @param UnicodeStringTable A pointer to the table of Unicode strings.
527 @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
528 that matches the language specified by Language.
530 @retval EFI_SUCCESS The Unicode string that matches the language
531 specified by Language was found
532 in the table of Unicoide strings UnicodeStringTable,
533 and it was returned in UnicodeString.
534 @retval EFI_INVALID_PARAMETER Language is NULL.
535 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
536 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
537 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
538 @retval EFI_UNSUPPORTED The language specified by Language is not a
539 member of SupportedLanguages.
540 @retval EFI_UNSUPPORTED The language specified by Language is not
541 supported by UnicodeStringTable.
546 LookupUnicodeString (
547 IN CONST CHAR8
*Language
,
548 IN CONST CHAR8
*SupportedLanguages
,
549 IN CONST EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
,
550 OUT CHAR16
**UnicodeString
554 // Make sure the parameters are valid
556 if (Language
== NULL
|| UnicodeString
== NULL
) {
557 return EFI_INVALID_PARAMETER
;
561 // If there are no supported languages, or the Unicode String Table is empty, then the
562 // Unicode String specified by Language is not supported by this Unicode String Table
564 if (SupportedLanguages
== NULL
|| UnicodeStringTable
== NULL
) {
565 return EFI_UNSUPPORTED
;
569 // Make sure Language is in the set of Supported Languages
571 while (*SupportedLanguages
!= 0) {
572 if (CompareIso639LanguageCode (Language
, SupportedLanguages
)) {
575 // Search the Unicode String Table for the matching Language specifier
577 while (UnicodeStringTable
->Language
!= NULL
) {
578 if (CompareIso639LanguageCode (Language
, UnicodeStringTable
->Language
)) {
581 // A matching string was found, so return it
583 *UnicodeString
= UnicodeStringTable
->UnicodeString
;
587 UnicodeStringTable
++;
590 return EFI_UNSUPPORTED
;
593 SupportedLanguages
+= 3;
596 return EFI_UNSUPPORTED
;
600 This function adds a Unicode string to UnicodeStringTable.
601 If Language is a member of SupportedLanguages then UnicodeString is added to
602 UnicodeStringTable. New buffers are allocated for both Language and
603 UnicodeString. The contents of Language and UnicodeString are copied into
604 these new buffers. These buffers are automatically freed when
605 FreeUnicodeStringTable() is called.
607 @param Language A pointer to the ISO 639-2 language code for the Unicode
609 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
610 that the Unicode string table supports.
611 Language must be a member of this set.
612 @param UnicodeStringTable A pointer to the table of Unicode strings.
613 @param UnicodeString A pointer to the Unicode string to add.
615 @retval EFI_SUCCESS The Unicode string that matches the language
616 specified by Language was found in the table of
617 Unicode strings UnicodeStringTable, and it was
618 returned in UnicodeString.
619 @retval EFI_INVALID_PARAMETER Language is NULL.
620 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
621 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
622 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
623 @retval EFI_ALREADY_STARTED A Unicode string with language Language is
624 already present in UnicodeStringTable.
625 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
626 Unicode string to UnicodeStringTable.
627 @retval EFI_UNSUPPORTED The language specified by Language is not a
628 member of SupportedLanguages.
634 IN CONST CHAR8
*Language
,
635 IN CONST CHAR8
*SupportedLanguages
,
636 IN EFI_UNICODE_STRING_TABLE
**UnicodeStringTable
,
637 IN CONST CHAR16
*UnicodeString
640 UINTN NumberOfEntries
;
641 EFI_UNICODE_STRING_TABLE
*OldUnicodeStringTable
;
642 EFI_UNICODE_STRING_TABLE
*NewUnicodeStringTable
;
643 UINTN UnicodeStringLength
;
646 // Make sure the parameter are valid
648 if (Language
== NULL
|| UnicodeString
== NULL
|| UnicodeStringTable
== NULL
) {
649 return EFI_INVALID_PARAMETER
;
653 // If there are no supported languages, then a Unicode String can not be added
655 if (SupportedLanguages
== NULL
) {
656 return EFI_UNSUPPORTED
;
660 // If the Unicode String is empty, then a Unicode String can not be added
662 if (UnicodeString
[0] == 0) {
663 return EFI_INVALID_PARAMETER
;
667 // Make sure Language is a member of SupportedLanguages
669 while (*SupportedLanguages
!= 0) {
670 if (CompareIso639LanguageCode (Language
, SupportedLanguages
)) {
673 // Determine the size of the Unicode String Table by looking for a NULL Language entry
676 if (*UnicodeStringTable
!= NULL
) {
677 OldUnicodeStringTable
= *UnicodeStringTable
;
678 while (OldUnicodeStringTable
->Language
!= NULL
) {
679 if (CompareIso639LanguageCode (Language
, OldUnicodeStringTable
->Language
)) {
680 return EFI_ALREADY_STARTED
;
683 OldUnicodeStringTable
++;
689 // Allocate space for a new Unicode String Table. It must hold the current number of
690 // entries, plus 1 entry for the new Unicode String, plus 1 entry for the end of table
693 NewUnicodeStringTable
= AllocatePool ((NumberOfEntries
+ 2) * sizeof (EFI_UNICODE_STRING_TABLE
));
694 if (NewUnicodeStringTable
== NULL
) {
695 return EFI_OUT_OF_RESOURCES
;
699 // If the current Unicode String Table contains any entries, then copy them to the
700 // newly allocated Unicode String Table.
702 if (*UnicodeStringTable
!= NULL
) {
704 NewUnicodeStringTable
,
706 NumberOfEntries
* sizeof (EFI_UNICODE_STRING_TABLE
)
711 // Allocate space for a copy of the Language specifier
713 NewUnicodeStringTable
[NumberOfEntries
].Language
= AllocateCopyPool (3, Language
);
714 if (NewUnicodeStringTable
[NumberOfEntries
].Language
== NULL
) {
715 gBS
->FreePool (NewUnicodeStringTable
);
716 return EFI_OUT_OF_RESOURCES
;
720 // Compute the length of the Unicode String
722 for (UnicodeStringLength
= 0; UnicodeString
[UnicodeStringLength
] != 0; UnicodeStringLength
++)
726 // Allocate space for a copy of the Unicode String
728 NewUnicodeStringTable
[NumberOfEntries
].UnicodeString
= AllocateCopyPool (
729 (UnicodeStringLength
+ 1) * sizeof (CHAR16
),
732 if (NewUnicodeStringTable
[NumberOfEntries
].UnicodeString
== NULL
) {
733 gBS
->FreePool (NewUnicodeStringTable
[NumberOfEntries
].Language
);
734 gBS
->FreePool (NewUnicodeStringTable
);
735 return EFI_OUT_OF_RESOURCES
;
739 // Mark the end of the Unicode String Table
741 NewUnicodeStringTable
[NumberOfEntries
+ 1].Language
= NULL
;
742 NewUnicodeStringTable
[NumberOfEntries
+ 1].UnicodeString
= NULL
;
745 // Free the old Unicode String Table
747 if (*UnicodeStringTable
!= NULL
) {
748 gBS
->FreePool (*UnicodeStringTable
);
752 // Point UnicodeStringTable at the newly allocated Unicode String Table
754 *UnicodeStringTable
= NewUnicodeStringTable
;
759 SupportedLanguages
+= 3;
762 return EFI_UNSUPPORTED
;
766 This function frees the table of Unicode strings in UnicodeStringTable.
767 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
768 Otherwise, each language code, and each Unicode string in the Unicode string
769 table are freed, and EFI_SUCCESS is returned.
771 @param UnicodeStringTable A pointer to the table of Unicode strings.
773 @retval EFI_SUCCESS The Unicode string table was freed.
778 FreeUnicodeStringTable (
779 IN EFI_UNICODE_STRING_TABLE
*UnicodeStringTable
785 // If the Unicode String Table is NULL, then it is already freed
787 if (UnicodeStringTable
== NULL
) {
792 // Loop through the Unicode String Table until we reach the end of table marker
794 for (Index
= 0; UnicodeStringTable
[Index
].Language
!= NULL
; Index
++) {
797 // Free the Language string from the Unicode String Table
799 gBS
->FreePool (UnicodeStringTable
[Index
].Language
);
802 // Free the Unicode String from the Unicode String Table
804 if (UnicodeStringTable
[Index
].UnicodeString
!= NULL
) {
805 gBS
->FreePool (UnicodeStringTable
[Index
].UnicodeString
);
810 // Free the Unicode String Table itself
812 gBS
->FreePool (UnicodeStringTable
);
818 Intialize a driver by installing the Driver Binding Protocol onto the
819 driver's DriverBindingHandle. This is typically the same as the driver's
820 ImageHandle, but it can be different if the driver produces multiple
821 DriverBinding Protocols. This function also initializes the EFI Driver
822 Library that initializes the global variables gST, gBS, gRT.
824 @param ImageHandle The image handle of the driver
825 @param SystemTable The EFI System Table that was passed to the driver's entry point
826 @param DriverBinding A Driver Binding Protocol instance that this driver is producing
827 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
828 parameter is NULL, then a new handle is created.
830 @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle
831 @retval Other Status from gBS->InstallProtocolInterface()
835 EfiLibInstallDriverBinding (
836 IN
const EFI_HANDLE ImageHandle
,
837 IN
const EFI_SYSTEM_TABLE
*SystemTable
,
838 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
839 IN EFI_HANDLE DriverBindingHandle
843 // bugbug:Need to implement ...
850 Intialize a driver by installing the Driver Binding Protocol onto the
851 driver's DriverBindingHandle. This is typically the same as the driver's
852 ImageHandle, but it can be different if the driver produces multiple
853 DriverBinding Protocols. This function also initializes the EFI Driver
854 Library that initializes the global variables gST, gBS, gRT.
856 @ImageHandle The image handle of the driver
857 @SystemTable The EFI System Table that was passed to the driver's entry point
858 @DriverBinding A Driver Binding Protocol instance that this driver is producing
859 @DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
860 parameter is NULL, then a new handle is created.
861 @ComponentName A Component Name Protocol instance that this driver is producing
862 @DriverConfiguration A Driver Configuration Protocol instance that this driver is producing
863 @DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing
865 @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle
866 @retval Other Status from gBS->InstallProtocolInterface()
870 EfiLibInstallAllDriverProtocols (
871 IN
const EFI_HANDLE ImageHandle
,
872 IN
const EFI_SYSTEM_TABLE
*SystemTable
,
873 IN EFI_DRIVER_BINDING_PROTOCOL
*DriverBinding
,
874 IN EFI_HANDLE DriverBindingHandle
,
875 IN
const EFI_COMPONENT_NAME_PROTOCOL
*ComponentName
, OPTIONAL
876 IN
const EFI_DRIVER_CONFIGURATION_PROTOCOL
*DriverConfiguration
, OPTIONAL
877 IN
const EFI_DRIVER_DIAGNOSTICS_PROTOCOL
*DriverDiagnostics OPTIONAL
881 // bugbug:Need to implement ...