1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 00:32:04 +02:00

console: Add a way to output to serial only

In the video drivers it is useful to print errors while debugging but
doing so risks an infinite loop as the debugging info itself may go
through the video drivers.

Add a new console function that prints information only to the serial
device, thus making it safe for use in debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Simon Glass
2020-07-02 21:12:13 -06:00
committed by Bin Meng
parent 3dada5a1a8
commit 493a4c8af7
2 changed files with 35 additions and 6 deletions

View File

@@ -7,6 +7,8 @@
#ifndef __CONSOLE_H
#define __CONSOLE_H
#include <stdbool.h>
extern char console_buffer[];
/* common/console.c */
@@ -72,6 +74,17 @@ int console_record_avail(void);
*/
int console_announce_r(void);
/**
* console_puts_select_stderr() - Output a string to selected console devices
*
* This writes to stderr only. It is useful for outputting errors
*
* @serial_only: true to output only to serial, false to output to everything
* else
* @s: String to output
*/
void console_puts_select_stderr(bool serial_only, const char *s);
/*
* CONSOLE multiplexing.
*/