Add log provider component
Add component for handling logging RPC calls from SPs.
Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
Signed-off-by: Gabor Ambrus <gabor.ambrus@arm.com>
Change-Id: I6d09bac2c77eaff1356e2d8f0d0883aa7803b998
diff --git a/components/service/log/backend/log_backend.h b/components/service/log/backend/log_backend.h
new file mode 100644
index 0000000..2ac4c33
--- /dev/null
+++ b/components/service/log/backend/log_backend.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef LOG_BACKEND_H
+#define LOG_BACKEND_H
+
+#include "components/service/log/common/log_status.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Common log backend interface
+ *
+ * A concrete log backend provides an implementation of this
+ * interface.
+ */
+struct log_backend_interface {
+ /**
+ * \brief Processes the character sequence (str) in a desired way (e.g. print to UART).
+ *
+ * \param[in] context The concrete backend context
+ * \param[in] str Character sequence to be printed (null-terminated)
+ */
+ log_status_t (*puts)(void *context, const char *str);
+};
+
+/**
+ * \brief Common log backend instance
+ */
+struct log_backend {
+ /**
+ * \brief The backend context
+ *
+ * Points to backend specific instance data.
+ */
+ void *context;
+
+ /**
+ * \brief The backend interface
+ *
+ * A concrete backend provides an implementation of this interface.
+ */
+ const struct log_backend_interface *interface;
+};
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* LOG_BACKEND_H */