Dualcpu: Add NS mailbox functions to handle reply in IRQ handler
Add tfm_ns_mailbox_fetch_reply_msg_isr() to fetch the handle of the
first replied mailbox message from NSPE mailbox queue in platform
inter-processor communication interrupt handler.
NS OS can get the handle of the waiting caller task by calling
tfm_ns_mailbox_get_msg_owner() and wake-up the caller task
according to the handle value.
Change-Id: Id86e0b23819cf8963831006fd037142d9efb4d9f
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 3340735..49c4ca6 100644
--- a/interface/include/tfm_ns_mailbox.h
+++ b/interface/include/tfm_ns_mailbox.h
@@ -88,6 +88,32 @@
#endif
/**
+ * \brief Fetch the handle to the first replied mailbox message in the NSPE
+ * mailbox queue.
+ * This function is intended to be called inside platform specific
+ * notification IRQ handler.
+ *
+ * \note The replied status of the fetched mailbox message will be cleaned after
+ * the message is fetched. When this function is called again, it fetches
+ * the next replied mailbox message from the NSPE mailbox queue.
+ *
+ * \return Return the handle to the first replied mailbox message in the
+ * queue.
+ * Return \ref MAILBOX_MSG_NULL_HANDLE if no mailbox message is replied.
+ */
+mailbox_msg_handle_t tfm_ns_mailbox_fetch_reply_msg_isr(void);
+
+/**
+ * \brief Return the handle of owner task of a mailbox message according to the
+ * \ref mailbox_msg_handle_t
+ *
+ * \param[in] handle The handle of mailbox message.
+ *
+ * \return Return the handle value of the owner task.
+ */
+const void *tfm_ns_mailbox_get_msg_owner(mailbox_msg_handle_t handle);
+
+/**
* \brief Platform specific NSPE mailbox initialization.
* Invoked by \ref tfm_ns_mailbox_init().
*