Dualcpu: Adjust the definition number of mailbox queue slots
If multiple outstanding NS PSA Client calls feature is enabled,
require platform to define NUM_MAILBOX_QUEUE_SLOT in platform
specific device_cfg.h.
Otherwise, define NUM_MAILBOX_QUEUE_SLOT as 1 in tfm_mailbox.h.
Also fix the initialization of queue empty slot status variables
since NUM_MAILBOX_QUEUE_SLOT can be set to 32.
Change-Id: I26ea1283f8c6cad9ebe31b24c06ddccf3d2e5699
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/interface/src/tfm_ns_mailbox.c b/interface/src/tfm_ns_mailbox.c
index a623a7b..2690bd4 100644
--- a/interface/src/tfm_ns_mailbox.c
+++ b/interface/src/tfm_ns_mailbox.c
@@ -301,8 +301,10 @@
memset(queue, 0, sizeof(*queue));
/* Initialize empty bitmask */
- queue->empty_slots = (mailbox_queue_status_t)((1 << NUM_MAILBOX_QUEUE_SLOT)
- - 1);
+ queue->empty_slots =
+ (mailbox_queue_status_t)((1UL << (NUM_MAILBOX_QUEUE_SLOT - 1)) - 1);
+ queue->empty_slots +=
+ (mailbox_queue_status_t)(1UL << (NUM_MAILBOX_QUEUE_SLOT - 1));
mailbox_queue_ptr = queue;