summaryrefslogtreecommitdiff
path: root/include/microkernel
diff options
context:
space:
mode:
authorPeter Mitsis <peter.mitsis@windriver.com>2015-12-03 11:38:31 -0500
committerAnas Nashif <anas.nashif@intel.com>2016-02-05 20:25:05 -0500
commitb4ba8087e7d979279411ae5782cc192534752553 (patch)
tree8035b1684ccb92d7fd680346f55eaf731b834967 /include/microkernel
parent96116cadbb51513049def794e47bc60a204815f8 (diff)
mailbox: Simplify task_mbox_get() API family
Changes the mailbox API so that the timeout parameter must be specified when invoking task_mbox_get() thereby obsoleting the following APIs: task_mbox_get_wait() task_mbox_get_wait_timeout() _task_mbox_get() Change-Id: Ie028223ec342666e61d3d69750aec37dbe2b493e Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Diffstat (limited to 'include/microkernel')
-rw-r--r--include/microkernel/mailbox.h43
1 files changed, 11 insertions, 32 deletions
diff --git a/include/microkernel/mailbox.h b/include/microkernel/mailbox.h
index 14a93246b..857c02ab1 100644
--- a/include/microkernel/mailbox.h
+++ b/include/microkernel/mailbox.h
@@ -40,8 +40,6 @@ extern "C" {
/**
* @cond internal
*/
-extern int _task_mbox_get(kmbox_t mbox, struct k_msg *M, int32_t time);
-
extern void _task_mbox_block_put(kmbox_t mbox,
kpriority_t prio,
struct k_msg *M,
@@ -89,40 +87,21 @@ extern int task_mbox_put(kmbox_t mbox, kpriority_t prio,
/**
* @brief Gets struct k_msg message header structure information from
- * a mailbox
- *
- * @param b mailbox
- * @param m pointer to message
- *
- * @return RC_OK, RC_FAIL on success, failure respectively
- */
-#define task_mbox_get(b, m) _task_mbox_get(b, m, TICKS_NONE)
-
-/**
- * @brief Gets struct k_msg message header structure information from
- * a mailbox and wait
- *
- * @param b mailbox
- * @param m pointer to message
- *
- * @return RC_OK, RC_FAIL on success, failure respectively
- */
-#define task_mbox_get_wait(b, m) _task_mbox_get(b, m, TICKS_UNLIMITED)
-
-#ifdef CONFIG_SYS_CLOCK_EXISTS
-
-/**
- * @brief Gets struct k_msg message header structure information from
* a mailbox and wait with timeout.
*
- * @param b mailbox
- * @param m pointer to message
- * @param t maximum number of ticks to wait
+ * @param mbox Mailbox
+ * @param M Pointer to message
+ * @param timeout Affects the action taken should there not be a waiting
+ * sender. If TICKS_NONE, then return immediately. If TICKS_UNLIMITED, then
+ * wait as long as necessary. Otherwise wait up to the specified number of
+ * ticks before timing out.
*
- * @return RC_OK, RC_FAIL, RC_TIME on success, failure, timeout respectively
+ * @return RC_OK Successfully received message
+ * @return RC_TIME Timed out while waiting to receive message
+ * @return RC_FAIL Failed to immediately receive message when
+ * @a timeout = TICKS_NONE
*/
-#define task_mbox_get_wait_timeout(b, m, t) _task_mbox_get(b, m, t)
-#endif
+extern int task_mbox_get(kmbox_t mbox, struct k_msg *M, int32_t timeout);
/**
* @brief Send a message asynchronously to a mailbox