diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-08-12 11:10:19 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-08-12 11:10:19 +0000 |
commit | 43752ee8d132fc57028a9ff15156c5bfcd81c013 (patch) | |
tree | eb4a8eafaaac4084e1c0c307850a8ce17939e58f /os/kernel/src/chschd.c | |
parent | e0309ba9738efc707f8c43de43e04d2c62a32e8c (diff) | |
download | ChibiOS-43752ee8d132fc57028a9ff15156c5bfcd81c013.tar.gz ChibiOS-43752ee8d132fc57028a9ff15156c5bfcd81c013.tar.bz2 ChibiOS-43752ee8d132fc57028a9ff15156c5bfcd81c013.zip |
Extended state check to all kernel I-class and s-class APIs, corrected some test cases where call protocol rules were not strictly observerd. No the whole test suite pass with the state checker enabled.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3223 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src/chschd.c')
-rw-r--r-- | os/kernel/src/chschd.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index e989f4039..b481a0b6a 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -75,7 +75,8 @@ void _scheduler_init(void) { Thread *chSchReadyI(Thread *tp) {
Thread *cp;
- /* Integrity check.*/
+ /* Integrity checks.*/
+ chDbgCheckClassI();
chDbgAssert((tp->p_state != THD_STATE_READY) &&
(tp->p_state != THD_STATE_FINAL),
"chSchReadyI(), #1",
@@ -107,6 +108,8 @@ Thread *chSchReadyI(Thread *tp) { void chSchGoSleepS(tstate_t newstate) {
Thread *otp;
+ chDbgCheckClassS();
+
(otp = currp)->p_state = newstate;
#if CH_TIME_QUANTUM > 0
rlist.r_preempt = CH_TIME_QUANTUM;
@@ -173,6 +176,8 @@ static void wakeup(void *p) { */
msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) {
+ chDbgCheckClassS();
+
if (TIME_INFINITE != time) {
VirtualTimer vt;
@@ -207,6 +212,8 @@ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { #if !defined(PORT_OPTIMIZED_WAKEUPS) || defined(__DOXYGEN__)
void chSchWakeupS(Thread *ntp, msg_t msg) {
+ chDbgCheckClassS();
+
ntp->p_u.rdymsg = msg;
/* If the waken thread has a not-greater priority than the current
one then it is just inserted in the ready list else it made
@@ -237,6 +244,8 @@ void chSchWakeupS(Thread *ntp, msg_t msg) { void chSchDoRescheduleI(void) {
Thread *otp;
+ chDbgCheckClassI();
+
#if CH_TIME_QUANTUM > 0
rlist.r_preempt = CH_TIME_QUANTUM;
#endif
@@ -259,6 +268,8 @@ void chSchDoRescheduleI(void) { #if !defined(PORT_OPTIMIZED_RESCHEDULES) || defined(__DOXYGEN__)
void chSchRescheduleS(void) {
+ chDbgCheckClassS();
+
if (chSchIsRescRequiredI())
chSchDoRescheduleI();
}
|