摘要:
内核定时器: 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,函数原理:[平 阅读全文