[rtems commit] bsps: Do not use fast idle clock for SMP

Sebastian Huber sebh at rtems.org
Thu Jun 30 07:55:17 UTC 2016


Module:    rtems
Branch:    master
Commit:    729cf694e863c88fe0f27ed135c1721fff4c266f
Changeset: http://git.rtems.org/rtems/commit/?id=729cf694e863c88fe0f27ed135c1721fff4c266f

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Jun 30 06:27:51 2016 +0200

bsps: Do not use fast idle clock for SMP

We may have more than one idle thread.  Thus, the clock driver fast idle
logic would be a bit more complicated.

---

 c/src/lib/libbsp/shared/clockdrv_shell.h | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/c/src/lib/libbsp/shared/clockdrv_shell.h b/c/src/lib/libbsp/shared/clockdrv_shell.h
index 6609f5e..4765873 100644
--- a/c/src/lib/libbsp/shared/clockdrv_shell.h
+++ b/c/src/lib/libbsp/shared/clockdrv_shell.h
@@ -137,19 +137,21 @@ rtems_isr Clock_isr(
 
       Clock_driver_timecounter_tick();
 
-      while (
-        _Thread_Heir == _Thread_Executing
-          && _Thread_Executing->Start.Entry.Kinds.Idle.entry
-            == rtems_configuration_get_idle_task()
-      ) {
-        ISR_lock_Context lock_context;
-
-        _Timecounter_Acquire(&lock_context);
-        _Timecounter_Tick_simple(
-          interval,
-          (*tc->tc_get_timecount)(tc),
-          &lock_context
-        );
+      if (!rtems_configuration_is_smp_enabled()) {
+        while (
+          _Thread_Heir == _Thread_Executing
+            && _Thread_Executing->Start.Entry.Kinds.Idle.entry
+              == rtems_configuration_get_idle_task()
+        ) {
+          ISR_lock_Context lock_context;
+
+          _Timecounter_Acquire(&lock_context);
+          _Timecounter_Tick_simple(
+            interval,
+            (*tc->tc_get_timecount)(tc),
+            &lock_context
+          );
+        }
       }
 
       Clock_driver_support_at_tick();




More information about the vc mailing list