diff options
author | Madhukar Pappireddy <madhukar.pappireddy@arm.com> | 2021-08-20 13:13:49 -0500 |
---|---|---|
committer | Madhukar Pappireddy <madhukar.pappireddy@arm.com> | 2021-11-05 15:35:57 -0500 |
commit | b640259337bc9db70d853ed886a39e67b11ffeae (patch) | |
tree | 19d01a1aa5ee44815a42ac4f495a6adbd845b0aa /spm/cactus/cactus_tests | |
parent | 3c287264eb513c720136a3ce8f24fa9a07a02ce8 (diff) |
feat: add a test command to send request to a VM/SP ..
requesting it to forward sleep request to another VM/SP.
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I26f25fba93bedc38bfd0a5d785591582715921c3
Diffstat (limited to 'spm/cactus/cactus_tests')
-rw-r--r-- | spm/cactus/cactus_tests/cactus_test_interrupts.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spm/cactus/cactus_tests/cactus_test_interrupts.c b/spm/cactus/cactus_tests/cactus_test_interrupts.c index a79885c..5cd53d1 100644 --- a/spm/cactus/cactus_tests/cactus_test_interrupts.c +++ b/spm/cactus/cactus_tests/cactus_test_interrupts.c @@ -30,6 +30,36 @@ CACTUS_CMD_HANDLER(sleep_cmd, CACTUS_SLEEP_CMD) time_lapsed); } +CACTUS_CMD_HANDLER(sleep_fwd_cmd, CACTUS_FWD_SLEEP_CMD) +{ + smc_ret_values ffa_ret; + ffa_id_t vm_id = ffa_dir_msg_dest(*args); + ffa_id_t fwd_dest = cactus_get_fwd_sleep_dest(*args); + uint32_t sleep_ms = cactus_get_sleep_time(*args); + + + VERBOSE("VM%x requested %x to sleep for value %u\n", + ffa_dir_msg_source(*args), fwd_dest, sleep_ms); + + ffa_ret = cactus_sleep_cmd(vm_id, fwd_dest, sleep_ms); + + if (!is_ffa_direct_response(ffa_ret)) { + ERROR("Encountered error in CACTUS_FWD_SLEEP_CMD response\n"); + return cactus_error_resp(vm_id, ffa_dir_msg_source(*args), + CACTUS_ERROR_FFA_CALL); + } + + if (cactus_get_response(ffa_ret) != sleep_ms) { + ERROR("Request returned: %u ms!\n", + cactus_get_response(ffa_ret)); + return cactus_error_resp(vm_id, ffa_dir_msg_source(*args), + CACTUS_ERROR_TEST); + + } + + return cactus_success_resp(vm_id, ffa_dir_msg_source(*args), 0); +} + CACTUS_CMD_HANDLER(interrupt_cmd, CACTUS_INTERRUPT_CMD) { uint32_t int_id = cactus_get_interrupt_id(*args); |