diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-08-28 14:53:54 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-08-28 14:53:54 +0000 |
commit | 1ce340b59e0b68f7bf868914af3701b408bd1820 (patch) | |
tree | 3035d940c9342f5637d59c9e90969a8a029de7b3 | |
parent | 518fc970306cf40da2a8f897a0b2c5abc4b134f8 (diff) | |
download | ChibiOS-1ce340b59e0b68f7bf868914af3701b408bd1820.tar.gz ChibiOS-1ce340b59e0b68f7bf868914af3701b408bd1820.tar.bz2 ChibiOS-1ce340b59e0b68f7bf868914af3701b408bd1820.zip |
Better fix for bug 2846162.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1112 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/kernel/src/chschd.c | 5 | ||||
-rw-r--r-- | os/ports/GCC/ARMCM3/chcore.h | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 846833286..3ba8b29e9 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -138,19 +138,18 @@ static void wakeup(void *p) { * @retval RDY_TIMEOUT if a timeout occurs. */ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { - Thread *tp = currp; if (TIME_INFINITE != time) { VirtualTimer vt; - chVTSetI(&vt, time, wakeup, tp); + chVTSetI(&vt, time, wakeup, currp); chSchGoSleepS(newstate); if (chVTIsArmedI(&vt)) chVTResetI(&vt); } else chSchGoSleepS(newstate); - return tp->p_rdymsg; + return currp->p_rdymsg; } /** diff --git a/os/ports/GCC/ARMCM3/chcore.h b/os/ports/GCC/ARMCM3/chcore.h index 7d33251ad..7e68d1aae 100644 --- a/os/ports/GCC/ARMCM3/chcore.h +++ b/os/ports/GCC/ARMCM3/chcore.h @@ -306,13 +306,13 @@ struct context { if (sp - sizeof(struct intctx) - sizeof(Thread) < (char *)_otp) \
asm volatile ("movs r0, #0 \n\t" \
"b chDbgPanic"); \
- asm volatile ("svc #0" : : "r" (_otp), "r" (_ntp)); \
+ asm volatile ("svc #0" : : "r" (_otp), "r" (_ntp) : "memory"); \
}
#else /* !CH_DBG_ENABLE_STACK_CHECK */
#define port_switch(otp, ntp) { \
register Thread *_otp asm ("r0") = (otp); \
register Thread *_ntp asm ("r1") = (ntp); \
- asm volatile ("svc #0" : : "r" (_otp), "r" (_ntp)); \
+ asm volatile ("svc #0" : : "r" (_otp), "r" (_ntp) : "memory"); \
}
#endif /* !CH_DBG_ENABLE_STACK_CHECK */
|