aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hu <david.hu@arm.com>2019-11-18 15:54:18 +0800
committerDavid Hu <david.hu@arm.com>2019-12-05 08:34:31 +0000
commitdf40bcc3c20ea32cd5b0cc99c23326ccb1db79ea (patch)
tree1513ca7d0ed945da3b9ab04d5ffc823b205b8876
parent84ed17b3b306c8593d954b70174439a5b773ac01 (diff)
downloadtrusted-firmware-m-df40bcc3c20ea32cd5b0cc99c23326ccb1db79ea.tar.gz
Dualcpu: Fix SPE mailbox HAL APIs
Improve SPE mailbox HAL APIs declarations. Fix SPE mailbox HAL APIs typos in tfm_spe_mailbox.c Change-Id: Ib862488682ed2c37786c30364ca0fb1e93779947 Signed-off-by: David Hu <david.hu@arm.com>
-rw-r--r--secure_fw/core/ipc/include/tfm_spe_mailbox.h23
-rw-r--r--secure_fw/core/ipc/tfm_spe_mailbox.c22
2 files changed, 23 insertions, 22 deletions
diff --git a/secure_fw/core/ipc/include/tfm_spe_mailbox.h b/secure_fw/core/ipc/include/tfm_spe_mailbox.h
index 2451bf8582..0bd7943668 100644
--- a/secure_fw/core/ipc/include/tfm_spe_mailbox.h
+++ b/secure_fw/core/ipc/include/tfm_spe_mailbox.h
@@ -46,14 +46,6 @@ int32_t tfm_mailbox_handle_msg(void);
int32_t tfm_mailbox_reply_msg(mailbox_msg_handle_t handle, int32_t reply);
/**
- * \brief Notify NSPE that a PSA client call return result is replied
- *
- * \retval MAILBOX_SUCCESS The notification is successfully sent out.
- * \retval Other return code Operation failed with an error code.
- */
-int32_t tfm_mailbox_notify_peer(void);
-
-/**
* \brief SPE mailbox initialization
*
* \retval MAILBOX_SUCCESS Operation succeeded.
@@ -72,13 +64,22 @@ int32_t tfm_mailbox_init(void);
int32_t tfm_mailbox_hal_init(struct secure_mailbox_queue_t *s_queue);
/**
+ * \brief Notify NSPE that a PSA client call return result is replied.
+ * Implemented by platform specific inter-processor communication driver.
+ *
+ * \retval MAILBOX_SUCCESS The notification is successfully sent out.
+ * \retval Other return code Operation failed with an error code.
+ */
+int32_t tfm_mailbox_hal_notify_peer(void);
+
+/**
* \brief Enter critical section of NSPE mailbox
*/
-void tfm_mailbox_enter_critical(void);
+void tfm_mailbox_hal_enter_critical(void);
/**
* \brief Exit critical section of NSPE mailbox
*/
-void tfm_mailbox_exit_critical(void);
+void tfm_mailbox_hal_exit_critical(void);
-#endif /* __TFM_NS_MAILBOX_H__ */ \ No newline at end of file
+#endif /* __TFM_SPE_MAILBOX_H__ */ \ No newline at end of file
diff --git a/secure_fw/core/ipc/tfm_spe_mailbox.c b/secure_fw/core/ipc/tfm_spe_mailbox.c
index 7eec12a644..cfb5bd3514 100644
--- a/secure_fw/core/ipc/tfm_spe_mailbox.c
+++ b/secure_fw/core/ipc/tfm_spe_mailbox.c
@@ -190,17 +190,17 @@ int32_t tfm_mailbox_handle_msg(void)
TFM_ASSERT(ns_queue != NULL);
- tfm_ns_mailbox_hal_enter_critical();
+ tfm_mailbox_hal_enter_critical();
/* Check if NSPE mailbox did assert a PSA client call request */
if (!ns_queue->pend_slots) {
- tfm_ns_mailbox_hal_exit_critical();
+ tfm_mailbox_hal_exit_critical();
return MAILBOX_NO_PEND_EVENT;
}
pend_slots = get_nspe_queue_pend_status(ns_queue);
- tfm_ns_mailbox_hal_exit_critical();
+ tfm_mailbox_hal_exit_critical();
for (idx = 0; idx < NUM_MAILBOX_QUEUE_SLOT; idx++) {
mask_bits = (1 << idx);
@@ -268,7 +268,7 @@ int32_t tfm_mailbox_handle_msg(void)
*/
}
- tfm_ns_mailbox_hal_enter_critical();
+ tfm_mailbox_hal_enter_critical();
/* Clean the NSPE mailbox pending status. */
clear_nspe_queue_pend_status(ns_queue, pend_slots);
@@ -276,10 +276,10 @@ int32_t tfm_mailbox_handle_msg(void)
/* Set the NSPE mailbox replied status */
set_nspe_queue_replied_status(ns_queue, reply_slots);
- tfm_ns_mailbox_hal_exit_critical();
+ tfm_mailbox_hal_exit_critical();
if (reply_slots) {
- tfm_ns_mailbox_hal_notify_peer();
+ tfm_mailbox_hal_notify_peer();
}
return MAILBOX_SUCCESS;
@@ -314,14 +314,14 @@ int32_t tfm_mailbox_reply_msg(mailbox_msg_handle_t handle, int32_t reply)
mailbox_direct_reply(idx, (uint32_t)reply);
- tfm_ns_mailbox_hal_enter_critical();
+ tfm_mailbox_hal_enter_critical();
/* Set the NSPE mailbox replied status */
set_nspe_queue_replied_status(ns_queue, (1 << idx));
- tfm_ns_mailbox_hal_exit_critical();
+ tfm_mailbox_hal_exit_critical();
- tfm_mailbox_notify_peer();
+ tfm_mailbox_hal_notify_peer();
return MAILBOX_SUCCESS;
}
@@ -351,7 +351,7 @@ static const struct tfm_rpc_ops_t mailbox_rpc_ops = {
.reply = mailbox_reply,
};
-int32_t tfm_ns_mailbox_init(void)
+int32_t tfm_mailbox_init(void)
{
int32_t ret;
@@ -371,7 +371,7 @@ int32_t tfm_ns_mailbox_init(void)
* Initialize Inter-Processor Communication and achieve the base address of
* NSPE mailbox queue
*/
- ret = tfm_ns_mailbox_hal_init(&spe_mailbox_queue);
+ ret = tfm_mailbox_hal_init(&spe_mailbox_queue);
if (ret != MAILBOX_SUCCESS) {
tfm_rpc_unregister_ops();