aboutsummaryrefslogtreecommitdiff
path: root/tftf
diff options
context:
space:
mode:
authorJ-Alves <joao.alves@arm.com>2020-11-18 14:51:57 +0000
committerJ-Alves <joao.alves@arm.com>2021-01-21 14:41:47 +0000
commit5339201417a3f37b9fc64fdaf1d677413203b799 (patch)
tree2281af86c56a88f834d407b73f604a5a63bee1a3 /tftf
parent4904c8632c255b6ac3fb77109f807b3a11cb910b (diff)
downloadtf-a-tests-5339201417a3f37b9fc64fdaf1d677413203b799.tar.gz
Cactus: refactor of cactus_test_cmds.h
Change from macros to static inline functions, to enforce type checking. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I2cbaf99683ca5b2a5689256240894ed05d99e0d8
Diffstat (limited to 'tftf')
-rw-r--r--tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c10
-rw-r--r--tftf/tests/runtime_services/secure_service/test_ffa_memory_sharing.c12
2 files changed, 10 insertions, 12 deletions
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 aeeb19b1..36bc3e73 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
@@ -103,7 +103,7 @@ static test_result_t send_cactus_req_echo_cmd(ffa_vm_id_t sender,
{
smc_ret_values ret;
- ret = CACTUS_REQ_ECHO_SEND_CMD(sender, dest, echo_dest, value);
+ ret = cactus_req_echo_send_cmd(sender, dest, echo_dest, value);
if (ret.ret0 != FFA_MSG_SEND_DIRECT_RESP_SMC32) {
ERROR("Failed to send message. error: %lx\n",
@@ -111,7 +111,7 @@ static test_result_t send_cactus_req_echo_cmd(ffa_vm_id_t sender,
return TEST_RESULT_FAIL;
}
- if (CACTUS_GET_RESPONSE(ret) == CACTUS_ERROR) {
+ if (cactus_get_response(ret) == CACTUS_ERROR) {
return TEST_RESULT_FAIL;
}
@@ -155,8 +155,7 @@ test_result_t test_ffa_sp_to_sp_deadlock(void)
**********************************************************************/
CHECK_HAFNIUM_SPMC_TESTING_SETUP(1, 0, expected_sp_uuids);
- ret = CACTUS_REQ_DEADLOCK_SEND_CMD(HYP_ID, SP_ID(1), SP_ID(2),
- SP_ID(3));
+ ret = cactus_req_deadlock_send_cmd(HYP_ID, SP_ID(1), SP_ID(2), SP_ID(3));
if (ret.ret0 != FFA_MSG_SEND_DIRECT_RESP_SMC32) {
ERROR("Failed to send message. error: %lx\n",
@@ -164,8 +163,7 @@ test_result_t test_ffa_sp_to_sp_deadlock(void)
return TEST_RESULT_FAIL;
}
- if (CACTUS_GET_RESPONSE(ret) == CACTUS_ERROR) {
- ERROR("cactus SP response is CACTUS_ERROR!\n");
+ if (cactus_get_response(ret) == CACTUS_ERROR) {
return TEST_RESULT_FAIL;
}
diff --git a/tftf/tests/runtime_services/secure_service/test_ffa_memory_sharing.c b/tftf/tests/runtime_services/secure_service/test_ffa_memory_sharing.c
index 61f1aaa3..4afe170c 100644
--- a/tftf/tests/runtime_services/secure_service/test_ffa_memory_sharing.c
+++ b/tftf/tests/runtime_services/secure_service/test_ffa_memory_sharing.c
@@ -77,7 +77,7 @@ static test_result_t test_memory_send_sp(uint32_t mem_func)
ptr = (uint32_t *)constituents[0].address;
- ret = CACTUS_MEM_SEND_CMD_SEND(SENDER, RECEIVER, mem_func, handle);
+ ret = cactus_mem_send_cmd(SENDER, RECEIVER, mem_func, handle);
if (ret.ret0 != FFA_MSG_SEND_DIRECT_RESP_SMC32) {
ERROR("Failed to send message. error: %lx\n",
@@ -85,7 +85,7 @@ static test_result_t test_memory_send_sp(uint32_t mem_func)
return TEST_RESULT_FAIL;
}
- if (CACTUS_GET_RESPONSE(ret) != CACTUS_SUCCESS) {
+ if (cactus_get_response(ret) != CACTUS_SUCCESS) {
ERROR("Failed memory send operation!\n");
return TEST_RESULT_FAIL;
}
@@ -141,7 +141,7 @@ static test_result_t test_req_mem_send_sp_to_sp(uint32_t mem_func,
**********************************************************************/
CHECK_HAFNIUM_SPMC_TESTING_SETUP(1, 0, expected_sp_uuids);
- ret = CACTUS_REQ_MEM_SEND_SEND_CMD(HYP_ID, sender_sp, mem_func,
+ ret = cactus_req_mem_send_send_cmd(HYP_ID, sender_sp, mem_func,
receiver_sp);
if (ret.ret0 != FFA_MSG_SEND_DIRECT_RESP_SMC32) {
@@ -149,7 +149,7 @@ static test_result_t test_req_mem_send_sp_to_sp(uint32_t mem_func,
return TEST_RESULT_FAIL;
}
- if (CACTUS_IS_ERROR_RESP(ret)) {
+ if (cactus_get_response(ret) == CACTUS_ERROR) {
return TEST_RESULT_FAIL;
}
@@ -164,8 +164,8 @@ test_result_t test_req_mem_share_sp_to_sp(void)
test_result_t test_req_mem_lend_sp_to_sp(void)
{
- return test_req_mem_send_sp_to_sp(FFA_MEM_LEND_SMC32, SP_ID(2),
- SP_ID(1));
+ return test_req_mem_send_sp_to_sp(FFA_MEM_LEND_SMC32, SP_ID(3),
+ SP_ID(2));
}
test_result_t test_req_mem_donate_sp_to_sp(void)