summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-05-18 09:09:05 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-05-18 12:15:43 +0200
commite536d48f60d6dae6af831ae7924a8cfcbbf20af8 (patch)
treea5e9654d3f10f520ad4e65017d80a798bc310a2c /common
parentb8a165d1e50377a4bfe0cd6d704a02f7ce9a941b (diff)
downloadbarebox-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.c16
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)