Linux????е???
???????????? ???????[ 2012/12/20 11:19:49 ] ????????
??????????????????????????????????????????????HZ????д???????????????HZ????????????????????????????????????????????????????????HZ????????????poll??select???????е????????????????????????????????????????????????????HZ???????????????????????????????????????????????????????沢?????硣
??????????Jiffies??????????????????????????????????Jiffies?????????????HZ??????????????????λ????????jiffies/HZ??
extern unsigned long volatile jiffies; //????jiffies
unsigned long later=jiffies+5*HZ //????????5??
??????????jiffies?????У????????????????jiffies?????unsigned long????????????????????????????????????64λ??jiffies_64???????????????jiffies??????jiffies_64???32λ???????C?????????????????????Σ????????2?????????е?jiffies?????????????б??????????±?????????????volatile????????????η????????????′???????л??????????????????е???????????????
????????????????????????????????????????????0?????jiffies?????????????????????jiffies????????time_after??time_befiore??time_after_eq??time_befiore_eq??????????
unsigned long time=jiffies+HZ; //?????
if(time_before(jiffies??timeout)){
//??г???????
}else{
//?????????
}
????????????????豸???м?????????????????????????????????????????ж???????????????????????????????????????????????xtime??????
????????????
Struct time_list my_timer ; //?????????
Init_timer??&my_timer??; //??????????
my_timer.expires=jiffies+delay; //???????
my_timer.data=0; //???????????void my_funciton(unsigned long data)?β?
my_timer.function=my_function; //???????????
add_timer(&my_timer); //???????
mod_timer(&my_timer??jiffies+new_delay)??//????μ??????????
del_timer_sync(&my_timer); //??????
???????????????£??????????????setup_time???????洴???????????????????Σ??????????????????????У????????????????????????????????????????????????????????????????????????????????????????????е?????????????????????????del_timer_sync????del_timer???????????????????????????????????????????????????????????????????κ????????
???????????????
????1???????????time_befoer????????У???????????????????????ж????????
????2????????????udelay??ndelay??mdelay??udelay??????????С????е???????????1ms???Χ??????udelay????????????????mdelay???????á?
????3?????schedule_timeout()?????????????????????????????????????????????????????????????????????????е?????????????????????????????????????????????????????????????????????????£???????????schedule_timeout()????????schedule ()?????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11