Jan Kiszka wrote:
> [Appendix to the xntimer cleanup series.]
>
> Having to take care for infinite delays in xntimer_start (i.e. to NOT
> start the timer...) is a bit suboptimal given that his service might be
> used heavily to restart timers. This patch converts the only user
> (xnpod_start_timer again) and cleans up the timer code.
>
> Jan
> ---
> ksrc/nucleus/pod.c | 10 ++++++----
> ksrc/nucleus/timer.c | 34 ++++++++++++----------------------
> 2 files changed, 18 insertions(+), 26 deletions(-)
>
> Index: xenomai/ksrc/nucleus/pod.c
> ===================================================================
> --- xenomai.orig/ksrc/nucleus/pod.c
> +++ xenomai/ksrc/nucleus/pod.c
> @@ -3095,10 +3095,12 @@ int xnpod_start_timer(u_long nstick, xni
>
> xntimer_set_sched(&nkpod->htimer, xnpod_sched_slot(XNTIMER_KEEPER_ID));
>
> - xnlock_get_irqsave(&nklock, s);
> - xntimer_start(&nkpod->htimer, delta,
> - XNARCH_HOST_TICK / nkpod->tickvalue);
> - xnlock_put_irqrestore(&nklock, s);
> + if (delta) {
Should not this rather be if (XNARCH_HOST_TICK) ?
> + xnlock_get_irqsave(&nklock, s);
> + xntimer_start(&nkpod->htimer, delta,
> + XNARCH_HOST_TICK / nkpod->tickvalue);
> + xnlock_put_irqrestore(&nklock, s);
> + }
--
Gilles Chanteperdrix.
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core