diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-18 09:09:05 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-18 12:15:43 +0200 |
commit | e536d48f60d6dae6af831ae7924a8cfcbbf20af8 (patch) | |
tree | a5e9654d3f10f520ad4e65017d80a798bc310a2c /common | |
parent | b8a165d1e50377a4bfe0cd6d704a02f7ce9a941b (diff) | |
download | barebox-e536d48f60d6dae6af831ae7924a8cfcbbf20af8.tar.gz barebox-e536d48f60d6dae6af831ae7924a8cfcbbf20af8.tar.xz |
simple console: implement console_flush
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/console_simple.c | 16 |
1 files changed, 16 insertions, 0 deletions
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 <config.h> #include <common.h> #include <fs.h> +#include <errno.h> 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) |