aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2020-05-27 12:29:18 -0700
committerArve Hjønnevåg <arve@android.com>2020-05-27 12:31:19 -0700
commitaa4cadec56bd2cb52778dd1ec3e978d68a379999 (patch)
tree9a0978fd90f86ae68e23703a0a12823ece34c1dc /lib
parentfbb386aff455719d65535e9d87cda593ea846249 (diff)
downloadcommon-aa4cadec56bd2cb52778dd1ec3e978d68a379999.tar.gz
[lib][io] Disable serial console when callbacks are registered
Speeds up trusty debug output once the trusty log driver has started in linux. Change-Id: I00863bc2c1ce513faa73bd38766ad28334de1d58
Diffstat (limited to 'lib')
-rw-r--r--lib/io/console.c3
-rw-r--r--lib/io/rules.mk6
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/io/console.c b/lib/io/console.c
index 7d26f853..4c6eaed0 100644
--- a/lib/io/console.c
+++ b/lib/io/console.c
@@ -97,6 +97,9 @@ static void out_count(const char *str, size_t len)
if (need_lock) {
spin_unlock_restore(&print_spin_lock, state, PRINT_LOCK_FLAGS);
}
+#if CONSOLE_CALLBACK_DISABLES_SERIAL
+ return;
+#endif
}
/* write out the serial port */
diff --git a/lib/io/rules.mk b/lib/io/rules.mk
index d6c48a75..553ac555 100644
--- a/lib/io/rules.mk
+++ b/lib/io/rules.mk
@@ -7,6 +7,12 @@ MODULE_DEPS := \
ifeq (false,$(call TOBOOL,$(WITHOUT_CONSOLE)))
MODULE_DEPS += lib/cbuf
MODULE_SRCS += $(LOCAL_DIR)/console.c
+
+CONSOLE_CALLBACK_DISABLES_SERIAL ?= true
+ifeq (true,$(call TOBOOL,$(CONSOLE_CALLBACK_DISABLES_SERIAL)))
+MODULE_DEFINES += CONSOLE_CALLBACK_DISABLES_SERIAL=1
+endif
+
endif
MODULE_SRCS += \