summaryrefslogtreecommitdiffstats
path: root/common/console.c
diff options
context:
space:
mode:
authorMark Jackson <mpfj@mimc.co.uk>2008-08-25 19:21:30 +0100
committerWolfgang Denk <wd@denx.de>2008-09-06 22:36:54 +0200
commitf5c3ba79788b0e39baab7026d374fe375dd1a43f (patch)
tree35d2f149ce9d4dd63eb2eb3fc38e457b4aced883 /common/console.c
parent2b22d608f370565c87f55928b524207031419c11 (diff)
downloadtalos-obmc-uboot-f5c3ba79788b0e39baab7026d374fe375dd1a43f.tar.gz
talos-obmc-uboot-f5c3ba79788b0e39baab7026d374fe375dd1a43f.zip
Allow console input to be disabled
Added new CONFIG_DISABLE_CONSOLE define and GD_FLG_DISABLE_CONSOLE. When CONFIG_DISABLE_CONSOLE is defined, setting GD_FLG_DISABLE_CONSOLE disables all console input and output. Signed-off-by: Mark Jackson <mpfj@mimc.co.uk>
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index cfcaeb86ca..56d9118cb2 100644
--- a/common/console.c
+++ b/common/console.c
@@ -162,6 +162,11 @@ void fprintf (int file, const char *fmt, ...)
int getc (void)
{
+#ifdef CONFIG_DISABLE_CONSOLE
+ if (gd->flags & GD_FLG_DISABLE_CONSOLE)
+ return 0;
+#endif
+
if (gd->flags & GD_FLG_DEVINIT) {
/* Get from the standard input */
return fgetc (stdin);
@@ -173,6 +178,11 @@ int getc (void)
int tstc (void)
{
+#ifdef CONFIG_DISABLE_CONSOLE
+ if (gd->flags & GD_FLG_DISABLE_CONSOLE)
+ return 0;
+#endif
+
if (gd->flags & GD_FLG_DEVINIT) {
/* Test the standard input */
return ftstc (stdin);
@@ -189,6 +199,11 @@ void putc (const char c)
return;
#endif
+#ifdef CONFIG_DISABLE_CONSOLE
+ if (gd->flags & GD_FLG_DISABLE_CONSOLE)
+ return;
+#endif
+
if (gd->flags & GD_FLG_DEVINIT) {
/* Send to the standard output */
fputc (stdout, c);
@@ -205,6 +220,11 @@ void puts (const char *s)
return;
#endif
+#ifdef CONFIG_DISABLE_CONSOLE
+ if (gd->flags & GD_FLG_DISABLE_CONSOLE)
+ return;
+#endif
+
if (gd->flags & GD_FLG_DEVINIT) {
/* Send to the standard output */
fputs (stdout, s);
OpenPOWER on IntegriCloud