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