概述
/** * tick_program_event */ int tick_program_event(ktime_t expires, int force) { struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev);
if (unlikely(expires.tv64 == KTIME_MAX)) { /* * We don't need the clock event device any more, stop it. */ clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT_STOPPED); return 0; }
if (unlikely(clockevent_state_oneshot_stopped(dev))) { /* * We need the clock event again, configure it in ONESHOT mode * before using it. */ clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT); }
return clockevents_program_event(dev, expires, force); }
下面这些函数会对timer重新编程:
hrtimer_force_reprogram
hrtimer_interrupt
__tick_broadcast_oneshot_control
tick_nohz_restart
tick_nohz_stop_sched_tick
tick_nohz_handler
最后
以上就是危机秋天为你收集整理的Linux 内核时钟之oneshot编程的全部内容,希望文章能够帮你解决Linux 内核时钟之oneshot编程所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复