]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/EdkDxePrintLib/PrintLib.c
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
25 // The package level header files this module uses
29 // The protocols, PPI and GUID defintions for this module
31 #include <Protocol/Print.h>
33 // The Library classes this module consumes
35 #include <Library/PrintLib.h>
36 #include <Library/UefiBootServicesTableLib.h>
38 static EFI_PRINT_PROTOCOL
*gPrintProtocol
= NULL
;
42 OUT CHAR16
*StartOfBuffer
,
44 IN
const CHAR16
*FormatString
,
51 VSPrint function to process format and place the results in Buffer. Since a
52 VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
53 this is the main print working routine
57 StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
59 BufferSize - Maximum number of characters to put into buffer. Zero means
62 FormatString - Unicode format string see file header for more details.
64 Marker - Vararg list consumed by processing Format.
68 Number of characters printed.
74 if (gPrintProtocol
== NULL
) {
75 Status
= gBS
->LocateProtocol (
76 &gEfiPrintProtocolGuid
,
78 (VOID
**)&gPrintProtocol
80 if (EFI_ERROR (Status
)) {
81 gPrintProtocol
= NULL
;
83 if (gPrintProtocol
== NULL
) {
87 return gPrintProtocol
->VSPrint (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
92 OUT CHAR16
*StartOfBuffer
,
94 IN
const CHAR16
*FormatString
,
102 VA_START (Marker
, FormatString
);
103 Return
= UnicodeVSPrint (StartOfBuffer
, BufferSize
, FormatString
, Marker
);
110 OUT CHAR8
*StartOfBuffer
,
112 IN
const CHAR8
*FormatString
,
119 VSPrint function to process format and place the results in Buffer. Since a
120 VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
121 this is the main print working routine
125 StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
127 BufferSize - Maximum number of characters to put into buffer. Zero means
130 FormatString - Unicode format string see file header for more details.
132 Marker - Vararg list consumed by processing Format.
136 Number of characters printed.
145 OUT CHAR8
*StartOfBuffer
,
147 IN
const CHAR8
*FormatString
,
155 VA_START (Marker
, FormatString
);
156 Return
= AsciiVSPrint (StartOfBuffer
, BufferSize
, FormatString
, Marker
);