diff options
author | J-Alves <joao.alves@arm.com> | 2020-11-18 10:34:06 +0000 |
---|---|---|
committer | J-Alves <joao.alves@arm.com> | 2021-01-20 14:44:50 +0000 |
commit | 542d8d8cfd7ca5019d5b019afb03a67d15cd5cda (patch) | |
tree | 963c4096babcbd619eecf27ea69e504d3be12759 /spm | |
parent | 3106b07a4d9aaed2c127e3085a601aff1f56035d (diff) | |
download | tf-a-tests-542d8d8cfd7ca5019d5b019afb03a67d15cd5cda.tar.gz |
cactus: add command to request memory sharing between SPs
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Id6f2557b7ae0f9f5d74f194a2cb35f5a571192ff
Diffstat (limited to 'spm')
-rw-r--r-- | spm/cactus/cactus_test_cmds.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/spm/cactus/cactus_test_cmds.h b/spm/cactus/cactus_test_cmds.h index 3e16e579b..0a3178339 100644 --- a/spm/cactus/cactus_test_cmds.h +++ b/spm/cactus/cactus_test_cmds.h @@ -97,21 +97,37 @@ * Command to notify cactus of a memory management operation. The cmd value * should be the memory management smc function id. */ -#define CACTUS_MEM_SEND_CMD(source, dest, mem_func, handle) \ +#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_GET_HANDLE(smc_ret) smc_ret.ret4 /** + * Command to request a memory management operation. The 'mem_func' argument + * identifies the operation that is to be performend, and 'receiver' is the id + * of the partition to receive the memory region. + * + * The command id is the hex representation of the string "memory". + */ +#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, \ + receiver, 0, 0) + +#define CACTUS_REQ_MEM_SEND_GET_MEM_FUNC(smc_ret) smc_ret.ret4 +#define CACTUS_REQ_MEM_SEND_GET_RECEIVER(smc_ret) smc_ret.ret5 + +/** * Template for responses to CACTUS commands. */ -#define CACTUS_RESPONSE(source, dest, response) \ +#define CACTUS_RESPONSE(source, dest, response) \ ffa_msg_send_direct_resp(source, dest, response) -#define CACTUS_SUCCESS_RESP(source, dest) \ +#define CACTUS_SUCCESS_RESP(source, dest) \ CACTUS_RESPONSE(source, dest, CACTUS_SUCCESS) -#define CACTUS_ERROR_RESP(source, dest) \ +#define CACTUS_ERROR_RESP(source, dest) \ CACTUS_RESPONSE(source, dest, CACTUS_ERROR) #define CACTUS_GET_RESPONSE(smc_ret) smc_ret.ret3 @@ -119,4 +135,7 @@ #define CACTUS_IS_SUCCESS_RESP(smc_ret) \ (CACTUS_GET_RESPONSE(smc_ret) == CACTUS_SUCCESS) +#define CACTUS_IS_ERROR_RESP(smc_ret) \ + (CACTUS_GET_RESPONSE(smc_ret) == CACTUS_ERROR) + #endif |