?? demo.h~
字號:
#ifndef _DEMO_H_#define _DEMO_H_#include <linux/ioctl.h> /* needed for the _IOW etc stuff used later *//******************************************************** * Macros to help debugging ********************************************************/#undef PDEBUG /* undef it, just in case */#ifdef DEMO_DEBUG#ifdef __KERNEL__# define PDEBUG(fmt, args...) printk( KERN_DEBUG "DEMO: " fmt, ## args)#else//usr space# define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)#endif#else# define PDEBUG(fmt, args...) /* not debugging: nothing */#endif#undef PDEBUGG#define PDEBUGG(fmt, args...) /* nothing: it's a placeholder */#define DEMO_MAJOR 224#define DEMO_MINOR 0#define COMMAND1 1#define COMMAND2 2#define NULL 0#define SA_INTERRUPT 0//??struct DEMO_dev { struct semaphore sem; /* mutual exclusion semaphore */ struct cdev cdev; /* Char device structure */ wait_queue_head_t wq; };//???ssize_t DEMO_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos);ssize_t DEMO_write(struct file *filp, const char __user *buf, size_t count, loff_t *f_pos);loff_t DEMO_llseek(struct file *filp, loff_t off, int whence);int DEMO_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);#endif /* _DEMO_H_ */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -