summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-10-10 10:05:42 +0000
committerwdenk <wdenk>2003-10-10 10:05:42 +0000
commitf72da3406bf6f1c1bce9aa03b07d070413a916af (patch)
tree5494a96d6da4706d1add61cb36d8bace834fbb8f /common/main.c
parent5da627a424b3ad2d38a81886ba4a18e5123a6788 (diff)
Added config option CONFIG_SILENT_CONSOLE. See doc/README.silentLABEL_2003_10_10_1200
for more information
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/common/main.c b/common/main.c
index d08bc47d736..73f8ff9f0be 100644
--- a/common/main.c
+++ b/common/main.c
@@ -193,6 +193,18 @@ static __inline__ int abortboot(int bootdelay)
{
int abort = 0;
+#ifdef CONFIG_SILENT_CONSOLE
+ {
+ DECLARE_GLOBAL_DATA_PTR;
+
+ if (gd->flags & GD_FLG_SILENT) {
+ /* Restore serial console */
+ console_assign (stdout, "serial");
+ console_assign (stderr, "serial");
+ }
+ }
+#endif
+
#ifdef CONFIG_MENUPROMPT
printf(CONFIG_MENUPROMPT, bootdelay);
#else
@@ -207,13 +219,13 @@ static __inline__ int abortboot(int bootdelay)
if (bootdelay >= 0) {
if (tstc()) { /* we got a key press */
(void) getc(); /* consume input */
- printf ("\b\b\b 0\n");
- return 1; /* don't auto boot */
+ printf ("\b\b\b 0");
+ abort = 1; /* don't auto boot */
}
}
#endif
- while (bootdelay > 0) {
+ while ((bootdelay > 0) && (!abort)) {
int i;
--bootdelay;
@@ -237,6 +249,21 @@ static __inline__ int abortboot(int bootdelay)
putc ('\n');
+#ifdef CONFIG_SILENT_CONSOLE
+ {
+ DECLARE_GLOBAL_DATA_PTR;
+
+ if (abort) {
+ /* permanently enable normal console output */
+ gd->flags &= ~(GD_FLG_SILENT);
+ } else if (gd->flags & GD_FLG_SILENT) {
+ /* Restore silent console */
+ console_assign (stdout, "nulldev");
+ console_assign (stderr, "nulldev");
+ }
+ }
+#endif
+
return abort;
}
# endif /* CONFIG_AUTOBOOT_KEYED */