Add log client component
Adding a client and a related factory component that will be used
by the SPs to use the logging SP.
Extending trace functions with the configurable option to log using
the logging SP. In case logging with the logging SP fails,
the FFA_CONSOLE_LOG mechanism will be used.
Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
Signed-off-by: Gabor Ambrus <gabor.ambrus@arm.com>
Change-Id: I1c03d145faa8f27c3e5878de0f6d28bec23ca9af
diff --git a/components/common/trace/trace.c b/components/common/trace/trace.c
index 0b8cb53..372226b 100644
--- a/components/common/trace/trace.c
+++ b/components/common/trace/trace.c
@@ -12,6 +12,8 @@
#error TRACE_PREFIX must be defined
#endif /* TRACE_PREFIX */
+void (*trace_puts_interface)(const char *str) = &trace_puts;
+
void trace_printf(const char *func, int line, int level, const char *fmt, ...)
{
char buffer[256];
@@ -42,6 +44,6 @@
buffer[sizeof(buffer) - 1] = '\0';
}
- trace_puts(buffer);
+ (*trace_puts_interface)(buffer);
}
#endif