From 95d85de7d5eb11653e1060168904171238a85721 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 5 Sep 2013 10:34:09 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6263 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/nil/include/nil.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'os/nil/include') diff --git a/os/nil/include/nil.h b/os/nil/include/nil.h index ea6839d6b..da79370d7 100644 --- a/os/nil/include/nil.h +++ b/os/nil/include/nil.h @@ -549,6 +549,17 @@ typedef struct { */ #define chSysUnlockFromISR() port_unlock_from_isr() +/** + * @brief Evaluates if a reschedule is required. + * + * @retval true if there is a thread that must go in running state + * immediately. + * @retval false if preemption is not required. + * + * @iclass + */ +#define chSchIsRescRequiredI() ((bool)(nil.current != nil.next)) + /** * @brief Delays the invoking thread for the specified number of seconds. * @note The specified time is rounded up to a value allowed by the real @@ -716,8 +727,8 @@ extern "C" { syssts_t chSysGetStatusAndLockX(void); void chSysRestoreStatusX(syssts_t sts); thread_reference_t chSchReadyI(thread_reference_t trp, msg_t msg); - msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t timeout); void chSchRescheduleS(void); + msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t timeout); msg_t chThdSuspendTimeoutS(thread_reference_t *trp, systime_t timeout); void chThdResumeI(thread_reference_t *trp, msg_t msg); void chThdSleep(systime_t time); -- cgit v1.2.3