summaryrefslogtreecommitdiff
path: root/include/console.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-02 21:12:13 -0600
committerBin Meng <bmeng.cn@gmail.com>2020-07-09 12:33:24 +0800
commit493a4c8af7a4939d96d6e2601282ca4a07c7570e (patch)
tree1d93231503b6d89dadf8480a92210e4580eccfbb /include/console.h
parent3dada5a1a89f336f4b751548117949cf255cfcf6 (diff)
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>
Diffstat (limited to 'include/console.h')
-rw-r--r--include/console.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/console.h b/include/console.h
index 74afe22b7e..4c6b8f2614 100644
--- a/include/console.h
+++ b/include/console.h
@@ -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.
*/