diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-03-19 12:48:54 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-03-19 12:48:54 +0000 |
commit | 79075f9e81d9d56be5da3bf6cdae56f4ace950de (patch) | |
tree | 8c1f99887161adb25e703a66ff5ec90cdea1250d /os/kernel/src | |
parent | 05af5534a971e706b6ebde5111cd0fe7c514f63d (diff) | |
download | ChibiOS-79075f9e81d9d56be5da3bf6cdae56f4ace950de.tar.gz ChibiOS-79075f9e81d9d56be5da3bf6cdae56f4ace950de.tar.bz2 ChibiOS-79075f9e81d9d56be5da3bf6cdae56f4ace950de.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1755 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src')
-rw-r--r-- | os/kernel/src/chschd.c | 9 | ||||
-rw-r--r-- | os/kernel/src/chsys.c | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index d5c8a0a5a..7170fb0ec 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -96,7 +96,8 @@ void chSchGoSleepS(tstate_t newstate) { Thread *otp;
(otp = currp)->p_state = newstate;
- (currp = fifo_remove(&rlist.r_queue))->p_state = THD_STATE_CURRENT;
+ setcurrp(fifo_remove(&rlist.r_queue));
+ currp->p_state = THD_STATE_CURRENT;
#if CH_TIME_QUANTUM > 0
rlist.r_preempt = CH_TIME_QUANTUM;
#endif
@@ -196,7 +197,8 @@ void chSchWakeupS(Thread *ntp, msg_t msg) { #if CH_TIME_QUANTUM > 0
rlist.r_preempt = CH_TIME_QUANTUM;
#endif
- (currp = ntp)->p_state = THD_STATE_CURRENT;
+ setcurrp(ntp);
+ ntp->p_state = THD_STATE_CURRENT;
chDbgTrace(ntp, otp);
chSysSwitchI(ntp, otp);
}
@@ -217,7 +219,8 @@ void chSchDoRescheduleI(void) { #endif
otp = currp;
/* Picks the first thread from the ready queue and makes it current.*/
- (currp = ntp = fifo_remove(&rlist.r_queue))->p_state = THD_STATE_CURRENT;
+ (ntp = fifo_remove(&rlist.r_queue))->p_state = THD_STATE_CURRENT;
+ setcurrp(ntp);
chSchReadyI(otp);
chDbgTrace(ntp, otp);
chSysSwitchI(ntp, otp);
diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index eeed4a998..1a66c8e98 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -80,7 +80,8 @@ void chSysInit(void) { #endif
/* Now this instructions flow becomes the main thread.*/
- (currp = init_thread(&mainthread, NORMALPRIO))->p_state = THD_STATE_CURRENT;
+ setcurrp(init_thread(&mainthread, NORMALPRIO));
+ currp->p_state = THD_STATE_CURRENT;
chSysEnable();
/* This thread has the lowest priority in the system, its role is just to
|