aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spm/cactus/cactus_main.c10
-rw-r--r--spm/cactus/cactus_test_cmds.h17
-rw-r--r--tftf/tests/runtime_services/secure_service/test_ffa_memory_sharing.c2
3 files changed, 17 insertions, 12 deletions
diff --git a/spm/cactus/cactus_main.c b/spm/cactus/cactus_main.c
index 3883fac8..de1e555b 100644
--- a/spm/cactus/cactus_main.c
+++ b/spm/cactus/cactus_main.c
@@ -87,12 +87,10 @@ static void __dead2 message_loop(ffa_vm_id_t vm_id, struct mailbox_buffers *mb)
cactus_cmd = CACTUS_GET_CMD(ffa_ret);
switch (cactus_cmd) {
- case FFA_MEM_SHARE_SMC32:
- case FFA_MEM_LEND_SMC32:
- case FFA_MEM_DONATE_SMC32:
+ case CACTUS_MEM_SEND_CMD:
ffa_memory_management_test(
mb, vm_id, source,
- CACTUS_GET_CMD(ffa_ret),
+ CACTUS_MEM_SEND_GET_FUNC(ffa_ret),
CACTUS_MEM_SEND_GET_HANDLE(ffa_ret));
/*
@@ -133,8 +131,8 @@ static void __dead2 message_loop(ffa_vm_id_t vm_id, struct mailbox_buffers *mb)
*/
expect(handle != FFA_MEMORY_HANDLE_INVALID, true);
- ffa_ret = CACTUS_MEM_SEND_CMD(vm_id, receiver, mem_func,
- handle);
+ ffa_ret = CACTUS_MEM_SEND_CMD_SEND(vm_id, receiver,
+ mem_func, handle);
if (ffa_ret.ret0 != FFA_MSG_SEND_DIRECT_RESP_SMC32) {
ERROR("Failed to send message. error: %lx\n",
diff --git a/spm/cactus/cactus_test_cmds.h b/spm/cactus/cactus_test_cmds.h
index 0a317833..7555b8b2 100644
--- a/spm/cactus/cactus_test_cmds.h
+++ b/spm/cactus/cactus_test_cmds.h
@@ -96,11 +96,18 @@
/**
* Command to notify cactus of a memory management operation. The cmd value
* should be the memory management smc function id.
+ *
+ * The id is the hex representation of the string "mem"
*/
-#define CACTUS_MEM_SEND_CMD(source, dest, mem_func, handle) \
- CACTUS_SEND_CMD(source, dest, mem_func, handle, 0, 0, 0)
+#define CACTUS_MEM_SEND_CMD U(0x6d656d)
+
+#define CACTUS_MEM_SEND_CMD_SEND(source, dest, mem_func, handle) \
+ CACTUS_SEND_CMD(source, dest, CACTUS_MEM_SEND_CMD, \
+ mem_func, handle, 0, 0)
+
+#define CACTUS_MEM_SEND_GET_FUNC(smc_ret) smc_ret.ret4
-#define CACTUS_MEM_SEND_GET_HANDLE(smc_ret) smc_ret.ret4
+#define CACTUS_MEM_SEND_GET_HANDLE(smc_ret) smc_ret.ret5
/**
* Command to request a memory management operation. The 'mem_func' argument
@@ -111,8 +118,8 @@
*/
#define CACTUS_REQ_MEM_SEND_CMD U(0x6d656d6f7279)
-#define CACTUS_REQ_MEM_SEND_SEND_CMD(source, dest, mem_func, receiver) \
- CACTUS_SEND_CMD(source, dest, CACTUS_REQ_MEM_SEND_CMD, mem_func, \
+#define CACTUS_REQ_MEM_SEND_SEND_CMD(source, dest, mem_func, receiver) \
+ CACTUS_SEND_CMD(source, dest, CACTUS_REQ_MEM_SEND_CMD, mem_func, \
receiver, 0, 0)
#define CACTUS_REQ_MEM_SEND_GET_MEM_FUNC(smc_ret) smc_ret.ret4
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 a267b51d..61f1aaa3 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(SENDER, RECEIVER, mem_func, handle);
+ ret = CACTUS_MEM_SEND_CMD_SEND(SENDER, RECEIVER, mem_func, handle);
if (ret.ret0 != FFA_MSG_SEND_DIRECT_RESP_SMC32) {
ERROR("Failed to send message. error: %lx\n",