git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@243 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2008-03-20 10:39:43 +00:00
parent d63f9c27be
commit 813f114c7f
2 changed files with 16 additions and 7 deletions

View File

@ -77,6 +77,19 @@ void *retaddr;
*/
void SysTickVector(void) {
chSysIRQEnterI();
chSysTimerHandlerI();
chSysIRQExitI();
}
/*
* To be invoked at the end of any interrupt handler that can trigger a
* reschedule.
*/
void chSysIRQExitI(void) {
chSysLock();
if (SCB->ICSR & (1 << 11)) { /* RETTOBASE */
if (chSchRescRequiredI()) {
@ -87,7 +100,7 @@ void SysTickVector(void) {
"str r2, [r1] \n\t" \
"ldr r1, =threadswitch \n\t" \
"str r1, [r0, #18] ");
return;
return; /* Note, returns *without* re-enabling interrupts.*/
}
}
chSysUnlock();

View File

@ -85,12 +85,7 @@ typedef struct {
INT_REQUIRED_STACK)
#define WorkingArea(s, n) uint32_t s[UserStackSize(n) >> 2];
#define chSysIRQEnterI() { \
}
#define chSysIRQExitI() { \
asm("b IrqCommon \n\t"); \
}
#define chSysIRQEnterI()
/* It requires zero bytes, but better be safe.*/
#define IDLE_THREAD_STACK_SIZE 8
@ -100,5 +95,6 @@ void chSysHalt(void);
void chSysSwitchI(Thread *otp, Thread *ntp);
void chSysPuts(char *msg);
void threadstart(void);
void chSysIRQExitI(void);
#endif /* _CHCORE_H_ */