Implement FFA_CONSOLE_LOG interface
Implement FFA_CONSOLE_LOG interface for sending debug logs to the SPMC.
The commit also replaces the proprietary trace call by FFA_CONSOLE_LOG.
Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I5275470683e2674fdd6f5a61f9c5ab8dd71dcb11
diff --git a/environments/opteesp/sp_trace.c b/environments/opteesp/sp_trace.c
index 6ac0ddc..586b41c 100644
--- a/environments/opteesp/sp_trace.c
+++ b/environments/opteesp/sp_trace.c
@@ -4,15 +4,20 @@
*/
#include "trace.h"
-#include "ffa_internal_api.h"
+#include "ffa_api.h"
+#include <string.h>
#if TRACE_LEVEL >= TRACE_LEVEL_ERROR
void trace_puts(const char *str)
{
- struct ffa_params resp;
+ size_t length = strlen(str);
+ size_t i = 0;
- ffa_svc(0xdeadbeef, (uintptr_t)str, 0, 0, 0, 0, 0, 0, &resp);
+ for (i = 0; i < length; i += FFA_CONSOLE_LOG_64_MAX_LENGTH) {
+ ffa_console_log_64(&str[i], MIN(FFA_CONSOLE_LOG_64_MAX_LENGTH,
+ length - i));
+ }
}
#endif /* TRACE_LEVEL >= TRACE_LEVEL_ERROR */