HRTIMER_MODE_REL_PINNED_SOFT = HRTIMER_MODE_REL_PINNED | HRTIMER_MODE_SOFT, HRTIMER_MODE_ABS_HARD = HRTIMER_MODE_ABS | HRTIMER_MODE_HARD, HRTIMER_MODE_REL_HARD = HRTIMER_MODE_REL | HRTIMER_MODE_HARD, HRTIMER_MODE_ABS_PINNED_HARD = HRTIMER_MODE_ABS_PINNED | HRTIMER_MODE_HARD, HRTIMER_M...
HRTIMER_MODE_REL = 0x1, /* Time value is relative to now */ HRTIMER_MODE_PINNED = 0x02, /* Timer is bound to CPU */ HRTIMER_MODE_ABS_PINNED = 0x02, HRTIMER_MODE_REL_PINNED = 0x03, }; Notes:hrtimer的SoC-->CPUs-->Clocks的层级关系,hrtimer_cpu_base-->hrtimer_clock_base。 和低...
_MODE_SOFT = 0x04, /* 定时器是“软”的,即该定时器的回调函数在软中断上下文执行 */ HRTIMER_MODE_HARD = 0x08, /* 定时器是“硬”的,即该定时器的回调函数在硬中断上下文执行即使是PREEMPT_RT打开的情况 */ HRTIMER_MODE_ABS_PINNED = HRTIMER_MODE_ABS | HRTIMER_MODE_PINNED, HRTIMER_MODE_REL_...
enumhrtimer_mode mode); which_clock可以是CLOCK_REALTIME、CLOCK_MONOTONIC、CLOCK_BOOTTIME中的一种,mode则可以是相对时间HRTIMER_MODE_REL,也可以是绝对时间HRTIMER_MODE_ABS。设定回调函数: [cpp]view plaincopy timer.function = hr_callback; 如果定时器无需指定一个到期范围,可以在设定回调函数后直接使用hrtime...
HRTIMER_MODE_ABS_PINNED); /* Check, if the timer was already in the past */ if (hrtimer_active(&ts->sched_timer)) break; now = ktime_get(); } #ifdef CONFIG_NO_HZ if (tick_nohz_enabled) ts->nohz_mode = NOHZ_MODE_HIGHRES; ...
HRTIMER_MODE_ABS_PINNED); /* Check, if the timer was already in the past */ if(hrtimer_active(&ts->sched_timer)) break; now = ktime_get(); } #ifdef CONFIG_NO_HZ if(tick_nohz_enabled) ts->nohz_mode = NOHZ_MODE_HIGHRES; ...
new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);if(mode & HRTIMER_MODE_REL) { tim = ktime_add_safe(tim, new_base->get_time());#ifdefCONFIG_TIME_LOW_REStim = ktime_add_safe(tim, base->resolution);#endif} ...
ktime_set(value / 1000, (value % 1000) * 1000000),HRTIMER_MODE_REL); 3).int hrtimer_cancel(struct hrtimer *timer); 要取消一个hrtimer,使用hrtimer_cancel: staticenumhrtimer_restart timer_func(structhrtimer *timer){ hrtimer_start(&vibe_timer,ktime_set(value/1000, (value %1000) *1000000)...
hrtimer_init(&(current->C_timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED); current->C_timer.function = hrtimer_C_callback; hrtimer_start(&(current->C_timer), ktime_sub(current->C_time, current->real_C_time), HRTIMER_MODE_REL_PINNED); ...
., 10 11HRTIMER_MODE_ABS_SOFT =HRTIMER_MODE_ABS |HRTIMER_MODE_SOFT, 12HRTIMER_MODE_REL_SOFT...|HRTIMER_MODE_SOFT, 15HRTIMER_MODE_REL_PINNED_SOFT =HRTIMER_MODE_REL_PINNED |HRTIMER_MODE_SOFT,...16 17HRTIMER_MODE_ABS_HARD =HRTIMER_MODE_ABS |HRTIMER_MODE_HARD, 18HRTIMER_MODE_REL_HARD ...