aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hu <david.hu@arm.com>2019-11-18 14:03:53 +0800
committerDavid Hu <david.hu@arm.com>2019-12-05 08:34:31 +0000
commit84ed17b3b306c8593d954b70174439a5b773ac01 (patch)
tree765971310ffc09437ea6728c6cebcd89d92657fc
parent1ce712affb8be91ede0d1d9fd4f45d68201ac591 (diff)
downloadtrusted-firmware-m-84ed17b3b306c8593d954b70174439a5b773ac01.tar.gz
Dualcpu: Call core memory operation APIs in SPE mailbox
Since SPE mailbox sits in TF-M core, call tfm_core_util_memcpy() and tfm_core_util_memset(), instead of tfm_memcpy() or tfm_memset() in SPE mailbox. Change-Id: I2ef805678d25185ff6e6429637021809071f62d6 Signed-off-by: David Hu <david.hu@arm.com>
-rw-r--r--secure_fw/core/ipc/tfm_spe_mailbox.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/secure_fw/core/ipc/tfm_spe_mailbox.c b/secure_fw/core/ipc/tfm_spe_mailbox.c
index c2c66a324d..7eec12a644 100644
--- a/secure_fw/core/ipc/tfm_spe_mailbox.c
+++ b/secure_fw/core/ipc/tfm_spe_mailbox.c
@@ -8,7 +8,7 @@
#include "cmsis_compiler.h"
#include "psa/error.h"
-#include "tfm_memory_utils.h"
+#include "tfm_core_utils.h"
#include "tfm_utils.h"
#include "tfm_spe_mailbox.h"
#include "tfm_rpc.h"
@@ -133,8 +133,8 @@ static void mailbox_clean_queue_slot(uint8_t idx)
return;
}
- tfm_memset(&spe_mailbox_queue.queue[idx], 0,
- sizeof(spe_mailbox_queue.queue[idx]));
+ tfm_core_util_memset(&spe_mailbox_queue.queue[idx], 0,
+ sizeof(spe_mailbox_queue.queue[idx]));
set_spe_queue_empty_status(idx);
}
@@ -158,8 +158,8 @@ static void mailbox_direct_reply(uint8_t idx, uint32_t result)
/* Get reply address */
reply_ptr = get_nspe_reply_addr(idx);
- tfm_memcpy(&reply_ptr->return_val, &ret_result,
- sizeof(reply_ptr->return_val));
+ tfm_core_util_memcpy(&reply_ptr->return_val, &ret_result,
+ sizeof(reply_ptr->return_val));
mailbox_clean_queue_slot(idx);
@@ -220,7 +220,8 @@ int32_t tfm_mailbox_handle_msg(void)
spe_mailbox_queue.queue[idx].ns_slot_idx = idx;
msg_ptr = &spe_mailbox_queue.queue[idx].msg;
- tfm_memcpy(msg_ptr, &ns_queue->queue[idx].msg, sizeof(*msg_ptr));
+ tfm_core_util_memcpy(msg_ptr, &ns_queue->queue[idx].msg,
+ sizeof(*msg_ptr));
if (check_mailbox_msg(msg_ptr) != MAILBOX_SUCCESS) {
mailbox_clean_queue_slot(idx);
@@ -354,7 +355,7 @@ int32_t tfm_ns_mailbox_init(void)
{
int32_t ret;
- tfm_memset(&spe_mailbox_queue, 0, sizeof(spe_mailbox_queue));
+ tfm_core_util_memset(&spe_mailbox_queue, 0, sizeof(spe_mailbox_queue));
spe_mailbox_queue.empty_slots =
(mailbox_queue_status_t)((1 << NUM_MAILBOX_QUEUE_SLOT) - 1);