Linux 变量和结构体
/* 设备号 主设备号 次设备号 */
dev_t dev
#define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS))
#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK))
#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
/* 字符设备抽象结构体 */
struct cdev {
struct kobject kobj;
struct module *owner;
const struct file_operations *ops;
struct list_head list;
dev_t dev;
unsigned int count;
};
struct kobject 内核对象抽象结构体
struct list_head list 链表