Module: xenomai-jki Branch: for-upstream Commit: 5144ef69c76280a591eda0a8779bd40f80d1fdba URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=5144ef69c76280a591eda0a8779bd40f80d1fdba
Author: Jan Kiszka <jan.kis...@siemens.com> Date: Thu Nov 4 16:39:05 2010 +0100 nucleus: Consolidate xnsched_self_resched_p It is identical to xnsched_resched_p today. Signed-off-by: Jan Kiszka <jan.kis...@siemens.com> --- include/nucleus/sched.h | 10 ++-------- ksrc/nucleus/timer.c | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/nucleus/sched.h b/include/nucleus/sched.h index fb4606e..afac8da 100644 --- a/include/nucleus/sched.h +++ b/include/nucleus/sched.h @@ -170,17 +170,12 @@ struct xnsched_class { #define xnsched_cpu(__sched__) ({ (void)__sched__; 0; }) #endif /* CONFIG_SMP */ -/* Test all resched flags from the given scheduler mask. */ +/* Test resched flag of given sched. */ static inline int xnsched_resched_p(struct xnsched *sched) { return testbits(sched->status, XNRESCHED); } -static inline int xnsched_self_resched_p(struct xnsched *sched) -{ - return testbits(sched->status, XNRESCHED); -} - /* Set self resched flag for the given scheduler. */ #define xnsched_set_self_resched(__sched__) do { \ __setbits((__sched__)->status, XNRESCHED); \ @@ -190,8 +185,7 @@ static inline int xnsched_self_resched_p(struct xnsched *sched) #define xnsched_set_resched(__sched__) do { \ xnsched_t *current_sched = xnpod_current_sched(); \ __setbits(current_sched->status, XNRESCHED); \ - if (current_sched != (__sched__) \ - && !testbits((__sched__)->status, XNRESCHED)) { \ + if (current_sched != (__sched__) && !xnsched_resched_p(__sched__)) { \ xnarch_cpu_set(xnsched_cpu(__sched__), current_sched->resched); \ __setbits((__sched__)->status, XNRESCHED); \ } \ diff --git a/ksrc/nucleus/timer.c b/ksrc/nucleus/timer.c index 32016d7..97d166f 100644 --- a/ksrc/nucleus/timer.c +++ b/ksrc/nucleus/timer.c @@ -97,7 +97,7 @@ void xntimer_next_local_shot(xnsched_t *sched) __clrbits(sched->lflags, XNHDEFER); timer = aplink2timer(h); if (unlikely(timer == &sched->htimer)) { - if (xnsched_self_resched_p(sched) || + if (xnsched_resched_p(sched) || !xnthread_test_state(sched->curr, XNROOT)) { h = xntimerq_it_next(&sched->timerqueue, &it, h); if (h) { _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git