26 lines
456 B
C
26 lines
456 B
C
#ifndef _BKFIFO_H_
|
|
#define _BKFIFO_H_
|
|
|
|
struct __bkfifo {
|
|
unsigned int in;
|
|
unsigned int out;
|
|
unsigned int mask;
|
|
unsigned int esize;
|
|
void* data;
|
|
};
|
|
|
|
#define __SRTUCT_BKFIFO_COMMON(datatype, recsize, ptrtype) \
|
|
union { \
|
|
struct _kfifo_ kfifo; \
|
|
}
|
|
|
|
#define __SRTUCT_BKFIFO(type, size, recsize, ptrtype) \
|
|
{ \
|
|
__STRUCT_BKFIFO_COMMON(type, recsize, ptrtype); \
|
|
type buf[((size < 2) || (size & (size - 1))) ? -1 : size]; \
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // _BKFIFO_H_
|