Tidying FFA helpers
Moved SP specific functions/macros to "sp_helpers.c/h".
Placed ffa interfaces/symbols shared between tftf and SPs in
"ffa_helpers.c/h".
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I4cf967f87837ce3e7d0f7244f9cc0677f608f9cd
diff --git a/include/runtime_services/ffa_helpers.h b/include/runtime_services/ffa_helpers.h
index 8ce952a..d4ef803 100644
--- a/include/runtime_services/ffa_helpers.h
+++ b/include/runtime_services/ffa_helpers.h
@@ -14,14 +14,34 @@
/* This error code must be different to the ones used by FFA */
#define FFA_TFTF_ERROR -42
+/* Hypervisor ID at physical FFA instance */
+#define HYP_ID (0)
+
+/* By convention, SP IDs (as opposed to VM IDs) have bit 15 set */
+#define SP_ID(x) ((x) | (1 << 15))
+
+typedef unsigned short ffa_vm_id_t;
+typedef unsigned short ffa_vm_count_t;
+typedef unsigned short ffa_vcpu_count_t;
+
#ifndef __ASSEMBLY__
#include <stdint.h>
+/*
+ * TODO: In the future this file should be placed in a common folder, and not
+ * under tftf. The functions in this file are also used by SPs for SPM tests.
+ */
+
smc_ret_values ffa_msg_send_direct_req(uint32_t source_id, uint32_t dest_id, uint32_t message);
smc_ret_values ffa_msg_send_direct_req64(uint32_t source_id, uint32_t dest_id, uint64_t message);
smc_ret_values ffa_run(uint32_t dest_id, uint32_t vcpu_id);
smc_ret_values ffa_version(uint32_t input_version);
+smc_ret_values ffa_id_get(void);
+smc_ret_values ffa_msg_wait(void);
+smc_ret_values ffa_msg_send_direct_resp(ffa_vm_id_t source_id,
+ ffa_vm_id_t dest_id, uint32_t message);
+smc_ret_values ffa_error(int32_t error_code);
#endif /* __ASSEMBLY__ */