You've already forked slimbootloader
mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-03-06 15:26:20 -08:00
5e10bd1e07
To align with EDK2, update file license to use BSD+Patent license Signed-off-by: Guo Dong <guo.dong@intel.com>
47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
/** @file
|
|
Helper function for printing from the shell.
|
|
|
|
Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
#include <Base.h>
|
|
#include <Library/DebugLib.h>
|
|
#include <Library/BaseLib.h>
|
|
#include <Library/PrintLib.h>
|
|
#include <Library/PcdLib.h>
|
|
#include <Library/BaseMemoryLib.h>
|
|
#include <Library/ConsoleOutLib.h>
|
|
|
|
//
|
|
// Define the maximum message length that this library supports
|
|
//
|
|
#define MAX_MESSAGE_LENGTH 0x100
|
|
|
|
/**
|
|
Prints a message to the serial port.
|
|
|
|
If Format is NULL, then ASSERT().
|
|
|
|
@param Format Format string for the message to print.
|
|
@param ... Variable argument list whose contents are accessed
|
|
based on the format string specified by Format.
|
|
|
|
**/
|
|
UINTN
|
|
EFIAPI
|
|
ShellPrint (
|
|
IN CONST CHAR16 *Format,
|
|
...
|
|
)
|
|
{
|
|
CHAR8 Buffer[MAX_MESSAGE_LENGTH];
|
|
VA_LIST Marker;
|
|
|
|
VA_START (Marker, Format);
|
|
AsciiVSPrintUnicodeFormat (Buffer, sizeof (Buffer), Format, Marker);
|
|
VA_END (Marker);
|
|
return ConsoleWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer));
|
|
}
|