Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_work.c
Show First 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | linux_queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | ||||
case WORK_ST_IDLE: | case WORK_ST_IDLE: | ||||
dwork->work.work_queue = wq; | dwork->work.work_queue = wq; | ||||
dwork->timer.expires = jiffies + delay; | dwork->timer.expires = jiffies + delay; | ||||
if (delay == 0) { | if (delay == 0) { | ||||
linux_delayed_work_enqueue(dwork); | linux_delayed_work_enqueue(dwork); | ||||
} else if (unlikely(cpu != WORK_CPU_UNBOUND)) { | } else if (unlikely(cpu != WORK_CPU_UNBOUND)) { | ||||
mtx_lock(&dwork->timer.mtx); | mtx_lock(&dwork->timer.mtx); | ||||
callout_reset_on(&dwork->timer.callout, delay, | callout_reset_sbt_on_arg1(&dwork->timer.callout, | ||||
&linux_delayed_work_timer_fn, dwork, cpu); | tick_sbt * delay, 0, | ||||
&linux_delayed_work_timer_fn, dwork, | |||||
dwork->work.func, cpu, C_HARDCLOCK); | |||||
mtx_unlock(&dwork->timer.mtx); | mtx_unlock(&dwork->timer.mtx); | ||||
} else { | } else { | ||||
mtx_lock(&dwork->timer.mtx); | mtx_lock(&dwork->timer.mtx); | ||||
callout_reset(&dwork->timer.callout, delay, | callout_reset_sbt_on_arg1(&dwork->timer.callout, | ||||
&linux_delayed_work_timer_fn, dwork); | tick_sbt * delay, 0, | ||||
&linux_delayed_work_timer_fn, dwork, | |||||
dwork->work.func, -1, C_HARDCLOCK); | |||||
mtx_unlock(&dwork->timer.mtx); | mtx_unlock(&dwork->timer.mtx); | ||||
} | } | ||||
return (true); | return (true); | ||||
default: | default: | ||||
return (false); /* already on a queue */ | return (false); /* already on a queue */ | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 428 Lines • Show Last 20 Lines |