Set response source and destination in RPC endpoint
Set source and destination FF-A ID of the response message in the
FF-A RPC endpoint code instead of SP specific functions.
Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: If8ad66f6d621a3a234914f48aa0c3d1719f14591
diff --git a/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c b/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c
index 3035c16..0e34c5c 100644
--- a/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c
+++ b/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c
@@ -261,6 +261,8 @@
const struct sp_msg *req_msg,
struct sp_msg *resp_msg)
{
+ resp_msg->source_id = req_msg->destination_id;
+ resp_msg->destination_id = req_msg->source_id;
resp_msg->is_64bit_message = req_msg->is_64bit_message;
memset(&resp_msg->args, 0x00, sizeof(resp_msg->args));
diff --git a/deployments/attestation/common/attestation_sp.c b/deployments/attestation/common/attestation_sp.c
index 6e05a04..6cfb55c 100644
--- a/deployments/attestation/common/attestation_sp.c
+++ b/deployments/attestation/common/attestation_sp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -108,9 +108,6 @@
ffa_call_ep_receive(&ffarpc_call_ep, &req_msg, &resp_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);
}
diff --git a/deployments/crypto/common/crypto_sp.c b/deployments/crypto/common/crypto_sp.c
index ce236d9..867cf3f 100644
--- a/deployments/crypto/common/crypto_sp.c
+++ b/deployments/crypto/common/crypto_sp.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
/*
- * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
*/
@@ -59,9 +59,6 @@
while (1) {
ffa_call_ep_receive(&ffarpc_call_ep, &req_msg, &resp_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);
}
diff --git a/deployments/internal-trusted-storage/common/its_sp.c b/deployments/internal-trusted-storage/common/its_sp.c
index 18df88f..dfc15ed 100644
--- a/deployments/internal-trusted-storage/common/its_sp.c
+++ b/deployments/internal-trusted-storage/common/its_sp.c
@@ -52,9 +52,6 @@
while (1) {
ffa_call_ep_receive(&ffa_call_ep, &req_msg, &resp_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);
}
}
diff --git a/deployments/protected-storage/common/ps_sp.c b/deployments/protected-storage/common/ps_sp.c
index 1b47710..564378d 100644
--- a/deployments/protected-storage/common/ps_sp.c
+++ b/deployments/protected-storage/common/ps_sp.c
@@ -52,9 +52,6 @@
while (1) {
ffa_call_ep_receive(&ffa_call_ep, &req_msg, &resp_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);
}
}
diff --git a/deployments/se-proxy/common/se_proxy_sp.c b/deployments/se-proxy/common/se_proxy_sp.c
index ef90d9e..1f26ce0 100644
--- a/deployments/se-proxy/common/se_proxy_sp.c
+++ b/deployments/se-proxy/common/se_proxy_sp.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*/
#include <rpc/ffarpc/endpoint/ffarpc_call_ep.h>
@@ -57,9 +57,6 @@
ffa_call_ep_receive(&ffarpc_call_ep, &req_msg, &resp_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);
}