lib/cmsis_rtos_v1: Implement support for Mail Queue APIs

These APIs provide mail queue functionality like create, put and get.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
This commit is contained in:
Rajavardhan Gundi 2018-07-18 10:09:20 +05:30 committed by Anas Nashif
commit 7c67140baf
3 changed files with 178 additions and 1 deletions

View file

@ -211,6 +211,7 @@ typedef struct os_mailQ_def {
uint32_t queue_sz; ///< number of elements in the queue
uint32_t item_sz; ///< size of an item
void *pool; ///< memory array for mail
struct k_mbox *mbox;
} osMailQDef_t;
/// Event structure contains detailed information about an event.
@ -641,8 +642,10 @@ osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec);
extern const osMailQDef_t os_mailQ_def_##name
#else // define the object
#define osMailQDef(name, queue_sz, type) \
struct k_mbox mbox_##name; \
K_MEM_SLAB_DEFINE(mailq_slab_##name, sizeof(type), queue_sz, 4); \
const osMailQDef_t os_mailQ_def_##name = \
{ (queue_sz), sizeof (type) }
{ (queue_sz), sizeof (type), (&mailq_slab_##name), (&mbox_##name) }
#endif
/// \brief Access a Mail Queue Definition.