摘要:
一、注册一个平台设备 方法1:platform_device_register 核心数据结构: 1 struct platform_device { 2 const char *name; 3 int id; 4 bool id_auto; 5 struct device dev; 6 u32 nu 阅读全文
摘要:
printk("HZ is %d\n",HZ); timeout = jiffies + 5*HZ/100; printk(KERN_INFO"time_after test\r\n"); while(1) { if(time_after(jiffies,timeout)) { printk("ti 阅读全文
摘要:
一、Linux定时器主要调用接口 1、定时器数据结构 1 struct timer_list { 2 /* 3 * All fields that change during normal runtime grouped to 4 * the same cacheline 5 */ 6 struct 阅读全文
摘要:
char_driver.c 1 #include <linux/module.h> 2 #include <linux/slab.h> //kmalloc 3 #include <linux/cdev.h> //cdev 4 #include <linux/fs.h> //register_chrd 阅读全文