Dualcpu: Add NS mailbox statistics functionalities
Add statistics module in NS mailbox.
It records the number of mailbox message submission and the total
number of occupied NS mailbox queue slots each time NS task
acquires a mailbox queue slot.
NS tests can call tfm_ns_mailbox_stats_avg_slots() to calculate
the average number of occupied NS mailbox queue slots each time
NS task acquires a mailbox queue slot. It can prove the feature of
multiple outstanding NS PSA Client calls feature in dual-core
mailbox.
Change-Id: Icd9553996c516901f6b3fc7d68b4c4d0f0f0a5da
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/interface/include/tfm_mailbox.h b/interface/include/tfm_mailbox.h
index 3cfb1b5..3d128f4 100644
--- a/interface/include/tfm_mailbox.h
+++ b/interface/include/tfm_mailbox.h
@@ -158,6 +158,19 @@
*/
struct ns_mailbox_slot_t queue[NUM_MAILBOX_QUEUE_SLOT];
+
+#ifdef TFM_MULTI_CORE_TEST
+ uint32_t nr_tx; /* The total number of
+ * submission of NS PSA Client
+ * calls from NS task via
+ * mailbox.
+ */
+ uint32_t nr_used_slots; /* The total number of used
+ * mailbox queue slots each time
+ * NS thread requests a mailbox
+ * queue slot.
+ */
+#endif
};
#ifdef __cplusplus