Tentative fix for tickless mode.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7797 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2015-03-23 10:28:44 +00:00
parent ac82171cfe
commit 775ab02a91
2 changed files with 15 additions and 6 deletions

View File

@ -6,8 +6,8 @@ Settings: SYSCLK=168, ACR=0x705 (5 wait states)
*** ChibiOS/RT test suite *** ChibiOS/RT test suite
*** ***
*** Kernel: 3.0.0dev *** Kernel: 3.0.0dev
*** Compiled: Dec 11 2014 - 16:38:49 *** Compiled: Mar 23 2015 - 11:26:02
*** Compiler: GCC 4.7.3 20130312 (release) [ARM/embedded-4_7-branch revision 196615] *** Compiler: GCC 4.7.4 20140401 (release) [ARM/embedded-4_7-branch revision 209195]
*** Architecture: ARMv7-ME *** Architecture: ARMv7-ME
*** Core Variant: Cortex-M4 *** Core Variant: Cortex-M4
*** Port Info: Advanced kernel mode *** Port Info: Advanced kernel mode
@ -130,7 +130,7 @@ Settings: SYSCLK=168, ACR=0x705 (5 wait states)
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset) --- Test Case 11.10 (Benchmark, virtual timers set/reset)
--- Score : 1322832 timers/S --- Score : 1322828 timers/S
--- Result: SUCCESS --- Result: SUCCESS
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal) --- Test Case 11.11 (Benchmark, semaphores wait/signal)
@ -156,4 +156,3 @@ Settings: SYSCLK=168, ACR=0x705 (5 wait states)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Final result: SUCCESS Final result: SUCCESS

View File

@ -494,6 +494,15 @@ static inline void chVTDoTickI(void) {
ch.vtlist.vt_next = vtp->vt_next; ch.vtlist.vt_next = vtp->vt_next;
fn = vtp->vt_func; fn = vtp->vt_func;
vtp->vt_func = NULL; vtp->vt_func = NULL;
/* If the list is empty then the timer is stopped.*/
if (&ch.vtlist == (virtual_timers_list_t *)ch.vtlist.vt_next) {
port_timer_stop_alarm();
}
/* Leaving the system critical zone in order to execute the callback
and in order to give a preemption chance to higher priority
interrupts.*/
chSysUnlockFromISR(); chSysUnlockFromISR();
/* The callback is invoked outside the kernel critical zone.*/ /* The callback is invoked outside the kernel critical zone.*/
@ -503,10 +512,11 @@ static inline void chVTDoTickI(void) {
of the list.*/ of the list.*/
chSysLockFromISR(); chSysLockFromISR();
/* Next element in the list, if the list is empty then ending the loop.*/ /* If the list is empty then ending the loop, the list has to be
re-checked because new timers could have been added from within
the callback.*/
vtp = ch.vtlist.vt_next; vtp = ch.vtlist.vt_next;
if (&ch.vtlist == (virtual_timers_list_t *)vtp) { if (&ch.vtlist == (virtual_timers_list_t *)vtp) {
port_timer_stop_alarm();
return; return;
} }