diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-11-12 11:05:57 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-11-12 11:05:57 +0000 |
commit | 5a70ffdbf38323a58d2e1fa6289ad7caea1fe12a (patch) | |
tree | 13e0c97a4ce81acf5b535faea5a68a063e277639 /os/rt | |
parent | 014b752b76039952754a9285d2af9c0125b50e33 (diff) | |
download | ChibiOS-5a70ffdbf38323a58d2e1fa6289ad7caea1fe12a.tar.gz ChibiOS-5a70ffdbf38323a58d2e1fa6289ad7caea1fe12a.tar.bz2 ChibiOS-5a70ffdbf38323a58d2e1fa6289ad7caea1fe12a.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6464 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt')
-rw-r--r-- | os/rt/include/ch.h | 2 | ||||
-rw-r--r-- | os/rt/include/chdebug.h | 7 | ||||
-rw-r--r-- | os/rt/include/chsys.h | 8 |
3 files changed, 16 insertions, 1 deletions
diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h index 21c172ec9..e96bc797c 100644 --- a/os/rt/include/ch.h +++ b/os/rt/include/ch.h @@ -82,8 +82,8 @@ extern "C" { #include "chdebug.h"
#include "chtm.h"
#include "chstats.h"
-#include "chsys.h"
#include "chglobal.h"
+#include "chsys.h"
#include "chvt.h"
#include "chlists.h"
#include "chschd.h"
diff --git a/os/rt/include/chdebug.h b/os/rt/include/chdebug.h index 6ae948bc3..44f44116f 100644 --- a/os/rt/include/chdebug.h +++ b/os/rt/include/chdebug.h @@ -71,6 +71,13 @@ /* Derived constants and error checks. */
/*===========================================================================*/
+#if CH_DBG_ENABLE_ASSERTS || CH_DBG_ENABLE_CHECKS || \
+ CH_DBG_ENABLE_STACK_CHECK || CH_DBG_SYSTEM_STATE_CHECK
+#define CH_DBG_ENABLED TRUE
+#else
+#define CH_DBG_ENABLED FALSE
+#endif
+
/*===========================================================================*/
/* Module data structures and types. */
/*===========================================================================*/
diff --git a/os/rt/include/chsys.h b/os/rt/include/chsys.h index 6255b7d5a..9a74788ae 100644 --- a/os/rt/include/chsys.h +++ b/os/rt/include/chsys.h @@ -299,6 +299,14 @@ static inline void chSysUnlock(void) { _dbg_check_unlock();
_stats_stop_measure_crit_thd();
+
+ /* The following condition can be triggered by the use of i-class functions
+ in a critical section not followed by a chSchResceduleS(), this means
+ that the current thread has a lower priority than the next thread in
+ the ready list.*/
+ chDbgAssert(ch.rlist.r_current->p_prio >= ch.rlist.r_queue.p_next->p_prio,
+ "priority violation, missing reschedule");
+
port_unlock();
}
|