#include <linux/init.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/mutex.h>
#include <linux/kfifo.h>
#define FIFO_SIZE …
#define PROC_FIFO …
static DEFINE_MUTEX(read_access);
static DEFINE_MUTEX(write_access);
#if 0
#define DYNAMIC
#endif
#ifdef DYNAMIC
struct kfifo_rec_ptr_1 test;
#else
mytest;
static mytest test;
#endif
static const char *expected_result[] = …;
static int __init testfunc(void)
{ … }
static ssize_t fifo_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t fifo_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static const struct proc_ops fifo_proc_ops = …;
static int __init example_init(void)
{ … }
static void __exit example_exit(void)
{ … }
module_init(example_init);
module_exit(example_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;