aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/rt/reports/STM32F407-168-GCC.txt7
-rw-r--r--os/rt/include/chvt.h14
2 files changed, 15 insertions, 6 deletions
diff --git a/doc/rt/reports/STM32F407-168-GCC.txt b/doc/rt/reports/STM32F407-168-GCC.txt
index f814e3f86..7e38f9edc 100644
--- a/doc/rt/reports/STM32F407-168-GCC.txt
+++ b/doc/rt/reports/STM32F407-168-GCC.txt
@@ -6,8 +6,8 @@ Settings: SYSCLK=168, ACR=0x705 (5 wait states)
*** ChibiOS/RT test suite
***
*** Kernel: 3.0.0dev
-*** Compiled: Dec 11 2014 - 16:38:49
-*** Compiler: GCC 4.7.3 20130312 (release) [ARM/embedded-4_7-branch revision 196615]
+*** Compiled: Mar 23 2015 - 11:26:02
+*** Compiler: GCC 4.7.4 20140401 (release) [ARM/embedded-4_7-branch revision 209195]
*** Architecture: ARMv7-ME
*** Core Variant: Cortex-M4
*** Port Info: Advanced kernel mode
@@ -130,7 +130,7 @@ Settings: SYSCLK=168, ACR=0x705 (5 wait states)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset)
---- Score : 1322832 timers/S
+--- Score : 1322828 timers/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal)
@@ -156,4 +156,3 @@ Settings: SYSCLK=168, ACR=0x705 (5 wait states)
----------------------------------------------------------------------------
Final result: SUCCESS
-
diff --git a/os/rt/include/chvt.h b/os/rt/include/chvt.h
index 1bc83d908..736d572b4 100644
--- a/os/rt/include/chvt.h
+++ b/os/rt/include/chvt.h
@@ -494,6 +494,15 @@ static inline void chVTDoTickI(void) {
ch.vtlist.vt_next = vtp->vt_next;
fn = vtp->vt_func;
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();
/* The callback is invoked outside the kernel critical zone.*/
@@ -503,10 +512,11 @@ static inline void chVTDoTickI(void) {
of the list.*/
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;
if (&ch.vtlist == (virtual_timers_list_t *)vtp) {
- port_timer_stop_alarm();
return;
}