]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/UefiLib.h
Comments synchronized
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
1 /** @file
2 Provides library functions for common UEFI operations. Only available to DXE
3 and UEFI module types.
4
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.
10
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
16
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.
19
20 **/
21
22 #ifndef __UEFI_LIB_H__
23 #define __UEFI_LIB_H__
24
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>
32
33 #include <Library/BaseLib.h>
34
35 ///
36 /// Unicode String Table
37 ///
38 typedef struct {
39 CHAR8 *Language;
40 CHAR16 *UnicodeString;
41 } EFI_UNICODE_STRING_TABLE;
42
43 ///
44 /// EFI Lock Status
45 ///
46 typedef enum {
47 EfiLockUninitialized = 0,
48 EfiLockReleased = 1,
49 EfiLockAcquired = 2
50 } EFI_LOCK_STATE;
51
52 ///
53 /// EFI Lock
54 ///
55 typedef struct {
56 EFI_TPL Tpl;
57 EFI_TPL OwnerTpl;
58 EFI_LOCK_STATE Lock;
59 } EFI_LOCK;
60
61 /**
62 Macro that returns the number of 100 ns units for a specified number of microseconds.
63 Useful for managing EFI timer events.
64
65 @param Microseconds Number of microseonds.
66
67 @return The number of 100 ns units equivalent to the number of microseconds specified
68 by Microseconds.
69
70 **/
71 #define EFI_TIMER_PERIOD_MICROSECONDS(Microseconds) MultU64x32((UINT64)(Microseconds), 10)
72
73 /**
74 Macro that returns the number of 100 ns units for a specified number of milliseoconds.
75 Useful for managing EFI timer events.
76
77 @param Milliseconds Number of milliseconds.
78
79 @return The number of 100 ns units equivalent to the number of milliseconds specified
80 by Milliseconds.
81
82 **/
83 #define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds) MultU64x32((UINT64)(Milliseconds), 10000)
84
85 /**
86 Macro that returns the number of 100 ns units for a specified number of seoconds.
87 Useful for managing EFI timer events.
88
89 @param Seconds Number of seconds.
90
91 @return The number of 100 ns units equivalent to the number of seconds specified
92 by Seconds.
93
94 **/
95 #define EFI_TIMER_PERIOD_SECONDS(Seconds) MultU64x32((UINT64)(Seconds), 10000000)
96
97 /**
98 Macro that returns the a pointer to the next EFI_MEMORY_DESCRIPTOR in an array
99 returned from GetMemoryMap().
100
101 @param MemoryDescriptor A pointer to an EFI_MEMORY_DESCRIPTOR.
102
103 @param Size The size, in bytes, of the current EFI_MEMORY_DESCRIPTOR.
104
105 @return A pointer to the next EFI_MEMORY_DESCRIPTOR.
106
107 **/
108 #define NEXT_MEMORY_DESCRIPTOR(MemoryDescriptor, Size) \
109 ((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) + (Size)))
110
111 /**
112 Retrieves a pointer to the system configuration table from the EFI System Table
113 based on a specified GUID.
114
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().
121
122 @param TableGuid Pointer to table's GUID type..
123 @param Table Pointer to the table associated with TableGuid in the EFI System Table.
124
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.
127
128 **/
129 EFI_STATUS
130 EFIAPI
131 EfiGetSystemConfigurationTable (
132 IN EFI_GUID *TableGuid,
133 OUT VOID **Table
134 );
135
136 /**
137 Creates and returns a notification event and registers that event with all the protocol
138 instances specified by ProtocolGuid.
139
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().
150
151
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.
159
160 @return The notification event that was created.
161
162 **/
163 EFI_EVENT
164 EFIAPI
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
171 );
172
173 /**
174 Creates a named event that can be signaled with EfiNamedEventSignal().
175
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().
182
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.
188
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.
191
192 **/
193 EFI_STATUS
194 EFIAPI
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
201 );
202
203 /**
204 Signals a named event created with EfiNamedEventListen().
205
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().
209
210 @param Name Supplies GUID name of the event.
211
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.
214
215 **/
216 EFI_STATUS
217 EFIAPI
218 EfiNamedEventSignal (
219 IN CONST EFI_GUID *Name
220 );
221
222 /**
223 Returns the current TPL.
224
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
229 to RestoreTPL().
230
231 @return The current TPL.
232
233 **/
234 EFI_TPL
235 EFIAPI
236 EfiGetCurrentTpl (
237 VOID
238 );
239
240 /**
241 Initializes a basic mutual exclusion lock.
242
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().
249
250 @param Lock A pointer to the lock data structure to initialize.
251 @param Priority EFI TPL associated with the lock.
252
253 @return The lock.
254
255 **/
256 EFI_LOCK *
257 EFIAPI
258 EfiInitializeLock (
259 IN OUT EFI_LOCK *Lock,
260 IN EFI_TPL Priority
261 );
262
263 /**
264 Initializes a basic mutual exclusion lock.
265
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.
270
271 @param Priority The task priority level of the lock.
272
273 @return The lock.
274
275 **/
276 #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \
277 {Priority, TPL_APPLICATION, EfiLockReleased }
278
279
280 /**
281 Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
282
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().
288
289 @param LockParameter A pointer to the lock to acquire.
290
291 **/
292 #define ASSERT_LOCKED(LockParameter) \
293 do { \
294 if (DebugAssertEnabled ()) { \
295 ASSERT (LockParameter != NULL); \
296 if ((LockParameter)->Lock != EfiLockAcquired) { \
297 _ASSERT (LockParameter not locked); \
298 } \
299 } \
300 } while (FALSE)
301
302
303 /**
304 Acquires ownership of a lock.
305
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
308 acquired state.
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().
312
313 @param Lock A pointer to the lock to acquire.
314
315 **/
316 VOID
317 EFIAPI
318 EfiAcquireLock (
319 IN EFI_LOCK *Lock
320 );
321
322 /**
323 Acquires ownership of a lock.
324
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().
331
332 @param Lock A pointer to the lock to acquire.
333
334 @retval EFI_SUCCESS The lock was acquired.
335 @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
336
337 **/
338 EFI_STATUS
339 EFIAPI
340 EfiAcquireLockOrFail (
341 IN EFI_LOCK *Lock
342 );
343
344 /**
345 Releases ownership of a lock.
346
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
349 previous level.
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().
353
354 @param Lock A pointer to the lock to release.
355
356 **/
357 VOID
358 EFIAPI
359 EfiReleaseLock (
360 IN EFI_LOCK *Lock
361 );
362
363 /**
364 Tests whether a controller handle is being managed by a specific driver.
365
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().
372
373 @param ControllerHandle A handle for a controller to test.
374 @param DriverBindingHandle Specifies the driver binding handle for the
375 driver.
376 @param ProtocolGuid Specifies the protocol that the driver specified
377 by DriverBindingHandle opens in its Start()
378 function.
379
380 @retval EFI_SUCCESS ControllerHandle is managed by the driver
381 specifed by DriverBindingHandle.
382 @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
383 specifed by DriverBindingHandle.
384
385 **/
386 EFI_STATUS
387 EFIAPI
388 EfiTestManagedDevice (
389 IN CONST EFI_HANDLE ControllerHandle,
390 IN CONST EFI_HANDLE DriverBindingHandle,
391 IN CONST EFI_GUID *ProtocolGuid
392 );
393
394 /**
395 Tests whether a child handle is a child device of the controller.
396
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().
402
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.
407
408 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
409 @retval EFI_UNSUPPORTED ChildHandle is not a child of the
410 ControllerHandle.
411
412 **/
413 EFI_STATUS
414 EFIAPI
415 EfiTestChildHandle (
416 IN CONST EFI_HANDLE ControllerHandle,
417 IN CONST EFI_HANDLE ChildHandle,
418 IN CONST EFI_GUID *ProtocolGuid
419 );
420
421 /**
422 This function looks up a Unicode string in UnicodeStringTable.
423
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.
427
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.
436
437 @retval EFI_SUCCESS The Unicode string that matches the language
438 specified by Language was found
439 in the table of Unicoide 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.
449
450 **/
451 EFI_STATUS
452 EFIAPI
453 LookupUnicodeString (
454 IN CONST CHAR8 *Language,
455 IN CONST CHAR8 *SupportedLanguages,
456 IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable,
457 OUT CHAR16 **UnicodeString
458 );
459
460 /**
461 This function looks up a Unicode string in UnicodeStringTable.
462
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.
466
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 chacters 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.
487
488
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.
498
499 **/
500 EFI_STATUS
501 EFIAPI
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
508 );
509
510 /**
511 This function adds a Unicode string to UnicodeStringTable.
512
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.
518
519 @param Language A pointer to the ISO 639-2 language code for the Unicode
520 string to add.
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.
526
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.
541
542 **/
543 EFI_STATUS
544 EFIAPI
545 AddUnicodeString (
546 IN CONST CHAR8 *Language,
547 IN CONST CHAR8 *SupportedLanguages,
548 IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable,
549 IN CONST CHAR16 *UnicodeString
550 );
551
552 /**
553 This function adds the Null-terminated Unicode string specified by UnicodeString
554 to UnicodeStringTable.
555
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.
560
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.
580
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
589 UnicodeStringTable.
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.
592
593 **/
594 EFI_STATUS
595 EFIAPI
596 AddUnicodeString2 (
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
602 );
603
604 /**
605 This function frees the table of Unicode strings in UnicodeStringTable.
606
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.
610
611 @param UnicodeStringTable A pointer to the table of Unicode strings.
612
613 @retval EFI_SUCCESS The Unicode string table was freed.
614
615 **/
616 EFI_STATUS
617 EFIAPI
618 FreeUnicodeStringTable (
619 IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable
620 );
621
622 /**
623 Retrieves the width of a Unicode character.
624
625 This function computes and returns the width of the Unicode character specified
626 by UnicodeChar.
627
628 @param UnicodeChar A Unicode character.
629
630 @retval 0 The width if UnicodeChar could not be determined.
631 @retval 1 UnicodeChar is a narrow glyph.
632 @retval 2 UnicodeChar is a wide glyph.
633
634 **/
635 UINTN
636 EFIAPI
637 GetGlyphWidth (
638 IN CHAR16 UnicodeChar
639 );
640
641 /**
642 Computes the display length of a Null-terminated Unicode String.
643
644 This function computes and returns the display length of the Null-terminated Unicode
645 string specified by String. If String is NULL then 0 is returned. If any of the widths
646 of the Unicode characters in String can not be determined, then 0 is returned. The display
647 width of String can be computed by summing the display widths of each Unicode character
648 in String. Unicode characters that are narrow glyphs have a width of 1, and Unicode
649 characters that are width glyphs have a width of 2.
650 If String is not aligned on a 16-bit boundary, then ASSERT().
651
652 @param String A pointer to a Null-terminated Unicode string.
653
654 @return The display length of the Null-terminated Unicode string specified by String.
655
656 **/
657 UINTN
658 EFIAPI
659 UnicodeStringDisplayLength (
660 IN CONST CHAR16 *String
661 );
662
663 //
664 // Functions that abstract early Framework contamination of UEFI.
665 //
666 /**
667 Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot().
668
669 This function abstracts the signaling of the Ready to Boot Event. The Framework moved
670 from a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller
671 from how this event is created to prevent to code form having to change with the
672 version of the specification supported.
673
674 **/
675 VOID
676 EFIAPI
677 EfiSignalEventReadyToBoot (
678 VOID
679 );
680
681 /**
682 Create, Signal, and Close the Ready to Boot event using EfiSignalEventLegacyBoot().
683
684 This function abstracts the signaling of the Legacy Boot Event. The Framework moved from
685 a proprietary to UEFI 2.0 based mechanism. This library abstracts the caller from how
686 this event is created to prevent to code form having to change with the version of the
687 specification supported.
688
689 **/
690 VOID
691 EFIAPI
692 EfiSignalEventLegacyBoot (
693 VOID
694 );
695
696 /**
697 Creates an EFI event in the Legacy Boot Event Group.
698
699 Prior to UEFI 2.0 this was done via a non blessed UEFI extensions and this library
700 abstracts the implementation mechanism of this event from the caller. This function
701 abstracts the creation of the Legacy Boot Event. The Framework moved from a proprietary
702 to UEFI 2.0 based mechanism. This library abstracts the caller from how this event
703 is created to prevent to code form having to change with the version of the
704 specification supported.
705 If LegacyBootEvent is NULL, then ASSERT().
706
707 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
708
709 @retval EFI_SUCCESS Event was created.
710 @retval Other Event was not created.
711
712 **/
713 EFI_STATUS
714 EFIAPI
715 EfiCreateEventLegacyBoot (
716 OUT EFI_EVENT *LegacyBootEvent
717 );
718
719 /**
720 Create an EFI event in the Legacy Boot Event Group and allows
721 the caller to specify a notification function.
722
723 This function abstracts the creation of the Legacy Boot Event.
724 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
725 This library abstracts the caller from how this event is created to prevent
726 to code form having to change with the version of the specification supported.
727 If LegacyBootEvent is NULL, then ASSERT().
728
729 @param NotifyTpl The task priority level of the event.
730 @param NotifyFunction The notification function to call when the event is signaled.
731 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
732 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
733
734 @retval EFI_SUCCESS Event was created.
735 @retval Other Event was not created.
736
737 **/
738 EFI_STATUS
739 EFIAPI
740 EfiCreateEventLegacyBootEx (
741 IN EFI_TPL NotifyTpl,
742 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
743 IN VOID *NotifyContext, OPTIONAL
744 OUT EFI_EVENT *LegacyBootEvent
745 );
746
747 /**
748 Create an EFI event in the Ready To Boot Event Group.
749
750 Prior to UEFI 2.0 this was done via a non-standard UEFI extension, and this library
751 abstracts the implementation mechanism of this event from the caller.
752 This function abstracts the creation of the Ready to Boot Event. The Framework
753 moved from a proprietary to UEFI 2.0-based mechanism. This library abstracts
754 the caller from how this event is created to prevent the code form having to
755 change with the version of the specification supported.
756 If ReadyToBootEvent is NULL, then ASSERT().
757
758 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
759
760 @retval EFI_SUCCESS Event was created.
761 @retval Other Event was not created.
762
763 **/
764 EFI_STATUS
765 EFIAPI
766 EfiCreateEventReadyToBoot (
767 OUT EFI_EVENT *ReadyToBootEvent
768 );
769
770 /**
771 Create an EFI event in the Ready To Boot Event Group and allows
772 the caller to specify a notification function.
773
774 This function abstracts the creation of the Ready to Boot Event.
775 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
776 This library abstracts the caller from how this event is created to prevent
777 to code form having to change with the version of the specification supported.
778 If ReadyToBootEvent is NULL, then ASSERT().
779
780 @param NotifyTpl The task priority level of the event.
781 @param NotifyFunction The notification function to call when the event is signaled.
782 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
783 @param ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
784
785 @retval EFI_SUCCESS Event was created.
786 @retval Other Event was not created.
787
788 **/
789 EFI_STATUS
790 EFIAPI
791 EfiCreateEventReadyToBootEx (
792 IN EFI_TPL NotifyTpl,
793 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
794 IN VOID *NotifyContext, OPTIONAL
795 OUT EFI_EVENT *ReadyToBootEvent
796 );
797
798 /**
799 Initialize a Firmware Volume (FV) Media Device Path node.
800
801 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
802 This library function abstracts initializing a device path node.
803 Initialize the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure. This device
804 path changed in the DXE CIS version 0.92 in a non back ward compatible way to
805 not conflict with the UEFI 2.0 specification. This function abstracts the
806 differences from the caller.
807 If FvDevicePathNode is NULL, then ASSERT().
808 If NameGuid is NULL, then ASSERT().
809
810 @param FvDevicePathNode Pointer to a FV device path node to initialize
811 @param NameGuid FV file name to use in FvDevicePathNode
812
813 **/
814 VOID
815 EFIAPI
816 EfiInitializeFwVolDevicepathNode (
817 IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,
818 IN CONST EFI_GUID *NameGuid
819 );
820
821 /**
822 Check to see if the Firmware Volume (FV) Media Device Path is valid
823
824 The Framework FwVol Device Path changed to conform to the UEFI 2.0 specification.
825 This library function abstracts validating a device path node.
826 Check the MEDIA_FW_VOL_FILEPATH_DEVICE_PATH data structure to see if it's valid.
827 If it is valid, then return the GUID file name from the device path node. Otherwise,
828 return NULL. This device path changed in the DXE CIS version 0.92 in a non back ward
829 compatible way to not conflict with the UEFI 2.0 specification. This function abstracts
830 the differences from the caller.
831 If FvDevicePathNode is NULL, then ASSERT().
832
833 @param FvDevicePathNode Pointer to FV device path to check.
834
835 @retval NULL FvDevicePathNode is not valid.
836 @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
837
838 **/
839 EFI_GUID *
840 EFIAPI
841 EfiGetNameGuidFromFwVolDevicePathNode (
842 IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode
843 );
844
845 /**
846 Prints a formatted Unicode string to the console output device specified by
847 ConOut defined in the EFI_SYSTEM_TABLE.
848
849 This function prints a formatted Unicode string to the console output device
850 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
851 characters that printed to ConOut. If the length of the formatted Unicode
852 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
853 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
854 If Format is NULL, then ASSERT().
855 If Format is not aligned on a 16-bit boundary, then ASSERT().
856
857 @param Format Null-terminated Unicode format string.
858 @param ... Variable argument list whose contents are accessed based
859 on the format string specified by Format.
860
861 @return Number of Unicode characters printed to ConOut.
862
863 **/
864 UINTN
865 EFIAPI
866 Print (
867 IN CONST CHAR16 *Format,
868 ...
869 );
870
871 /**
872 Prints a formatted Unicode string to the console output device specified by
873 StdErr defined in the EFI_SYSTEM_TABLE.
874
875 This function prints a formatted Unicode string to the console output device
876 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
877 characters that printed to StdErr. If the length of the formatted Unicode
878 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
879 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
880 If Format is NULL, then ASSERT().
881 If Format is not aligned on a 16-bit boundary, then ASSERT().
882
883 @param Format Null-terminated Unicode format string.
884 @param ... Variable argument list whose contents are accessed based
885 on the format string specified by Format.
886
887 @return Number of Unicode characters printed to StdErr.
888
889 **/
890 UINTN
891 EFIAPI
892 ErrorPrint (
893 IN CONST CHAR16 *Format,
894 ...
895 );
896
897 /**
898 Prints a formatted ASCII string to the console output device specified by
899 ConOut defined in the EFI_SYSTEM_TABLE.
900
901 This function prints a formatted ASCII string to the console output device
902 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
903 characters that printed to ConOut. If the length of the formatted ASCII
904 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
905 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
906 If Format is NULL, then ASSERT().
907
908 @param Format Null-terminated ASCII format string.
909 @param ... Variable argument list whose contents are accessed based
910 on the format string specified by Format.
911
912 @return Number of ASCII characters printed to ConOut.
913
914 **/
915 UINTN
916 EFIAPI
917 AsciiPrint (
918 IN CONST CHAR8 *Format,
919 ...
920 );
921
922 /**
923 Prints a formatted ASCII string to the console output device specified by
924 StdErr defined in the EFI_SYSTEM_TABLE.
925
926 This function prints a formatted ASCII string to the console output device
927 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
928 characters that printed to StdErr. If the length of the formatted ASCII
929 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
930 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
931 If Format is NULL, then ASSERT().
932
933 @param Format Null-terminated ASCII format string.
934 @param ... Variable argument list whose contents are accessed based
935 on the format string specified by Format.
936
937 @return Number of ASCII characters printed to ConErr.
938
939 **/
940 UINTN
941 EFIAPI
942 AsciiErrorPrint (
943 IN CONST CHAR8 *Format,
944 ...
945 );
946
947 /**
948 Prints a formatted Unicode string to a graphics console device specified by
949 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
950
951 This function prints a formatted Unicode string to the graphics console device
952 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
953 Unicode characters printed. If the length of the formatted Unicode string is
954 greater than PcdUefiLibMaxPrintBufferSize, then only the first
955 PcdUefiLibMaxPrintBufferSize characters are printed. The EFI_HII_FONT_PROTOCOL
956 is used to convert the string to a bitmap using the glyphs registered with the
957 HII database. No wrapping is performed, so any portions of the string the fall
958 outside the active display region will not be displayed.
959
960 If a graphics console device is not associated with the ConsoleOutputHandle
961 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
962 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
963 string is printed, and 0 is returned.
964 If Format is NULL, then ASSERT().
965 If Format is not aligned on a 16-bit boundary, then ASSERT().
966
967 @param X X coordinate to print the string.
968 @param Y Y coordinate to print the string.
969 @param ForeGround The forground color of the string being printed. This is
970 an optional parameter that may be NULL. If it is NULL,
971 then the foreground color of the current ConOut device
972 in the EFI_SYSTEM_TABLE is used.
973 @param BackGround The background color of the string being printed. This is
974 an optional parameter that may be NULL. If it is NULL,
975 then the background color of the current ConOut device
976 in the EFI_SYSTEM_TABLE is used.
977 @param Format Null-terminated Unicode format string. See Print Library
978 for the supported format string syntax.
979 @param ... Variable argument list whose contents are accessed based on
980 the format string specified by Format.
981
982 @return The number of Unicode characters printed.
983
984 **/
985 UINTN
986 EFIAPI
987 PrintXY (
988 IN UINTN X,
989 IN UINTN Y,
990 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ForeGround, OPTIONAL
991 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BackGround, OPTIONAL
992 IN CONST CHAR16 *Format,
993 ...
994 );
995
996 /**
997 Prints a formatted ASCII string to a graphics console device specified by
998 ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.
999
1000 This function prints a formatted ASCII string to the graphics console device
1001 specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of
1002 ASCII characters printed. If the length of the formatted ASCII string is
1003 greater than PcdUefiLibMaxPrintBufferSize, then only the first
1004 PcdUefiLibMaxPrintBufferSize characters are printed. The EFI_HII_FONT_PROTOCOL
1005 is used to convert the string to a bitmap using the glyphs registered with the
1006 HII database. No wrapping is performed, so any portions of the string the fall
1007 outside the active display region will not be displayed.
1008
1009 If a graphics console device is not associated with the ConsoleOutputHandle
1010 defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.
1011 If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no
1012 string is printed, and 0 is returned.
1013 If Format is NULL, then ASSERT().
1014
1015 @param X X coordinate to print the string.
1016 @param Y Y coordinate to print the string.
1017 @param ForeGround The forground color of the string being printed. This is
1018 an optional parameter that may be NULL. If it is NULL,
1019 then the foreground color of the current ConOut device
1020 in the EFI_SYSTEM_TABLE is used.
1021 @param BackGround The background color of the string being printed. This is
1022 an optional parameter that may be NULL. If it is NULL,
1023 then the background color of the current ConOut device
1024 in the EFI_SYSTEM_TABLE is used.
1025 @param Format Null-terminated ASCII format string. See Print Library
1026 for the supported format string syntax.
1027 @param ... Variable argument list whose contents are accessed based on
1028 the format string specified by Format.
1029
1030 @return The number of ASCII characters printed.
1031
1032 **/
1033 UINTN
1034 EFIAPI
1035 AsciiPrintXY (
1036 IN UINTN X,
1037 IN UINTN Y,
1038 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ForeGround, OPTIONAL
1039 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BackGround, OPTIONAL
1040 IN CONST CHAR8 *Format,
1041 ...
1042 );
1043
1044 /**
1045 Installs and completes the initialization of a Driver Binding Protocol instance.
1046
1047 Installs the Driver Binding Protocol specified by DriverBinding onto the handle
1048 specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding
1049 is installed onto a newly created handle. DriverBindingHandle is typically the same
1050 as the driver's ImageHandle, but it can be different if the driver produces multiple
1051 Driver Binding Protocols.
1052 If DriverBinding is NULL, then ASSERT().
1053 If DriverBinding can not be installed onto a handle, then ASSERT().
1054
1055 @param ImageHandle The image handle of the driver.
1056 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1057 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1058 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1059 parameter is NULL, then a new handle is created.
1060
1061 @retval EFI_SUCCESS The protocol installation is completed successfully.
1062 @retval EFI_OUT_OF_RESOURCES There was not enough system resources to install the protocol.
1063 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().
1064
1065 **/
1066 EFI_STATUS
1067 EFIAPI
1068 EfiLibInstallDriverBinding (
1069 IN CONST EFI_HANDLE ImageHandle,
1070 IN CONST EFI_SYSTEM_TABLE *SystemTable,
1071 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
1072 IN EFI_HANDLE DriverBindingHandle
1073 );
1074
1075
1076 /**
1077 Installs and completes the initialization of a Driver Binding Protocol instance and
1078 optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.
1079
1080 Initializes a driver by installing the Driver Binding Protocol together with the
1081 optional Component Name, optional Driver Configure and optional Driver Diagnostic
1082 Protocols onto the driver's DriverBindingHandle. If DriverBindingHandle is NULL,
1083 then the protocols are installed onto a newly created handle. DriverBindingHandle
1084 is typically the same as the driver's ImageHandle, but it can be different if the
1085 driver produces multiple Driver Binding Protocols.
1086 If DriverBinding is NULL, then ASSERT().
1087 If the installation fails, then ASSERT().
1088
1089 @param ImageHandle The image handle of the driver.
1090 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1091 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1092 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1093 parameter is NULL, then a new handle is created.
1094 @param ComponentName A Component Name Protocol instance that this driver is producing.
1095 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
1096 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
1097
1098 @retval EFI_SUCCESS The protocol installation is completed successfully.
1099 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
1100
1101 **/
1102 EFI_STATUS
1103 EFIAPI
1104 EfiLibInstallAllDriverProtocols (
1105 IN CONST EFI_HANDLE ImageHandle,
1106 IN CONST EFI_SYSTEM_TABLE *SystemTable,
1107 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
1108 IN EFI_HANDLE DriverBindingHandle,
1109 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
1110 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL
1111 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL
1112 );
1113
1114
1115
1116 /**
1117 Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.
1118
1119 Initializes a driver by installing the Driver Binding Protocol together with the
1120 optional Component Name and optional Component Name 2 protocols onto the driver's
1121 DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed
1122 onto a newly created handle. DriverBindingHandle is typically the same as the driver's
1123 ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols.
1124 If DriverBinding is NULL, then ASSERT().
1125 If the installation fails, then ASSERT().
1126
1127 @param ImageHandle The image handle of the driver.
1128 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1129 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1130 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this
1131 parameter is NULL, then a new handle is created.
1132 @param ComponentName A Component Name Protocol instance that this driver is producing.
1133 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
1134
1135 @retval EFI_SUCCESS The protocol installation is completed successfully.
1136 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
1137
1138 **/
1139 EFI_STATUS
1140 EFIAPI
1141 EfiLibInstallDriverBindingComponentName2 (
1142 IN CONST EFI_HANDLE ImageHandle,
1143 IN CONST EFI_SYSTEM_TABLE *SystemTable,
1144 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
1145 IN EFI_HANDLE DriverBindingHandle,
1146 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
1147 IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL
1148 );
1149
1150
1151 /**
1152 Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver
1153 Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.
1154
1155 Initializes a driver by installing the Driver Binding Protocol together with the optional
1156 Component Name, optional Component Name 2, optional Driver Configuration, optional Driver Configuration 2,
1157 optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols onto the driver's DriverBindingHandle.
1158 DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver
1159 produces multiple Driver Binding Protocols.
1160 If DriverBinding is NULL, then ASSERT().
1161 If the installation fails, then ASSERT().
1162
1163
1164 @param ImageHandle The image handle of the driver.
1165 @param SystemTable The EFI System Table that was passed to the driver's entry point.
1166 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.
1167 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
1168 parameter is NULL, then a new handle is created.
1169 @param ComponentName A Component Name Protocol instance that this driver is producing.
1170 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.
1171 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.
1172 @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver is producing.
1173 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.
1174 @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.
1175
1176 @retval EFI_SUCCESS The protocol installation is completed successfully.
1177 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
1178
1179 **/
1180 EFI_STATUS
1181 EFIAPI
1182 EfiLibInstallAllDriverProtocols2 (
1183 IN CONST EFI_HANDLE ImageHandle,
1184 IN CONST EFI_SYSTEM_TABLE *SystemTable,
1185 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
1186 IN EFI_HANDLE DriverBindingHandle,
1187 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
1188 IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL
1189 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL
1190 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration2, OPTIONAL
1191 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, OPTIONAL
1192 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL
1193 );
1194
1195 #endif