27 #include <sys/cdefs.h>
31 #include <sys/param.h>
32 #include <sys/systm.h>
33 #include <sys/kernel.h>
34 #include <sys/malloc.h>
36 #include <sys/buf_ring.h>
44 KASSERT(powerof2(count), (
"buf ring must be size power of 2"));
46 br =
malloc(
sizeof(
struct buf_ring) + count*
sizeof(caddr_t),
53 br->br_prod_size = br->br_cons_size =
count;
54 br->br_prod_mask = br->br_cons_mask = count-1;
55 br->br_prod_head = br->br_cons_head = 0;
56 br->br_prod_tail = br->br_cons_tail = 0;
void * malloc(unsigned long size, struct malloc_type *mtp, int flags)
struct buf_ring * buf_ring_alloc(int count, struct malloc_type *type, int flags, struct mtx *lock)
void free(void *addr, struct malloc_type *mtp)
void buf_ring_free(struct buf_ring *br, struct malloc_type *type)