]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/UefiLib.h
Remove prefix EFI_ from some TPL macros reference in some comments
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
1 /** @file
2 MDE UEFI library functions and macros
3
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
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.
12
13 **/
14
15 #ifndef __UEFI_LIB_H__
16 #define __UEFI_LIB_H__
17
18 #include <Protocol/DriverBinding.h>
19 #include <Protocol/DriverConfiguration.h>
20 #include <Protocol/ComponentName.h>
21 #include <Protocol/ComponentName2.h>
22 #include <Protocol/DriverDiagnostics.h>
23 #include <Protocol/DriverDiagnostics2.h>
24
25 //
26 // Unicode String Table
27 //
28 typedef struct {
29 CHAR8 *Language;
30 CHAR16 *UnicodeString;
31 } EFI_UNICODE_STRING_TABLE;
32
33 //
34 // EFI Lock Status
35 //
36 typedef enum {
37 EfiLockUninitialized = 0,
38 EfiLockReleased = 1,
39 EfiLockAcquired = 2
40 } EFI_LOCK_STATE;
41
42 //
43 // EFI Lock
44 //
45 typedef struct {
46 EFI_TPL Tpl;
47 EFI_TPL OwnerTpl;
48 EFI_LOCK_STATE Lock;
49 } EFI_LOCK;
50
51
52 /**
53 This function searches the list of configuration tables stored in the EFI System
54 Table for a table with a GUID that matches TableGuid. If a match is found,
55 then a pointer to the configuration table is returned in Table, and EFI_SUCCESS
56 is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned.
57
58 @param TableGuid Pointer to table's GUID type..
59 @param Table Pointer to the table associated with TableGuid in the EFI System Table.
60
61 @retval EFI_SUCCESS A configuration table matching TableGuid was found.
62 @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
63
64 **/
65 EFI_STATUS
66 EFIAPI
67 EfiGetSystemConfigurationTable (
68 IN EFI_GUID *TableGuid,
69 OUT VOID **Table
70 );
71
72 /**
73 This function causes the notification function to be executed for every protocol
74 of type ProtocolGuid instance that exists in the system when this function is
75 invoked. In addition, every time a protocol of type ProtocolGuid instance is
76 installed or reinstalled, the notification function is also executed.
77
78 @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
79 @param NotifyTpl Supplies the task priority level of the event notifications.
80 @param NotifyFunction Supplies the function to notify when the event is signaled.
81 @param NotifyContext The context parameter to pass to NotifyFunction.
82 @param Registration A pointer to a memory location to receive the registration value.
83
84 @return The notification event that was created.
85
86 **/
87 EFI_EVENT
88 EFIAPI
89 EfiCreateProtocolNotifyEvent(
90 IN EFI_GUID *ProtocolGuid,
91 IN EFI_TPL NotifyTpl,
92 IN EFI_EVENT_NOTIFY NotifyFunction,
93 IN VOID *NotifyContext, OPTIONAL
94 OUT VOID **Registration
95 );
96
97 /**
98 This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
99 This event is signaled with EfiNamedEventSignal(). This provide the ability for
100 one or more listeners on the same event named by the GUID specified by Name.
101
102 @param Name Supplies GUID name of the event.
103 @param NotifyTpl Supplies the task priority level of the event notifications.
104 @param NotifyFunction Supplies the function to notify when the event is signaled.
105 @param NotifyContext The context parameter to pass to NotifyFunction.
106 @param Registration A pointer to a memory location to receive the registration value.
107
108 @retval EFI_SUCCESS A named event was created.
109 @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.
110
111 **/
112 EFI_STATUS
113 EFIAPI
114 EfiNamedEventListen (
115 IN CONST EFI_GUID *Name,
116 IN EFI_TPL NotifyTpl,
117 IN EFI_EVENT_NOTIFY NotifyFunction,
118 IN CONST VOID *NotifyContext, OPTIONAL
119 OUT VOID *Registration OPTIONAL
120 );
121
122 /**
123 This function signals the named event specified by Name. The named event must
124 have been created with EfiNamedEventListen().
125
126 @param Name Supplies GUID name of the event.
127
128 @retval EFI_SUCCESS A named event was signaled.
129 @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.
130
131 **/
132 EFI_STATUS
133 EFIAPI
134 EfiNamedEventSignal (
135 IN CONST EFI_GUID *Name
136 );
137
138 /**
139 Returns the current TPL.
140
141 This function returns the current TPL. There is no EFI service to directly
142 retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
143 the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
144 can then immediately be restored back to the current TPL level with a call
145 to RestoreTPL().
146
147 @param VOID
148
149 @retvale EFI_TPL The current TPL.
150
151 **/
152 EFI_TPL
153 EFIAPI
154 EfiGetCurrentTpl (
155 VOID
156 );
157
158 /**
159 This function initializes a basic mutual exclusion lock to the released state
160 and returns the lock. Each lock provides mutual exclusion access at its task
161 priority level. Since there is no preemption or multiprocessor support in EFI,
162 acquiring the lock only consists of raising to the locks TPL.
163
164 @param Lock A pointer to the lock data structure to initialize.
165 @param Priority EFI TPL associated with the lock.
166
167 @return The lock.
168
169 **/
170 EFI_LOCK *
171 EFIAPI
172 EfiInitializeLock (
173 IN OUT EFI_LOCK *Lock,
174 IN EFI_TPL Priority
175 );
176
177 /**
178 This macro initializes the contents of a basic mutual exclusion lock to the
179 released state. Each lock provides mutual exclusion access at its task
180 priority level. Since there is no preemption or multiprocessor support in EFI,
181 acquiring the lock only consists of raising to the locks TPL.
182
183 @param Lock A pointer to the lock data structure to initialize.
184 @param Priority The task priority level of the lock.
185
186 @return The lock.
187
188 **/
189 #define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \
190 {Priority, TPL_APPLICATION, EfiLockReleased }
191
192
193 /**
194
195 Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
196
197 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
198 then this macro evaluates the EFI_LOCK structure specified by Lock. If Lock
199 is not in the locked state, then DebugAssert() is called passing in the source
200 filename, source line number, and Lock.
201
202 If Lock is NULL, then ASSERT().
203
204 @param LockParameter A pointer to the lock to acquire.
205
206 **/
207 #define ASSERT_LOCKED(LockParameter) \
208 do { \
209 if (DebugAssertEnabled ()) { \
210 ASSERT (LockParameter != NULL); \
211 if ((LockParameter)->Lock != EfiLockAcquired) { \
212 _ASSERT (LockParameter not locked); \
213 } \
214 } \
215 } while (FALSE)
216
217
218 /**
219 This function raises the system's current task priority level to the task
220 priority level of the mutual exclusion lock. Then, it places the lock in the
221 acquired state.
222
223 @param Priority The task priority level of the lock.
224
225 **/
226 VOID
227 EFIAPI
228 EfiAcquireLock (
229 IN EFI_LOCK *Lock
230 );
231
232 /**
233 This function raises the system's current task priority level to the task
234 priority level of the mutual exclusion lock. Then, it attempts to place the
235 lock in the acquired state.
236
237 @param Lock A pointer to the lock to acquire.
238
239 @retval EFI_SUCCESS The lock was acquired.
240 @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
241
242 **/
243 EFI_STATUS
244 EFIAPI
245 EfiAcquireLockOrFail (
246 IN EFI_LOCK *Lock
247 );
248
249 /**
250 This function transitions a mutual exclusion lock from the acquired state to
251 the released state, and restores the system's task priority level to its
252 previous level.
253
254 @param Lock A pointer to the lock to release.
255
256 **/
257 VOID
258 EFIAPI
259 EfiReleaseLock (
260 IN EFI_LOCK *Lock
261 );
262
263 /**
264 Tests whether a controller handle is being managed by a specific driver.
265
266 This function tests whether the driver specified by DriverBindingHandle is
267 currently managing the controller specified by ControllerHandle. This test
268 is performed by evaluating if the the protocol specified by ProtocolGuid is
269 present on ControllerHandle and is was opened by DriverBindingHandle with an
270 attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
271 If ProtocolGuid is NULL, then ASSERT().
272
273 @param ControllerHandle A handle for a controller to test.
274 @param DriverBindingHandle Specifies the driver binding handle for the
275 driver.
276 @param ProtocolGuid Specifies the protocol that the driver specified
277 by DriverBindingHandle opens in its Start()
278 function.
279
280 @retval EFI_SUCCESS ControllerHandle is managed by the driver
281 specifed by DriverBindingHandle.
282 @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
283 specifed by DriverBindingHandle.
284
285 **/
286 EFI_STATUS
287 EFIAPI
288 EfiTestManagedDevice (
289 IN CONST EFI_HANDLE ControllerHandle,
290 IN CONST EFI_HANDLE DriverBindingHandle,
291 IN CONST EFI_GUID *ProtocolGuid
292 );
293
294 /**
295 Tests whether a child handle is a child device of the controller.
296
297 This function tests whether ChildHandle is one of the children of
298 ControllerHandle. This test is performed by checking to see if the protocol
299 specified by ProtocolGuid is present on ControllerHandle and opened by
300 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
301 If ProtocolGuid is NULL, then ASSERT().
302
303 @param ControllerHandle A handle for a (parent) controller to test.
304 @param ChildHandle A child handle to test.
305 @param ConsumsedGuid Supplies the protocol that the child controller
306 opens on its parent controller.
307
308 @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
309 @retval EFI_UNSUPPORTED ChildHandle is not a child of the
310 ControllerHandle.
311
312 **/
313 EFI_STATUS
314 EFIAPI
315 EfiTestChildHandle (
316 IN CONST EFI_HANDLE ControllerHandle,
317 IN CONST EFI_HANDLE ChildHandle,
318 IN CONST EFI_GUID *ProtocolGuid
319 );
320
321 /**
322 This function looks up a Unicode string in UnicodeStringTable. If Language is
323 a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable
324 that matches the language code specified by Language, then it is returned in
325 UnicodeString.
326
327 @param Language A pointer to the ISO 639-2 language code for the
328 Unicode string to look up and return.
329 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
330 that the Unicode string table supports. Language
331 must be a member of this set.
332 @param UnicodeStringTable A pointer to the table of Unicode strings.
333 @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
334 that matches the language specified by Language.
335
336 @retval EFI_SUCCESS The Unicode string that matches the language
337 specified by Language was found
338 in the table of Unicoide strings UnicodeStringTable,
339 and it was returned in UnicodeString.
340 @retval EFI_INVALID_PARAMETER Language is NULL.
341 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
342 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
343 @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
344 @retval EFI_UNSUPPORTED The language specified by Language is not a
345 member of SupportedLanguages.
346 @retval EFI_UNSUPPORTED The language specified by Language is not
347 supported by UnicodeStringTable.
348
349 **/
350 EFI_STATUS
351 EFIAPI
352 LookupUnicodeString (
353 IN CONST CHAR8 *Language,
354 IN CONST CHAR8 *SupportedLanguages,
355 IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable,
356 OUT CHAR16 **UnicodeString
357 );
358
359 /**
360 This function adds a Unicode string to UnicodeStringTable.
361 If Language is a member of SupportedLanguages then UnicodeString is added to
362 UnicodeStringTable. New buffers are allocated for both Language and
363 UnicodeString. The contents of Language and UnicodeString are copied into
364 these new buffers. These buffers are automatically freed when
365 FreeUnicodeStringTable() is called.
366
367 @param Language A pointer to the ISO 639-2 language code for the Unicode
368 string to add.
369 @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
370 that the Unicode string table supports.
371 Language must be a member of this set.
372 @param UnicodeStringTable A pointer to the table of Unicode strings.
373 @param UnicodeString A pointer to the Unicode string to add.
374
375 @retval EFI_SUCCESS The Unicode string that matches the language
376 specified by Language was found in the table of
377 Unicode strings UnicodeStringTable, and it was
378 returned in UnicodeString.
379 @retval EFI_INVALID_PARAMETER Language is NULL.
380 @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
381 @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
382 @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
383 @retval EFI_ALREADY_STARTED A Unicode string with language Language is
384 already present in UnicodeStringTable.
385 @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
386 Unicode string to UnicodeStringTable.
387 @retval EFI_UNSUPPORTED The language specified by Language is not a
388 member of SupportedLanguages.
389
390 **/
391 EFI_STATUS
392 EFIAPI
393 AddUnicodeString (
394 IN CONST CHAR8 *Language,
395 IN CONST CHAR8 *SupportedLanguages,
396 IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable,
397 IN CONST CHAR16 *UnicodeString
398 );
399
400 /**
401 This function frees the table of Unicode strings in UnicodeStringTable.
402 If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
403 Otherwise, each language code, and each Unicode string in the Unicode string
404 table are freed, and EFI_SUCCESS is returned.
405
406 @param UnicodeStringTable A pointer to the table of Unicode strings.
407
408 @retval EFI_SUCCESS The Unicode string table was freed.
409
410 **/
411 EFI_STATUS
412 EFIAPI
413 FreeUnicodeStringTable (
414 IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable
415 );
416
417 /**
418 This function computes and returns the width of the Unicode character
419 specified by UnicodeChar.
420
421 @param UnicodeChar A Unicode character.
422
423 @retval 0 The width if UnicodeChar could not be determined.
424 @retval 1 UnicodeChar is a narrow glyph.
425 @retval 2 UnicodeChar is a wide glyph.
426
427 **/
428 UINTN
429 EFIAPI
430 GetGlyphWidth (
431 IN CHAR16 UnicodeChar
432 );
433
434 /**
435 This function computes and returns the display length of
436 the Null-terminated Unicode string specified by String.
437 If String is NULL, then 0 is returned.
438 If any of the widths of the Unicode characters in String
439 can not be determined, then 0 is returned.
440
441 @param String A pointer to a Null-terminated Unicode string.
442
443 @return The display length of the Null-terminated Unicode string specified by String.
444
445 **/
446 UINTN
447 EFIAPI
448 UnicodeStringDisplayLength (
449 IN CONST CHAR16 *String
450 );
451
452 //
453 // Functions that abstract early Framework contamination of UEFI.
454 //
455 /**
456 Signal a Ready to Boot Event.
457
458 Create a Ready to Boot Event. Signal it and close it. This causes other
459 events of the same event group to be signaled in other modules.
460
461 **/
462 VOID
463 EFIAPI
464 EfiSignalEventReadyToBoot (
465 VOID
466 );
467
468 /**
469 Signal a Legacy Boot Event.
470
471 Create a legacy Boot Event. Signal it and close it. This causes other
472 events of the same event group to be signaled in other modules.
473
474 **/
475 VOID
476 EFIAPI
477 EfiSignalEventLegacyBoot (
478 VOID
479 );
480
481 /**
482 Create a Legacy Boot Event.
483
484 Tiano extended the CreateEvent Type enum to add a legacy boot event type.
485 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
486 added and now it's possible to not voilate the UEFI specification by
487 declaring a GUID for the legacy boot event class. This library supports
488 the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to
489 work both ways.
490
491 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
492
493 @retval EFI_SUCCESS Event was created.
494 @retval Other Event was not created.
495
496 **/
497 EFI_STATUS
498 EFIAPI
499 EfiCreateEventLegacyBoot (
500 OUT EFI_EVENT *LegacyBootEvent
501 );
502
503 /**
504 Create an EFI event in the Legacy Boot Event Group and allows
505 the caller to specify a notification function.
506
507 This function abstracts the creation of the Legacy Boot Event.
508 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
509 This library abstracts the caller from how this event is created to prevent
510 to code form having to change with the version of the specification supported.
511 If LegacyBootEvent is NULL, then ASSERT().
512
513 @param NotifyTpl The task priority level of the event.
514 @param NotifyFunction The notification function to call when the event is signaled.
515 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
516 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
517
518 @retval EFI_SUCCESS Event was created.
519 @retval Other Event was not created.
520
521 **/
522 EFI_STATUS
523 EFIAPI
524 EfiCreateEventLegacyBootEx (
525 IN EFI_TPL NotifyTpl,
526 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
527 IN VOID *NotifyContext, OPTIONAL
528 OUT EFI_EVENT *LegacyBootEvent
529 );
530
531 /**
532 Create a Read to Boot Event.
533
534 Tiano extended the CreateEvent Type enum to add a ready to boot event type.
535 This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
536 added and now it's possible to not voilate the UEFI specification and use
537 the ready to boot event class defined in UEFI 2.0. This library supports
538 the EDK/EFI 1.10 form and EDKII/UEFI 2.0 form and allows common code to
539 work both ways.
540
541 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
542
543 @retval EFI_SUCCESS Event was created.
544 @retval Other Event was not created.
545
546 **/
547 EFI_STATUS
548 EFIAPI
549 EfiCreateEventReadyToBoot (
550 OUT EFI_EVENT *ReadyToBootEvent
551 );
552
553 /**
554 Create an EFI event in the Ready To Boot Event Group and allows
555 the caller to specify a notification function.
556
557 This function abstracts the creation of the Ready to Boot Event.
558 The Framework moved from a proprietary to UEFI 2.0 based mechanism.
559 This library abstracts the caller from how this event is created to prevent
560 to code form having to change with the version of the specification supported.
561 If ReadyToBootEvent is NULL, then ASSERT().
562
563 @param NotifyTpl The task priority level of the event.
564 @param NotifyFunction The notification function to call when the event is signaled.
565 @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
566 @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
567
568 @retval EFI_SUCCESS Event was created.
569 @retval Other Event was not created.
570
571 **/
572 EFI_STATUS
573 EFIAPI
574 EfiCreateEventReadyToBootEx (
575 IN EFI_TPL NotifyTpl,
576 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
577 IN VOID *NotifyContext, OPTIONAL
578 OUT EFI_EVENT *ReadyToBootEvent
579 );
580
581 /**
582 Initialize a Firmware Volume (FV) Media Device Path node.
583
584 Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
585 so as we move to UEFI 2.0 support we must use a mechanism that conforms with
586 the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
587 device path is defined for Tiano extensions of device path. If the code
588 is compiled to conform with the UEFI 2.0 specification use the new device path
589 else use the old form for backwards compatability.
590
591 @param FvDevicePathNode Pointer to a FV device path node to initialize
592 @param NameGuid FV file name to use in FvDevicePathNode
593
594 **/
595 VOID
596 EFIAPI
597 EfiInitializeFwVolDevicepathNode (
598 IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,
599 IN CONST EFI_GUID *NameGuid
600 );
601
602 /**
603 Check to see if the Firmware Volume (FV) Media Device Path is valid
604
605 Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
606 so as we move to UEFI 2.0 support we must use a mechanism that conforms with
607 the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
608 device path is defined for Tiano extensions of device path. If the code
609 is compiled to conform with the UEFI 2.0 specification use the new device path
610 else use the old form for backwards compatability. The return value to this
611 function points to a location in FvDevicePathNode and it does not allocate
612 new memory for the GUID pointer that is returned.
613
614 @param FvDevicePathNode Pointer to FV device path to check.
615
616 @retval NULL FvDevicePathNode is not valid.
617 @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
618
619 **/
620 EFI_GUID *
621 EFIAPI
622 EfiGetNameGuidFromFwVolDevicePathNode (
623 IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode
624 );
625
626 /**
627 Prints a formatted Unicode string to the console output device specified by
628 ConOut defined in the EFI_SYSTEM_TABLE.
629
630 This function prints a formatted Unicode string to the console output device
631 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
632 characters that printed to ConOut. If the length of the formatted Unicode
633 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
634 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
635
636 @param Format Null-terminated Unicode format string.
637 @param ... VARARG list consumed to process Format.
638 If Format is NULL, then ASSERT().
639 If Format is not aligned on a 16-bit boundary, then ASSERT().
640
641 **/
642 UINTN
643 EFIAPI
644 Print (
645 IN CONST CHAR16 *Format,
646 ...
647 );
648
649 /**
650 Prints a formatted Unicode string to the console output device specified by
651 StdErr defined in the EFI_SYSTEM_TABLE.
652
653 This function prints a formatted Unicode string to the console output device
654 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
655 characters that printed to StdErr. If the length of the formatted Unicode
656 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
657 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
658
659 @param Format Null-terminated Unicode format string.
660 @param ... VARARG list consumed to process Format.
661 If Format is NULL, then ASSERT().
662 If Format is not aligned on a 16-bit boundary, then ASSERT().
663
664 **/
665 UINTN
666 EFIAPI
667 ErrorPrint (
668 IN CONST CHAR16 *Format,
669 ...
670 );
671
672 /**
673 Prints a formatted ASCII string to the console output device specified by
674 ConOut defined in the EFI_SYSTEM_TABLE.
675
676 This function prints a formatted ASCII string to the console output device
677 specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
678 characters that printed to ConOut. If the length of the formatted ASCII
679 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
680 PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
681
682 @param Format Null-terminated ASCII format string.
683 @param ... VARARG list consumed to process Format.
684 If Format is NULL, then ASSERT().
685 If Format is not aligned on a 16-bit boundary, then ASSERT().
686
687 **/
688 UINTN
689 EFIAPI
690 AsciiPrint (
691 IN CONST CHAR8 *Format,
692 ...
693 );
694
695 /**
696 Prints a formatted ASCII string to the console output device specified by
697 StdErr defined in the EFI_SYSTEM_TABLE.
698
699 This function prints a formatted ASCII string to the console output device
700 specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
701 characters that printed to StdErr. If the length of the formatted ASCII
702 string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
703 PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
704
705 @param Format Null-terminated ASCII format string.
706 @param ... VARARG list consumed to process Format.
707 If Format is NULL, then ASSERT().
708 If Format is not aligned on a 16-bit boundary, then ASSERT().
709
710 **/
711 UINTN
712 EFIAPI
713 AsciiErrorPrint (
714 IN CONST CHAR8 *Format,
715 ...
716 );
717
718 /**
719 Intialize a driver by installing the Driver Binding Protocol onto the
720 driver's DriverBindingHandle. This is typically the same as the driver's
721 ImageHandle, but it can be different if the driver produces multiple
722 DriverBinding Protocols. This function also initializes the EFI Driver
723 Library that initializes the global variables gST, gBS, gRT.
724
725 @param ImageHandle The image handle of the driver
726 @param SystemTable The EFI System Table that was passed to the driver's entry point
727 @param DriverBinding A Driver Binding Protocol instance that this driver is producing
728 @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
729 parameter is NULL, then a new handle is created.
730
731 @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle
732 @retval Other Status from gBS->InstallProtocolInterface()
733
734 **/
735 EFI_STATUS
736 EFIAPI
737 EfiLibInstallDriverBinding (
738 IN CONST EFI_HANDLE ImageHandle,
739 IN CONST EFI_SYSTEM_TABLE *SystemTable,
740 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
741 IN EFI_HANDLE DriverBindingHandle
742 );
743
744 /**
745 Intialize a driver by installing the Driver Binding Protocol onto the
746 driver's DriverBindingHandle. This is typically the same as the driver's
747 ImageHandle, but it can be different if the driver produces multiple
748 DriverBinding Protocols. This function also initializes the EFI Driver
749 Library that initializes the global variables gST, gBS, gRT.
750
751 @ImageHandle The image handle of the driver
752 @SystemTable The EFI System Table that was passed to the driver's entry point
753 @DriverBinding A Driver Binding Protocol instance that this driver is producing
754 @DriverBindingHandle The handle that DriverBinding is to be installe onto. If this
755 parameter is NULL, then a new handle is created.
756 @ComponentName A Component Name Protocol instance that this driver is producing
757 @DriverConfiguration A Driver Configuration Protocol instance that this driver is producing
758 @DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing
759
760 @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle
761 @retval Other Status from gBS->InstallProtocolInterface()
762
763 **/
764 EFI_STATUS
765 EFIAPI
766 EfiLibInstallAllDriverProtocols (
767 IN CONST EFI_HANDLE ImageHandle,
768 IN CONST EFI_SYSTEM_TABLE *SystemTable,
769 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
770 IN EFI_HANDLE DriverBindingHandle,
771 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
772 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL
773 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL
774 );
775
776
777 /**
778 Intialize a driver by installing the Driver Binding Protocol
779 onto the driver's DriverBindingHandle. This is typically the
780 same as the driver's ImageHandle, but it can be different if
781 the driver produces multiple DriverBinding Protocols. This
782 function also initializes the EFI Driver Library that
783 initializes the global variables gST, gBS, gRT.
784
785 @ImageHandle The image handle of the driver
786
787 @SystemTable The EFI System Table that was
788 passed to the driver's entry
789 point
790
791 @DriverBinding A Driver Binding Protocol
792 instance that this driver is
793 producing
794
795 @DriverBindingHandle The handle that DriverBinding is
796 to be installe onto. If this
797 parameter is NULL, then a new
798 handle is created.
799
800 @ComponentName A Component Name Protocol
801 instance that this driver is
802 producing
803
804 @ComponentName2 A Component Name 2 Protocol
805 instance that this driver is
806 producing
807
808 @DriverConfiguration A Driver Configuration Protocol
809 instance that this driver is
810 producing
811
812 @DriverDiagnostics A Driver Diagnostics Protocol
813 instance that this driver is
814 producing
815
816 @DriverDiagnostics2 A Driver Diagnostics 2 Protocol
817 instance that this driver is
818 producing
819
820 @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle
821 @retval Other Status from gBS->InstallProtocolInterface()
822
823 **/
824 EFI_STATUS
825 EFIAPI
826 EfiLibInstallAllDriverProtocols2 (
827 IN CONST EFI_HANDLE ImageHandle,
828 IN CONST EFI_SYSTEM_TABLE *SystemTable,
829 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
830 IN EFI_HANDLE DriverBindingHandle,
831 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
832 IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL
833 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL
834 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, OPTIONAL
835 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL
836 );
837
838
839 #endif