aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports/GCC/ARMCM3/chcore.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-03-19 12:48:54 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-03-19 12:48:54 +0000
commit79075f9e81d9d56be5da3bf6cdae56f4ace950de (patch)
tree8c1f99887161adb25e703a66ff5ec90cdea1250d /os/ports/GCC/ARMCM3/chcore.c
parent05af5534a971e706b6ebde5111cd0fe7c514f63d (diff)
downloadChibiOS-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/ports/GCC/ARMCM3/chcore.c')
-rw-r--r--os/ports/GCC/ARMCM3/chcore.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/os/ports/GCC/ARMCM3/chcore.c b/os/ports/GCC/ARMCM3/chcore.c
index e2caea969..f800c2fb7 100644
--- a/os/ports/GCC/ARMCM3/chcore.c
+++ b/os/ports/GCC/ARMCM3/chcore.c
@@ -144,7 +144,7 @@ void SVCallVector(Thread *ntp, Thread *otp) {
__attribute__((naked))
#endif
void PendSVVector(void) {
- Thread *otp;
+ Thread *otp, *ntp;
register struct intctx *sp_thd asm("r12");
chSysLockFromIsr();
@@ -152,14 +152,16 @@ void PendSVVector(void) {
PUSH_CONTEXT(sp_thd);
(otp = currp)->p_ctx.r13 = sp_thd;
- (currp = fifo_remove(&rlist.r_queue))->p_state = THD_STATE_CURRENT;
+ ntp = fifo_remove(&rlist.r_queue);
+ setcurrp(ntp);
+ ntp->p_state = THD_STATE_CURRENT;
chSchReadyI(otp);
#if CH_TIME_QUANTUM > 0
/* Set the round-robin time quantum.*/
rlist.r_preempt = CH_TIME_QUANTUM;
#endif
- chDbgTrace(otp, currp);
- sp_thd = currp->p_ctx.r13;
+ chDbgTrace(ntp, otp);
+ sp_thd = ntp->p_ctx.r13;
POP_CONTEXT(sp_thd);
}