From e536d48f60d6dae6af831ae7924a8cfcbbf20af8 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 18 May 2009 09:09:05 +0200 Subject: simple console: implement console_flush Signed-off-by: Sascha Hauer --- common/console_simple.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'common/console_simple.c') diff --git a/common/console_simple.c b/common/console_simple.c index 5a80f76242..7695e05ecb 100644 --- a/common/console_simple.c +++ b/common/console_simple.c @@ -1,6 +1,7 @@ #include #include #include +#include static struct console_device *console; @@ -56,6 +57,9 @@ EXPORT_SYMBOL(console_puts); void console_putc(unsigned int ch, char c) { + if (!console) + return; + console->putc(console, c); if (c == '\n') console->putc(console, '\r'); @@ -88,16 +92,28 @@ EXPORT_SYMBOL(fputs); int tstc(void) { + if (!console) + return 0; + return console->tstc(console); } EXPORT_SYMBOL(tstc); int getc(void) { + if (!console) + return -EINVAL; return console->getc(console); } EXPORT_SYMBOL(getc); +void console_flush(void) +{ + if (console && console->flush) + console->flush(console); +} +EXPORT_SYMBOL(console_flush); + #ifndef ARCH_HAS_CTRLC /* test if ctrl-c was pressed */ int ctrlc (void) -- cgit v1.2.3