linux/lib/kfifo.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * A generic kernel FIFO implementation
 *
 * Copyright (C) 2009/2010 Stefani Seibold <[email protected]>
 */

#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/export.h>
#include <linux/kfifo.h>
#include <linux/log2.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/uaccess.h>

/*
 * internal helper to calculate the unused elements in a fifo
 */
static inline unsigned int kfifo_unused(struct __kfifo *fifo)
{}

int __kfifo_alloc(struct __kfifo *fifo, unsigned int size,
		size_t esize, gfp_t gfp_mask)
{}
EXPORT_SYMBOL();

void __kfifo_free(struct __kfifo *fifo)
{}
EXPORT_SYMBOL();

int __kfifo_init(struct __kfifo *fifo, void *buffer,
		unsigned int size, size_t esize)
{}
EXPORT_SYMBOL();

static void kfifo_copy_in(struct __kfifo *fifo, const void *src,
		unsigned int len, unsigned int off)
{}

unsigned int __kfifo_in(struct __kfifo *fifo,
		const void *buf, unsigned int len)
{}
EXPORT_SYMBOL();

static void kfifo_copy_out(struct __kfifo *fifo, void *dst,
		unsigned int len, unsigned int off)
{}

unsigned int __kfifo_out_peek(struct __kfifo *fifo,
		void *buf, unsigned int len)
{}
EXPORT_SYMBOL();

unsigned int __kfifo_out_linear(struct __kfifo *fifo,
		unsigned int *tail, unsigned int n)
{}
EXPORT_SYMBOL();

unsigned int __kfifo_out(struct __kfifo *fifo,
		void *buf, unsigned int len)
{}
EXPORT_SYMBOL();

static unsigned long kfifo_copy_from_user(struct __kfifo *fifo,
	const void __user *from, unsigned int len, unsigned int off,
	unsigned int *copied)
{}

int __kfifo_from_user(struct __kfifo *fifo, const void __user *from,
		unsigned long len, unsigned int *copied)
{}
EXPORT_SYMBOL();

static unsigned long kfifo_copy_to_user(struct __kfifo *fifo, void __user *to,
		unsigned int len, unsigned int off, unsigned int *copied)
{}

int __kfifo_to_user(struct __kfifo *fifo, void __user *to,
		unsigned long len, unsigned int *copied)
{}
EXPORT_SYMBOL();

static unsigned int setup_sgl_buf(struct __kfifo *fifo, struct scatterlist *sgl,
				  unsigned int data_offset, int nents,
				  unsigned int len, dma_addr_t dma)
{}

static unsigned int setup_sgl(struct __kfifo *fifo, struct scatterlist *sgl,
		int nents, unsigned int len, unsigned int off, dma_addr_t dma)
{}

unsigned int __kfifo_dma_in_prepare(struct __kfifo *fifo,
		struct scatterlist *sgl, int nents, unsigned int len,
		dma_addr_t dma)
{}
EXPORT_SYMBOL();

unsigned int __kfifo_dma_out_prepare(struct __kfifo *fifo,
		struct scatterlist *sgl, int nents, unsigned int len,
		dma_addr_t dma)
{}
EXPORT_SYMBOL();

unsigned int __kfifo_max_r(unsigned int len, size_t recsize)
{}
EXPORT_SYMBOL();

#define __KFIFO_PEEK(data, out, mask)
/*
 * __kfifo_peek_n internal helper function for determinate the length of
 * the next record in the fifo
 */
static unsigned int __kfifo_peek_n(struct __kfifo *fifo, size_t recsize)
{}

#define __KFIFO_POKE(data, in, mask, val)

/*
 * __kfifo_poke_n internal helper function for storing the length of
 * the record into the fifo
 */
static void __kfifo_poke_n(struct __kfifo *fifo, unsigned int n, size_t recsize)
{}

unsigned int __kfifo_len_r(struct __kfifo *fifo, size_t recsize)
{}
EXPORT_SYMBOL();

unsigned int __kfifo_in_r(struct __kfifo *fifo, const void *buf,
		unsigned int len, size_t recsize)
{}
EXPORT_SYMBOL();

static unsigned int kfifo_out_copy_r(struct __kfifo *fifo,
	void *buf, unsigned int len, size_t recsize, unsigned int *n)
{}

unsigned int __kfifo_out_peek_r(struct __kfifo *fifo, void *buf,
		unsigned int len, size_t recsize)
{}
EXPORT_SYMBOL();

unsigned int __kfifo_out_linear_r(struct __kfifo *fifo,
		unsigned int *tail, unsigned int n, size_t recsize)
{}
EXPORT_SYMBOL();

unsigned int __kfifo_out_r(struct __kfifo *fifo, void *buf,
		unsigned int len, size_t recsize)
{}
EXPORT_SYMBOL();

void __kfifo_skip_r(struct __kfifo *fifo, size_t recsize)
{}
EXPORT_SYMBOL();

int __kfifo_from_user_r(struct __kfifo *fifo, const void __user *from,
	unsigned long len, unsigned int *copied, size_t recsize)
{}
EXPORT_SYMBOL();

int __kfifo_to_user_r(struct __kfifo *fifo, void __user *to,
	unsigned long len, unsigned int *copied, size_t recsize)
{}
EXPORT_SYMBOL();

unsigned int __kfifo_dma_in_prepare_r(struct __kfifo *fifo,
	struct scatterlist *sgl, int nents, unsigned int len, size_t recsize,
	dma_addr_t dma)
{}
EXPORT_SYMBOL();

void __kfifo_dma_in_finish_r(struct __kfifo *fifo,
	unsigned int len, size_t recsize)
{}
EXPORT_SYMBOL();

unsigned int __kfifo_dma_out_prepare_r(struct __kfifo *fifo,
	struct scatterlist *sgl, int nents, unsigned int len, size_t recsize,
	dma_addr_t dma)
{}
EXPORT_SYMBOL();