summaryrefslogtreecommitdiff
path: root/common/console.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-12-04 13:48:19 -0700
committerTom Rini <trini@konsulko.com>2017-12-07 15:17:00 -0500
commit64e9b4f346f113dec984eaab226a44d35e38d7ce (patch)
tree9b2b78e39ccea8f099f4df127810cf9418529ee3 /common/console.c
parente341434a7ff64911e032300f13b14862dfd73cc7 (diff)
Revert "sandbox: Drop special case console code for sandbox"
While sandbox works OK without the special-case code, it does result in console output being stored in the pre-console buffer while sandbox starts up. If there is a crash or a problem then there is no indication of what is going on. For ease of debugging it seems better to revert this change also. This reverts commit d8c6fb8cedbc35eee27730a7fa544e499b3c81cc. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index d763f2c684..0e0295514b 100644
--- a/common/console.c
+++ b/common/console.c
@@ -489,6 +489,13 @@ static inline void print_pre_console_buffer(int flushpoint) {}
void putc(const char c)
{
+#ifdef CONFIG_SANDBOX
+ /* sandbox can send characters to stdout before it has a console */
+ if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
+ os_putc(c);
+ return;
+ }
+#endif
#ifdef CONFIG_DEBUG_UART
/* if we don't have a console yet, use the debug UART */
if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {