Twincpu: Update NSPE mailbox APIs
Update NSPE mailbox APIs to align with Non-secure interface naming
convention.
Change-Id: I97d984c13f935bca8b3f28df5dd8d5c38b6c503d
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/interface/include/tfm_ns_mailbox.h b/interface/include/tfm_ns_mailbox.h
index 9beb509..d2bbd3f 100644
--- a/interface/include/tfm_ns_mailbox.h
+++ b/interface/include/tfm_ns_mailbox.h
@@ -13,8 +13,12 @@
#include <stdbool.h>
#include "tfm_mailbox.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
- * \brief Prepare and send PSA client call request to SPE via mailbox.
+ * \brief Prepare and send PSA client request to SPE via mailbox.
*
* \param[in] call_type PSA client call type
* \param[in] params Parmaters used for PSA client call
@@ -25,12 +29,12 @@
* \retval >= 0 The handle to the mailbox message assigned.
* \retval < 0 Operation failed with an error code.
*/
-mailbox_msg_handle_t mailbox_tx_client_call_req(uint32_t call_type,
- const struct psa_client_params_t *params,
- int32_t client_id);
+mailbox_msg_handle_t tfm_ns_mailbox_tx_client_req(uint32_t call_type,
+ const struct psa_client_params_t *params,
+ int32_t client_id);
/**
- * \brief Fetch PSA client call return result.
+ * \brief Fetch PSA client return result.
*
* \param[in] handle The handle to the mailbox message
* \param[out] reply The address to be written with return result.
@@ -38,8 +42,8 @@
* \retval MAILBOX_SUCCESS Successfully get PSA client call return result.
* \retval Other return code Operation failed with an error code.
*/
-int32_t mailbox_rx_client_call_reply(mailbox_msg_handle_t handle,
- int32_t *reply);
+int32_t tfm_ns_mailbox_rx_client_reply(mailbox_msg_handle_t handle,
+ int32_t *reply);
/**
* \brief Check whether a specific mailbox message has been replied.
@@ -50,15 +54,7 @@
* \retval false The PSA client call return value is not
* replied yet.
*/
-bool mailbox_is_msg_replied(mailbox_msg_handle_t handle);
-
-/**
- * \brief Notify SPE to deal with the PSA client call sent via mailbox
- *
- * \retval MAILBOX_SUCCESS Operation succeeded.
- * \retval Other return code Operation failed with an error code.
- */
-int32_t mailbox_notify_peer(void);
+bool tfm_ns_mailbox_is_msg_replied(mailbox_msg_handle_t handle);
/**
* \brief NSPE mailbox initialization
@@ -69,11 +65,11 @@
* \retval MAILBOX_SUCCESS Operation succeeded.
* \retval Other return code Operation failed with an error code.
*/
-int32_t mailbox_init(struct ns_mailbox_queue_t *queue);
+int32_t tfm_ns_mailbox_init(struct ns_mailbox_queue_t *queue);
/**
* \brief Platform specific NSPE mailbox initialization.
- * Invoked by \ref mailbox_init().
+ * Invoked by \ref tfm_ns_mailbox_init().
*
* \param[in] queue The base address of NSPE mailbox queue to be
* initialized.
@@ -81,16 +77,34 @@
* \retval MAILBOX_SUCCESS Operation succeeded.
* \retval Other return code Operation failed with an error code.
*/
-int32_t mailbox_hal_init(struct ns_mailbox_queue_t *queue);
+int32_t tfm_ns_mailbox_hal_init(struct ns_mailbox_queue_t *queue);
/**
- * \brief Enter critical section of NSPE mailbox
+ * \brief Notify SPE to deal with the PSA client call sent via mailbox
+ *
+ * \note The implementation depends on platform specific hardware and use case.
+ *
+ * \retval MAILBOX_SUCCESS Operation succeeded.
+ * \retval Other return code Operation failed with an error code.
*/
-void mailbox_enter_critical(void);
+int32_t tfm_ns_mailbox_hal_notify_peer(void);
/**
- * \brief Exit critical section of NSPE mailbox
+ * \brief Enter critical section of NSPE mailbox.
+ *
+ * \note The implementation depends on platform specific hardware and use case.
*/
-void mailbox_exit_critical(void);
+void tfm_ns_mailbox_hal_enter_critical(void);
+
+/**
+ * \brief Exit critical section of NSPE mailbox.
+ *
+ * \note The implementation depends on platform specific hardware and use case.
+ */
+void tfm_ns_mailbox_hal_exit_critical(void);
+
+#ifdef __cplusplus
+}
+#endif
#endif /* __TFM_NS_MAILBOX_H__ */