UefiLibPrint.c revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
2362N/A Mde UEFI library API implementation. 0N/A Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE 0N/A Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR> 0N/A This program and the accompanying materials 2362N/A are licensed and made available under the terms and conditions of the BSD License 0N/A which accompanies this distribution. The full text of the license may be found at 0N/A THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 0N/A WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 0N/A {
0x00,
0x00,
0x00,
0x00 },
0N/A {
0x98,
0x00,
0x00,
0x00 },
2362N/A {
0x00,
0x98,
0x00,
0x00 },
2362N/A {
0x98,
0x98,
0x00,
0x00 },
2362N/A {
0x00,
0x00,
0x98,
0x00 },
0N/A {
0x98,
0x00,
0x98,
0x00 },
0N/A {
0x00,
0x98,
0x98,
0x00 },
0N/A {
0x98,
0x98,
0x98,
0x00 },
0N/A {
0x10,
0x10,
0x10,
0x00 },
0N/A {
0xff,
0x10,
0x10,
0x00 },
0N/A {
0x10,
0xff,
0x10,
0x00 },
0N/A {
0xff,
0xff,
0x10,
0x00 },
0N/A {
0x10,
0x10,
0xff,
0x00 },
0N/A {
0xf0,
0x10,
0xff,
0x00 },
0N/A {
0x10,
0xff,
0xff,
0x00 },
0N/A {
0xff,
0xff,
0xff,
0x00 }
0N/A Internal function which prints a formatted Unicode string to the console output device 0N/A specified by Console This function prints a formatted Unicode string to the console output device specified by Console and returns the number of Unicode characters that printed to it. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console. If Format is NULL, then ASSERT(). If Format is not aligned on a 16-bit boundary, then ASSERT(). @param Format Null-terminated Unicode format string. @param Console The output console. @param Marker VA_LIST marker for the variable argument list. @return The number of Unicode characters in the produced output buffer not including the Null-terminator. // To be extra safe make sure Console has been initialized Prints a formatted Unicode string to the console output device specified by ConOut defined in the EFI_SYSTEM_TABLE. This function prints a formatted Unicode string to the console output device specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode characters that printed to ConOut. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to ConOut. If Format is NULL, then ASSERT(). If Format is not aligned on a 16-bit boundary, then ASSERT(). If gST->ConOut is NULL, then ASSERT(). @param Format Null-terminated Unicode format string. @param ... Variable argument list whose contents are accessed based on the format string specified by Format. @return Number of Unicode characters printed to ConOut. Prints a formatted Unicode string to the console output device specified by StdErr defined in the EFI_SYSTEM_TABLE. This function prints a formatted Unicode string to the console output device specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode characters that printed to StdErr. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to StdErr. If Format is NULL, then ASSERT(). If Format is not aligned on a 16-bit boundary, then ASSERT(). If gST->StdErr is NULL, then ASSERT(). @param Format Null-terminated Unicode format string. @param ... Variable argument list whose contents are accessed based on the format string specified by Format. @return Number of Unicode characters printed to StdErr. Internal function which prints a formatted ASCII string to the console output device This function prints a formatted ASCII string to the console output device specified by Console and returns the number of ASCII characters that printed to it. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console. If Format is NULL, then ASSERT(). @param Format Null-terminated ASCII format string. @param Console The output console. @param Marker VA_LIST marker for the variable argument list. @return The number of Unicode characters in the produced output buffer not including the Null-terminator. // To be extra safe make sure Console has been initialized Prints a formatted ASCII string to the console output device specified by ConOut defined in the EFI_SYSTEM_TABLE. This function prints a formatted ASCII string to the console output device specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII characters that printed to ConOut. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to ConOut. If Format is NULL, then ASSERT(). If gST->ConOut is NULL, then ASSERT(). @param Format Null-terminated ASCII format string. @param ... Variable argument list whose contents are accessed based on the format string specified by Format. @return Number of ASCII characters printed to ConOut. Prints a formatted ASCII string to the console output device specified by StdErr defined in the EFI_SYSTEM_TABLE. This function prints a formatted ASCII string to the console output device specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII characters that printed to StdErr. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize, then only the first PcdUefiLibMaxPrintBufferSize characters are sent to StdErr. If Format is NULL, then ASSERT(). If gST->StdErr is NULL, then ASSERT(). @param Format Null-terminated ASCII format string. @param ... Variable argument list whose contents are accessed based on the format string specified by Format. @return Number of ASCII characters printed to ConErr. Internal function to print a formatted Unicode string to a graphics console device specified by ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates. This function prints a formatted Unicode string to the graphics console device specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of Unicode characters printed. The EFI_HII_FONT_PROTOCOL is used to convert the string to a bitmap using the glyphs registered with the HII database. No wrapping is performed, so any portions of the string the fall outside the active display region will not be displayed. If a graphics console device is not associated with the ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned. If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no string is printed, and 0 is returned. @param PointX X coordinate to print the string. @param PointY Y coordinate to print the string. @param Foreground The foreground color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the foreground color of the current ConOut device in the EFI_SYSTEM_TABLE is used. @param Background The background color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the background color of the current ConOut device in the EFI_SYSTEM_TABLE is used. @param Buffer Null-terminated Unicode formatted string. @param PrintNum The number of Unicode formatted string to be printed. @return Number of Unicode Characters printed. Zero means no any character // If no GOP available, try to open UGA Draw protocol if supported. // StringToImage only support blt'ing image to device using GOP protocol. If GOP is not supported in this platform, // we ask StringToImage to print the string to blt buffer, then blt to device using UgaDraw. // Explicit Line break characters are ignored, so the updated parameter RowInfoArraySize by StringToImage will // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure. // Calculate the number of actual printed characters Prints a formatted Unicode string to a graphics console device specified by ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates. This function prints a formatted Unicode string to the graphics console device specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of Unicode characters displayed, not including partial characters that may be clipped by the right edge of the display. If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize, then at most the first PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL StringToImage() service is used to convert the string to a bitmap using the glyphs registered with the HII database. No wrapping is performed, so any portions of the string the fall outside the active display region will not be displayed. Please see Section 27.2.6 of the UEFI Specification for a description of the supported string format including the set of control codes supported by the StringToImage() service. If a graphics console device is not associated with the ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned. If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no string is printed, and 0 is returned. If Format is NULL, then ASSERT(). If Format is not aligned on a 16-bit boundary, then ASSERT(). If gST->ConsoleOutputHandle is NULL, then ASSERT(). @param PointX X coordinate to print the string. @param PointY Y coordinate to print the string. @param ForeGround The foreground color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the foreground color of the current ConOut device in the EFI_SYSTEM_TABLE is used. @param BackGround The background color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the background color of the current ConOut device in the EFI_SYSTEM_TABLE is used. @param Format Null-terminated Unicode format string. See Print Library for the supported format string syntax. @param ... Variable argument list whose contents are accessed based on the format string specified by Format. @return The number of Unicode characters printed. Prints a formatted ASCII string to a graphics console device specified by ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates. This function prints a formatted ASCII string to the graphics console device specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of ASCII characters displayed, not including partial characters that may be clipped by the right edge of the display. If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize, then at most the first PcdUefiLibMaxPrintBufferSize characters are printed.The EFI_HII_FONT_PROTOCOL StringToImage() service is used to convert the string to a bitmap using the glyphs registered with the HII database. No wrapping is performed, so any portions of the string the fall outside the active display region will not be displayed. Please see Section 27.2.6 of the UEFI Specification for a description of the supported string format including the set of control codes supported by the StringToImage() service. If a graphics console device is not associated with the ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned. If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no string is printed, and 0 is returned. If Format is NULL, then ASSERT(). If gST->ConsoleOutputHandle is NULL, then ASSERT(). @param PointX X coordinate to print the string. @param PointY Y coordinate to print the string. @param ForeGround The foreground color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the foreground color of the current ConOut device in the EFI_SYSTEM_TABLE is used. @param BackGround The background color of the string being printed. This is an optional parameter that may be NULL. If it is NULL, then the background color of the current ConOut device in the EFI_SYSTEM_TABLE is used. @param Format Null-terminated ASCII format string. See Print Library for the supported format string syntax. @param ... Variable argument list whose contents are accessed based on the format string specified by Format. @return The number of ASCII characters printed.