diff options
author | Peter Mitsis <peter.mitsis@windriver.com> | 2015-12-02 12:39:14 -0500 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2016-02-05 20:25:05 -0500 |
commit | 5deb202a8c4140951fb5903f9d403aa4ae759e46 (patch) | |
tree | 41beaccbb0dbdb6dd0818138fa52c9ba84ed5d6b /include/microkernel | |
parent | 5a338dc21f17aaebf258fe8ce7f509c401918d71 (diff) |
fifo: Simplify task_fifo_put() API family
Changes the FIFO API so that the timeout parameter must be specified
when invoking task_fifo_put() thereby making the following APIs obsolete:
task_fifo_put_wait()
task_fifo_put_wait_timeout()
_task_fifo_put()
Change-Id: Ifbbfb7018fd9a71551ccba648fda6d2d59d589a6
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Diffstat (limited to 'include/microkernel')
-rw-r--r-- | include/microkernel/fifo.h | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/include/microkernel/fifo.h b/include/microkernel/fifo.h index 8c7724e93..103e91aca 100644 --- a/include/microkernel/fifo.h +++ b/include/microkernel/fifo.h @@ -42,7 +42,6 @@ extern "C" { /** * @cond internal */ -extern int _task_fifo_put(kfifo_t queue, void *data, int32_t time); extern int _task_fifo_get(kfifo_t queue, void *data, int32_t time); extern int _task_fifo_ioctl(kfifo_t queue, int op); @@ -70,42 +69,23 @@ extern int _task_fifo_ioctl(kfifo_t queue, int op); /** * @brief FIFO enqueue request * - * This routine puts an entry at the end of the FIFO queue. + * This routine adds an item to the FIFO queue. If the FIFO is currently full + * then the routine either waits until space becomes available, or until the + * specified time limit is reached. * - * @param q FIFO queue. - * @param p Pointer to data to add to queue. - * - * @return RC_OK on success, RC_FAIL on failure. - */ -#define task_fifo_put(q, p) _task_fifo_put(q, p, TICKS_NONE) - -/** - * @brief FIFO enqueue request with waiting. - * - * This routine tries to put an entry at the end of the FIFO queue. - * - * @param q FIFO queue. - * @param p Pointer to data to add to queue. - * - * @return RC_OK on success, RC_FAIL on failure. - */ -#define task_fifo_put_wait(q, p) _task_fifo_put(q, p, TICKS_UNLIMITED) - -#ifdef CONFIG_SYS_CLOCK_EXISTS - -/** - * @brief FIFO enqueue request with a time out. - * - * This routine puts an entry at the end of the FIFO queue with a time out. + * @param queue FIFO queue. + * @param data Pointer to data to add to queue. + * @param timeout Affects the action taken should the FIFO be full. 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. * - * @param q FIFO queue. - * @param p Pointer to data to add to queue. - * @param t Maximum number of ticks to wait. - * - * @return RC_OK on success, RC_FAIL on failure, RC_TIME on timeout. + * @retval RC_OK Successfully added item to FIFO + * @retval RC_TIME Timed out while waiting to add item to FIFO + * @retval RC_FAIL Failed to immediately add item to FIFO when + * @a timeout = TICKS_NONE */ -#define task_fifo_put_wait_timeout(q, p, t) _task_fifo_put(q, p, t) -#endif +extern int task_fifo_put(kfifo_t queue, void *data, int32_t timeout); /** * @brief FIFO dequeue request |