Go to the documentation of this file.
5 #ifndef _LINUX_CIRC_BUF_H
6 #define _LINUX_CIRC_BUF_H 1
15 #define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size)-1))
20 #define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size))
25 #define CIRC_CNT_TO_END(head,tail,size) \
26 ({int end = (size) - (tail); \
27 int n = ((head) + end) & ((size)-1); \
31 #define CIRC_SPACE_TO_END(head,tail,size) \
32 ({int end = (size) - 1 - (head); \
33 int n = (end + (tail)) & ((size)-1); \
34 n <= end ? n : end+1;})