chardrivers.h
来自「2.6内核做简单的字符驱动的例子」· C头文件 代码 · 共 41 行
H
41 行
#ifndef __KERNEL__
#define __KERNEL__
#endif
#ifndef MODULE
#define MODULE
#endif
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/errno.h>
#include <asm/segment.h>
#include <linux/uaccess.h>
#include <asm/uaccess.h>
#define VERIFY_WRITE 1
#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif
static ssize_t read_test(struct file *file,char *buf,size_t count,loff_t *ppos);
static ssize_t write_test(struct file *file,const char *buf,size_t count,loff_t *ppos);
static int open_test(struct inode* inode,struct file* file);
static int release_test(struct inode* inode,struct file* file);
struct file_operations test_fops=
{
.owner = THIS_MODULE,
.read=read_test,
.write=write_test,
.open=open_test,
.release=release_test
};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?