| H A D | kfifo.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * A generic kernel FIFO implementation 8 #include <linux/dma-mapping.h> 18 * internal helper to calculate the unused elements in a fifo 20 static inline unsigned int kfifo_unused(struct __kfifo *fifo) in kfifo_unused() 22 return (fifo in kfifo_unused() 19 kfifo_unused(struct __kfifo * fifo) kfifo_unused() argument 24 __kfifo_alloc(struct __kfifo * fifo,unsigned int size,size_t esize,gfp_t gfp_mask) __kfifo_alloc() argument 55 __kfifo_free(struct __kfifo * fifo) __kfifo_free() argument 66 __kfifo_init(struct __kfifo * fifo,void * buffer,unsigned int size,size_t esize) __kfifo_init() argument 67 __kfifo_init(struct __kfifo * fifo,void * buffer,unsigned int size,size_t esize) __kfifo_init() argument 89 kfifo_copy_in(struct __kfifo * fifo,const void * src,unsigned int len,unsigned int off) kfifo_copy_in() argument 92 unsigned int size = fifo->mask + 1; kfifo_copy_in() local 113 __kfifo_in(struct __kfifo * fifo,const void * buf,unsigned int len) __kfifo_in() argument 128 kfifo_copy_out(struct __kfifo * fifo,void * dst,unsigned int len,unsigned int off) kfifo_copy_out() argument 131 unsigned int size = fifo->mask + 1; kfifo_copy_out() local 152 __kfifo_out_peek(struct __kfifo * fifo,void * buf,unsigned int len) __kfifo_out_peek() argument 166 __kfifo_out(struct __kfifo * fifo,void * buf,unsigned int len) __kfifo_out() argument 175 kfifo_copy_from_user(struct __kfifo * fifo,const void __user * from,unsigned int len,unsigned int off,unsigned int * copied) kfifo_copy_from_user() argument 179 unsigned int size = fifo->mask + 1; kfifo_copy_from_user() local 210 __kfifo_from_user(struct __kfifo * fifo,const void __user * from,unsigned long len,unsigned int * copied) __kfifo_from_user() argument 236 kfifo_copy_to_user(struct __kfifo * fifo,void __user * to,unsigned int len,unsigned int off,unsigned int * copied) kfifo_copy_to_user() argument 241 unsigned int size = fifo->mask + 1; kfifo_copy_to_user() local 270 __kfifo_to_user(struct __kfifo * fifo,void __user * to,unsigned long len,unsigned int * copied) __kfifo_to_user() argument 334 setup_sgl(struct __kfifo * fifo,struct scatterlist * sgl,int nents,unsigned int len,unsigned int off) setup_sgl() argument 337 unsigned int size = fifo->mask + 1; setup_sgl() local 356 __kfifo_dma_in_prepare(struct __kfifo * fifo,struct scatterlist * sgl,int nents,unsigned int len) __kfifo_dma_in_prepare() argument 369 __kfifo_dma_out_prepare(struct __kfifo * fifo,struct scatterlist * sgl,int nents,unsigned int len) __kfifo_dma_out_prepare() argument 398 __kfifo_peek_n(struct __kfifo * fifo,size_t recsize) __kfifo_peek_n() argument 421 __kfifo_poke_n(struct __kfifo * fifo,unsigned int n,size_t recsize) __kfifo_poke_n() argument 432 __kfifo_len_r(struct __kfifo * fifo,size_t recsize) __kfifo_len_r() argument 438 __kfifo_in_r(struct __kfifo * fifo,const void * buf,unsigned int len,size_t recsize) __kfifo_in_r() argument 452 kfifo_out_copy_r(struct __kfifo * fifo,void * buf,unsigned int len,size_t recsize,unsigned int * n) kfifo_out_copy_r() argument 464 __kfifo_out_peek_r(struct __kfifo * fifo,void * buf,unsigned int len,size_t recsize) __kfifo_out_peek_r() argument 476 __kfifo_out_r(struct __kfifo * fifo,void * buf,unsigned int len,size_t recsize) __kfifo_out_r() argument 490 __kfifo_skip_r(struct __kfifo * fifo,size_t recsize) __kfifo_skip_r() argument 499 __kfifo_from_user_r(struct __kfifo * fifo,const void __user * from,unsigned long len,unsigned int * copied,size_t recsize) __kfifo_from_user_r() argument 523 __kfifo_to_user_r(struct __kfifo * fifo,void __user * to,unsigned long len,unsigned int * copied,size_t recsize) __kfifo_to_user_r() argument 548 __kfifo_dma_in_prepare_r(struct __kfifo * fifo,struct scatterlist * sgl,int nents,unsigned int len,size_t recsize) __kfifo_dma_in_prepare_r() argument 562 __kfifo_dma_in_finish_r(struct __kfifo * fifo,unsigned int len,size_t recsize) __kfifo_dma_in_finish_r() argument 571 __kfifo_dma_out_prepare_r(struct __kfifo * fifo,struct scatterlist * sgl,int nents,unsigned int len,size_t recsize) __kfifo_dma_out_prepare_r() argument 585 __kfifo_dma_out_finish_r(struct __kfifo * fifo,size_t recsize) __kfifo_dma_out_finish_r() argument [all...] |
| H A D | kfifo.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 3 * A generic kernel FIFO implementation 12 * How to porting drivers to the new generic FIFO API: 14 * - Modify the declaration of the "struct kfifo *" object into a 15 * in-place "struct kfifo" object 16 * - Ini 67 __STRUCT_KFIFO(type,size,recsize,ptrtype) global() argument 73 STRUCT_KFIFO(type,size) global() argument 90 STRUCT_KFIFO_REC_1(size) global() argument 93 STRUCT_KFIFO_REC_2(size) global() argument 107 __is_kfifo_ptr(fifo) global() argument 115 DECLARE_KFIFO_PTR(fifo,type) global() argument 123 DECLARE_KFIFO(fifo,type,size) global() argument 129 INIT_KFIFO(fifo) global() argument 148 DEFINE_KFIFO(fifo,type,size) global() argument 186 kfifo_initialized(fifo) global() argument 192 kfifo_esize(fifo) global() argument 198 kfifo_recsize(fifo) global() argument 204 kfifo_size(fifo) global() argument 214 kfifo_reset(fifo) global() argument 228 kfifo_reset_out(fifo) global() argument 238 kfifo_len(fifo) global() argument 248 kfifo_is_empty(fifo) global() argument 260 kfifo_is_empty_spinlocked(fifo,lock) global() argument 276 kfifo_is_empty_spinlocked_noirqsave(fifo,lock) global() argument 289 kfifo_is_full(fifo) global() argument 299 kfifo_avail(fifo) global() argument 316 kfifo_skip_count(fifo,count) global() argument 330 kfifo_skip(fifo) global() argument 338 kfifo_peek_len(fifo) global() argument 361 kfifo_alloc(fifo,size,gfp_mask) global() argument 376 kfifo_free(fifo) global() argument 395 kfifo_init(fifo,buffer,size) global() argument 416 kfifo_put(fifo,val) global() argument 453 kfifo_get(fifo,val) global() argument 492 kfifo_peek(fifo,val) global() argument 530 kfifo_in(fifo,buf,n) global() argument 552 kfifo_in_spinlocked(fifo,buf,n,lock) global() argument 573 kfifo_in_spinlocked_noirqsave(fifo,buf,n,lock) global() argument 583 kfifo_in_locked(fifo,buf,n,lock) global() argument 598 kfifo_out(fifo,buf,n) global() argument 622 kfifo_out_spinlocked(fifo,buf,n,lock) global() argument 645 kfifo_out_spinlocked_noirqsave(fifo,buf,n,lock) global() argument 657 kfifo_out_locked(fifo,buf,n,lock) global() argument 673 kfifo_from_user(fifo,from,len,copied) global() argument 701 kfifo_to_user(fifo,to,len,copied) global() argument 730 kfifo_dma_in_prepare_mapped(fifo,sgl,nents,len,dma) global() argument 744 kfifo_dma_in_prepare(fifo,sgl,nents,len) global() argument 758 kfifo_dma_in_finish(fifo,len) global() argument 786 kfifo_dma_out_prepare_mapped(fifo,sgl,nents,len,dma) global() argument 800 kfifo_dma_out_prepare(fifo,sgl,nents,len) global() argument 814 kfifo_dma_out_finish(fifo,len) global() argument 831 kfifo_out_peek(fifo,buf,n) global() argument 861 kfifo_out_linear(fifo,tail,n) global() argument 890 kfifo_out_linear_ptr(fifo,ptr,n) global() argument [all...] |