diff options
author | Julian Hall <julian.hall@arm.com> | 2021-07-09 14:49:16 +0100 |
---|---|---|
committer | Julian Hall <julian.hall@arm.com> | 2021-07-09 14:49:16 +0100 |
commit | 22c47a9355ea4096f85939c45ff69bb45d31e90c (patch) | |
tree | 210a68e46a4b7444b4e0461fca5c7d0e18ada579 | |
parent | c1cf9120e4ab0b359a27176b079769b9a7e6bb87 (diff) | |
download | trusted-services-22c47a9355ea4096f85939c45ff69bb45d31e90c.tar.gz |
Update SP message handling for FFA routing extension
Some SPs (attestation and env_test) were missing modifications needed
for compatibility with the FFA routing extension changes. This
commit adds the changes needed to fix message receive handling.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I5d19f130646ae2dd6fd5379ec3c3ac99c7237c65
-rw-r--r-- | deployments/attestation/opteesp/attestation_sp.c | 18 | ||||
-rw-r--r-- | deployments/env-test/opteesp/env_test.c | 18 |
2 files changed, 16 insertions, 20 deletions
diff --git a/deployments/attestation/opteesp/attestation_sp.c b/deployments/attestation/opteesp/attestation_sp.c index f597e7ed3..c891f4d2a 100644 --- a/deployments/attestation/opteesp/attestation_sp.c +++ b/deployments/attestation/opteesp/attestation_sp.c @@ -37,7 +37,7 @@ void __noreturn sp_main(struct ffa_init_info *init_info) struct attest_provider attest_provider; struct rpc_interface *attest_iface; struct ffa_call_ep ffarpc_call_ep; - struct ffa_direct_msg req_msg; + struct sp_msg req_msg; /* Claim source objects */ struct claim_source *claim_source; @@ -90,20 +90,18 @@ void __noreturn sp_main(struct ffa_init_info *init_info) /********************************************************* * End of boot phase *********************************************************/ - ffa_msg_wait(&req_msg); + sp_msg_wait(&req_msg); while (1) { - if (req_msg.function_id == FFA_MSG_SEND_DIRECT_REQ_32) { - struct ffa_direct_msg resp_msg; + struct sp_msg resp_msg; - ffa_call_ep_receive(&ffarpc_call_ep, &req_msg, &resp_msg); + ffa_call_ep_receive(&ffarpc_call_ep, &req_msg, &resp_msg); - ffa_msg_send_direct_resp(req_msg.destination_id, - req_msg.source_id, resp_msg.args[0], resp_msg.args[1], - resp_msg.args[2], resp_msg.args[3], resp_msg.args[4], - &req_msg); - } + resp_msg.source_id = req_msg.destination_id; + resp_msg.destination_id = req_msg.source_id; + + sp_msg_send_direct_resp(&resp_msg, &req_msg); } fatal_error: diff --git a/deployments/env-test/opteesp/env_test.c b/deployments/env-test/opteesp/env_test.c index ff2f8dfe0..78c439fc1 100644 --- a/deployments/env-test/opteesp/env_test.c +++ b/deployments/env-test/opteesp/env_test.c @@ -28,7 +28,7 @@ void __noreturn sp_main(struct ffa_init_info *init_info) struct ffa_call_ep ffarpc_call_ep; struct rpc_interface *test_runner_iface; struct ffarpc_caller ffarpc_caller; - struct ffa_direct_msg req_msg; + struct sp_msg req_msg; /* Boot */ if (sp_init(&own_id) != 0) goto fatal_error; @@ -47,20 +47,18 @@ void __noreturn sp_main(struct ffa_init_info *init_info) ffa_call_ep_init(&ffarpc_call_ep, test_runner_iface); /* End of boot phase */ - ffa_msg_wait(&req_msg); + sp_msg_wait(&req_msg); while (1) { - if (req_msg.function_id == FFA_MSG_SEND_DIRECT_REQ_32) { - struct ffa_direct_msg resp_msg; + struct sp_msg resp_msg; - ffa_call_ep_receive(&ffarpc_call_ep, &req_msg, &resp_msg); + ffa_call_ep_receive(&ffarpc_call_ep, &req_msg, &resp_msg); - ffa_msg_send_direct_resp(req_msg.destination_id, - req_msg.source_id, resp_msg.args[0], resp_msg.args[1], - resp_msg.args[2], resp_msg.args[3], resp_msg.args[4], - &req_msg); - } + resp_msg.source_id = req_msg.destination_id; + resp_msg.destination_id = req_msg.source_id; + + sp_msg_send_direct_resp(&resp_msg, &req_msg); } fatal_error: |