摘要: 内核定时器: unsigned long timeout = jiffies + (x * HZ); while(1) { // Check the condition. // Take a schedule. if (time_after(jiffies, timeout)) { printk("Timeout\n"); break; } }转换到秒: s = (jiffies - last_jiffies)/HZ;jiffies(约50天溢出)为jiffies_64的后32位,因此直接读取jiffies_64不具备原子性,使用get_jiffies_64,函数原理:[平 阅读全文
posted @ 2013-06-27 14:09 天地不仁 阅读(4548) 评论(0) 推荐(0) 编辑