From d688b84d2585d3bedbd682417313bcb581b1a1fc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 13 Sep 2009 12:06:08 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1162 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/scheduler.h | 4 ++-- os/kernel/src/chschd.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'os/kernel') diff --git a/os/kernel/include/scheduler.h b/os/kernel/include/scheduler.h index f3216bb7a..a8196a9b6 100644 --- a/os/kernel/include/scheduler.h +++ b/os/kernel/include/scheduler.h @@ -97,7 +97,7 @@ extern "C" { void chSchWakeupS(Thread *tp, msg_t msg); void chSchDoRescheduleI(void); void chSchRescheduleS(void); - bool_t chSchRescRequiredI(void); + bool_t chSchIsRescRequiredExI(void); #if CH_USE_ROUNDROBIN void chSchDoYieldS(void); #endif @@ -117,7 +117,7 @@ extern "C" { * @details This function returns @p TRUE if there is a ready thread with * higher priority. */ -#define chSchMustRescheduleS() (firstprio(&rlist.r_queue) > currp->p_prio) +#define chSchIsRescRequiredI() (firstprio(&rlist.r_queue) > currp->p_prio) #endif /* _SCHEDULER_H_ */ diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 08ecf46a0..7c65e3fd6 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -211,7 +211,7 @@ void chSchDoRescheduleI(void) { */ void chSchRescheduleS(void) { - if (chSchMustRescheduleS()) + if (chSchIsRescRequiredI()) chSchDoRescheduleI(); } @@ -222,8 +222,11 @@ void chSchRescheduleS(void) { * * @retval TRUE if there is a thread that should go in running state. * @retval FALSE if a reschedulation is not required. + * + * @note This function is meant to be used in the timer interrupt handler + * where @p chVTDoTickI() is invoked. */ -bool_t chSchRescRequiredI(void) { +bool_t chSchIsRescRequiredExI(void) { tprio_t p1 = firstprio(&rlist.r_queue); tprio_t p2 = currp->p_prio; #if CH_USE_ROUNDROBIN -- cgit v1.2.3