aboutsummaryrefslogtreecommitdiff
path: root/tftf
diff options
context:
space:
mode:
authorManish Pandey <manish.pandey2@arm.com>2020-06-26 12:37:36 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-06-26 12:37:36 +0000
commita117303c1eeab7599588eab35f220eaeca282a24 (patch)
tree0ca38bdab3923590118507c80ac349a3f462f5d7 /tftf
parent036854b119f7d055dfc04266d11377af27a313fe (diff)
parent5aecd986f29140537d6a95f8e1961ecae57139e6 (diff)
downloadtf-a-tests-a117303c1eeab7599588eab35f220eaeca282a24.tar.gz
Merge "Tidying FFA helpers"
Diffstat (limited to 'tftf')
-rw-r--r--tftf/tests/runtime_services/secure_service/ffa_helpers.c49
-rw-r--r--tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c6
2 files changed, 48 insertions, 7 deletions
diff --git a/tftf/tests/runtime_services/secure_service/ffa_helpers.c b/tftf/tests/runtime_services/secure_service/ffa_helpers.c
index ba57cfec..9955c7ce 100644
--- a/tftf/tests/runtime_services/secure_service/ffa_helpers.c
+++ b/tftf/tests/runtime_services/secure_service/ffa_helpers.c
@@ -107,7 +107,12 @@ smc_ret_values ffa_msg_send_direct_req64(uint32_t source_id, uint32_t dest_id,
message, 0, 0, 0, 0);
}
-/* FFA Version ABI helper */
+/*
+ * FFA Version ABI helper.
+ * Version fields:
+ * -Bits[30:16]: Major version.
+ * -Bits[15:0]: Minor version.
+ */
smc_ret_values ffa_version(uint32_t input_version)
{
smc_args args = {
@@ -117,3 +122,45 @@ smc_ret_values ffa_version(uint32_t input_version)
return tftf_smc(&args);
}
+
+smc_ret_values ffa_id_get(void)
+{
+ smc_args args = {
+ .fid = FFA_ID_GET
+ };
+
+ return tftf_smc(&args);
+}
+
+smc_ret_values ffa_msg_wait(void)
+{
+ smc_args args = {
+ .fid = FFA_MSG_WAIT
+ };
+
+ return tftf_smc(&args);
+}
+
+smc_ret_values ffa_msg_send_direct_resp(ffa_vm_id_t source_id,
+ ffa_vm_id_t dest_id,
+ uint32_t message)
+{
+ smc_args args = {
+ .fid = FFA_MSG_SEND_DIRECT_RESP_SMC32,
+ .arg1 = ((uint32_t)source_id << 16) | dest_id,
+ .arg3 = message
+ };
+
+ return tftf_smc(&args);
+}
+
+smc_ret_values ffa_error(int32_t error_code)
+{
+ smc_args args = {
+ .fid = FFA_ERROR,
+ .arg1 = 0,
+ .arg2 = error_code
+ };
+
+ return tftf_smc(&args);
+}
diff --git a/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c b/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
index f1890543..d14374be 100644
--- a/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
+++ b/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
@@ -12,12 +12,6 @@
#include <ffa_svc.h>
#include <test_helpers.h>
-/* 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))
-
#define DIRECT_MSG_TEST_PATTERN1 (0xaaaa0000)
#define DIRECT_MSG_TEST_PATTERN2 (0xbbbb0000)
#define DIRECT_MSG_TEST_PATTERN3 (0xcccc0000)