Module: xenomai-head Branch: master Commit: 073f62abc32894a83f6a5707f54e95c6a857e768 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=073f62abc32894a83f6a5707f54e95c6a857e768
Author: Jan Kiszka <[email protected]> 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 <[email protected]> --- 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 49a69de..c8d9273 100644 --- a/include/nucleus/sched.h +++ b/include/nucleus/sched.h @@ -169,17 +169,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); \ @@ -189,8 +184,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 1a97295..c4c2f1d 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 [email protected] https://mail.gna.org/listinfo/xenomai-git
