LIB: Add with_marker argument to tfm_vprintf
The underlying tfm_vprintf function can now be called
tfm_vprintf_unpriv, which is called from the runtime FW vprintf
implementation. This function will be called without a marker character
at the beginning of the string and therefore will cause an assertion to
be triggered within the vprintf implementation. Add a new argument which
specifies whether or not there is a marker character.
Change-Id: I58bc8cfa44f348766408d6e1fcf3fa995c3f6131
Signed-off-by: Jackson Cooper-Driver <jackson.cooper-driver@arm.com>
diff --git a/lib/tfm_vprintf/src/tfm_vprintf.c b/lib/tfm_vprintf/src/tfm_vprintf.c
index 5999dab..ed57e58 100644
--- a/lib/tfm_vprintf/src/tfm_vprintf.c
+++ b/lib/tfm_vprintf/src/tfm_vprintf.c
@@ -214,18 +214,19 @@
}
}
-void tfm_vprintf(tfm_log_output_str output_func, void *priv, const char *fmt, va_list args)
+void tfm_vprintf(tfm_log_output_str output_func, void *priv, const char *fmt, va_list args,
+ bool with_marker)
{
uint8_t log_marker;
const char spacer = ' ';
- /* We expect the LOG_MARKER_* macro as the first character */
- log_marker = fmt[0];
- fmt++;
-
- if (log_marker != LOG_RAW_VALUE) {
- output_str_not_formatted(output_func, priv, get_log_prefix(log_marker));
- output_char(output_func, priv, spacer);
+ if (with_marker) {
+ log_marker = fmt[0];
+ fmt++;
+ if (log_marker != LOG_RAW_VALUE) {
+ output_str_not_formatted(output_func, priv, get_log_prefix(log_marker));
+ output_char(output_func, priv, spacer);
+ }
}
tfm_vprintf_internal(output_func, priv, fmt, args);