test(console_log): add tests for FFA_CONSOLE_LOG
Adding two tests:
Test if FFA_CONSOLE_ABI responds SUCCESS to correct message.
Test if FFA_CONSOLE_ABI responds INVALID_PARAMETERS to incorrectly
formatted message.
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: I7053e48d4c6f365601bd9d9c89165cde11422b04
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index 84d29a4..ef55d8f 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -18,6 +18,7 @@
*/
int64_t hf_call(uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3);
struct ffa_value ffa_call(struct ffa_value args);
+void memcpy_s(void *dest, size_t destsz, const void *src, size_t count);
/**
* Returns the VM's own ID.
@@ -500,3 +501,25 @@
.arg2 = page_count,
.arg3 = mem_perm});
}
+
+static inline struct ffa_value ffa_console_log_32(const char *src, size_t size)
+{
+ struct ffa_value req = {
+ .func = FFA_CONSOLE_LOG_32,
+ .arg1 = size,
+ };
+ memcpy_s(&req.arg2, sizeof(uint32_t) * 6, src, size);
+
+ return ffa_call(req);
+}
+
+static inline struct ffa_value ffa_console_log_64(const char *src, size_t size)
+{
+ struct ffa_value req = {
+ .func = FFA_CONSOLE_LOG_64,
+ .arg1 = size,
+ };
+ memcpy_s(&req.arg2, sizeof(uint64_t) * 6, src, size);
+
+ return ffa_call(req);
+}