nano_fifo: use a _nano_queue for the data queue

Change-Id: I963ab8a30b54a765f23e86158e7c38dd5cfff546
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2015-05-05 18:58:10 -04:00 committed by Anas Nashif
commit 806fce93b7
2 changed files with 5 additions and 8 deletions

View file

@ -57,10 +57,7 @@ struct nano_lifo {
struct nano_fifo {
union {
struct _nano_queue wait_q;
struct {
void *head;
void *tail;
};
struct _nano_queue data_q;
};
int stat;
};

View file

@ -104,8 +104,8 @@ FUNC_ALIAS(_fifo_put, nano_fiber_fifo_put, void);
static inline void enqueue_data(struct nano_fifo *fifo, void *data)
{
*(void **)fifo->tail = data;
fifo->tail = data;
*(void **)fifo->data_q.tail = data;
fifo->data_q.tail = data;
*(int *)data = 0;
}
@ -219,7 +219,7 @@ FUNC_ALIAS(_fifo_get, nano_fifo_get, void *);
static inline void *dequeue_data(struct nano_fifo *fifo)
{
void *data = fifo->head;
void *data = fifo->data_q.head;
if (fifo->stat == 0) {
/*
@ -229,7 +229,7 @@ static inline void *dequeue_data(struct nano_fifo *fifo)
*/
_nano_wait_q_reset(&fifo->wait_q);
} else {
fifo->head = *(void **)data;
fifo->data_q.head = *(void **)data;
}
return data;