[PATCH 07/10] score: Clarify _Scheduler_SMP_Start_idle()

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Nov 8 08:59:41 UTC 2016


---
 cpukit/score/include/rtems/score/schedulersmp.h |  4 ++--
 cpukit/score/src/schedulersmpstartidle.c        | 20 ++++++++++++--------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/cpukit/score/include/rtems/score/schedulersmp.h b/cpukit/score/include/rtems/score/schedulersmp.h
index c85445d..0bd899a 100644
--- a/cpukit/score/include/rtems/score/schedulersmp.h
+++ b/cpukit/score/include/rtems/score/schedulersmp.h
@@ -114,8 +114,8 @@ typedef struct {
 
 void _Scheduler_SMP_Start_idle(
   const Scheduler_Control *scheduler,
-  Thread_Control *thread,
-  struct Per_CPU_Control *cpu
+  Thread_Control          *idle,
+  struct Per_CPU_Control  *cpu
 );
 
 /** @} */
diff --git a/cpukit/score/src/schedulersmpstartidle.c b/cpukit/score/src/schedulersmpstartidle.c
index 0ffb628..c28a4c3 100644
--- a/cpukit/score/src/schedulersmpstartidle.c
+++ b/cpukit/score/src/schedulersmpstartidle.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014 embedded brains GmbH
+ * Copyright (c) 2013, 2016 embedded brains GmbH.
  *
  * The license and distribution terms for this file may be
  * found in the file LICENSE in this distribution or at
@@ -14,18 +14,22 @@
 
 void _Scheduler_SMP_Start_idle(
   const Scheduler_Control *scheduler,
-  Thread_Control *thread,
-  Per_CPU_Control *cpu
+  Thread_Control          *idle,
+  Per_CPU_Control         *cpu
 )
 {
-  Scheduler_Context *context = _Scheduler_Get_context( scheduler );
-  Scheduler_SMP_Context *self = _Scheduler_SMP_Get_self( context );
-  Scheduler_SMP_Node *node = _Scheduler_SMP_Thread_get_node( thread );
+  Scheduler_Context     *context;
+  Scheduler_SMP_Context *self;
+  Scheduler_SMP_Node    *node;
+
+  context = _Scheduler_Get_context( scheduler );
+  self = _Scheduler_SMP_Get_self( context );
+  node = _Scheduler_SMP_Thread_get_node( idle );
 
   _Scheduler_Thread_change_state( thread, THREAD_SCHEDULER_SCHEDULED );
   node->state = SCHEDULER_SMP_NODE_SCHEDULED;
 
-  _Thread_Set_CPU( thread, cpu );
+  _Thread_Set_CPU( idle, cpu );
   _Chain_Append_unprotected( &self->Scheduled, &node->Base.Node );
-  _Chain_Prepend_unprotected( &self->Idle_threads, &thread->Object.Node );
+  _Scheduler_SMP_Release_idle_thread( &self->Base, idle );
 }
-- 
1.8.4.5




More information about the devel mailing list