diff --git a/commands/go.c b/commands/go.c index ac5bf3e..627f21e 100644 --- a/commands/go.c +++ b/commands/go.c @@ -58,6 +58,8 @@ printf ("## Starting application at 0x%08lX ...\n", addr); + console_flush(); + #ifdef ARCH_HAS_EXECUTE rcode = arch_execute(addr, argc, &argv[1]); #else diff --git a/common/console.c b/common/console.c index de487fc..68ef80e 100644 --- a/common/console.c +++ b/common/console.c @@ -301,6 +301,17 @@ } EXPORT_SYMBOL(fputs); +void console_flush(void) +{ + struct console_device *cdev; + + for_each_console(cdev) { + if (cdev->flush) + cdev->flush(cdev); + } +} +EXPORT_SYMBOL(console_flush); + void fprintf (int file, const char *fmt, ...) { va_list args; diff --git a/include/console.h b/include/console.h index aa2c498..e6f06bd 100644 --- a/include/console.h +++ b/include/console.h @@ -38,6 +38,7 @@ void (*putc)(struct console_device *cdev, char c); int (*getc)(struct console_device *cdev); int (*setbrg)(struct console_device *cdev, int baudrate); + void (*flush)(struct console_device *cdev); struct list_head list; diff --git a/include/stdio.h b/include/stdio.h index ce53c97..7a6d9cb 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -18,6 +18,7 @@ void console_putc(unsigned int ch, const char c); int getc(void); void console_puts(unsigned int ch, const char *s); +void console_flush(void); static inline void puts(const char *s) { console_puts(CONSOLE_STDOUT, s);