IOB: Some handy macros

This commit is contained in:
Gregory Nutt 2014-06-06 10:28:18 -06:00
parent a304a73608
commit 94259f725e
1 changed files with 5 additions and 0 deletions

View File

@ -54,9 +54,14 @@
#define IOBFLAGS_MCAST (1 << 0) /* Multicast packet */
/* IOB helpers */
#define IOB_FREESPACE(n) (CONFIG_IOB_BUFSIZE - (n)->io_len - (n)->io_offset)
/* Queue helpers */
#define IOB_QINIT(q) do { (q)->qh_head = 0; (q)->qh_tail = 0; } while (0)
#define IOB_QEMPTY(q) ((q)->head == NULL)
/****************************************************************************
* Public Types