[PATCH 27/30] score: Delete Thread_Scheduler_control::node

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Oct 31 08:51:58 UTC 2016


Update #2556.
---
 cpukit/score/include/rtems/score/schedulercbsimpl.h     |  2 +-
 cpukit/score/include/rtems/score/scheduleredfimpl.h     |  2 +-
 cpukit/score/include/rtems/score/schedulerimpl.h        | 12 ------------
 .../score/include/rtems/score/schedulerpriorityimpl.h   |  2 +-
 .../include/rtems/score/schedulerprioritysmpimpl.h      |  2 +-
 cpukit/score/include/rtems/score/schedulersmpimpl.h     |  2 +-
 cpukit/score/include/rtems/score/thread.h               | 17 ++++++-----------
 cpukit/score/src/schedulerpriorityaffinitysmp.c         |  2 +-
 cpukit/score/src/threadinitialize.c                     |  1 -
 9 files changed, 12 insertions(+), 30 deletions(-)

diff --git a/cpukit/score/include/rtems/score/schedulercbsimpl.h b/cpukit/score/include/rtems/score/schedulercbsimpl.h
index 84f6b5d..ed75979 100644
--- a/cpukit/score/include/rtems/score/schedulercbsimpl.h
+++ b/cpukit/score/include/rtems/score/schedulercbsimpl.h
@@ -40,7 +40,7 @@ RTEMS_INLINE_ROUTINE Scheduler_CBS_Node *_Scheduler_CBS_Thread_get_node(
   Thread_Control *the_thread
 )
 {
-  return (Scheduler_CBS_Node *) _Scheduler_Thread_get_node( the_thread );
+  return (Scheduler_CBS_Node *) _Thread_Scheduler_get_home_node( the_thread );
 }
 
 RTEMS_INLINE_ROUTINE Scheduler_CBS_Node *_Scheduler_CBS_Node_downcast(
diff --git a/cpukit/score/include/rtems/score/scheduleredfimpl.h b/cpukit/score/include/rtems/score/scheduleredfimpl.h
index bfb5b45..94a78fc 100644
--- a/cpukit/score/include/rtems/score/scheduleredfimpl.h
+++ b/cpukit/score/include/rtems/score/scheduleredfimpl.h
@@ -50,7 +50,7 @@ RTEMS_INLINE_ROUTINE Scheduler_EDF_Node *_Scheduler_EDF_Thread_get_node(
   Thread_Control *the_thread
 )
 {
-  return (Scheduler_EDF_Node *) _Scheduler_Thread_get_node( the_thread );
+  return (Scheduler_EDF_Node *) _Thread_Scheduler_get_home_node( the_thread );
 }
 
 RTEMS_INLINE_ROUTINE Scheduler_EDF_Node * _Scheduler_EDF_Node_downcast(
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index ac6893e..17482b9 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -149,17 +149,6 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Release_critical(
 #endif
 }
 
-RTEMS_INLINE_ROUTINE Scheduler_Node *_Scheduler_Thread_get_node(
-  const Thread_Control *the_thread
-)
-{
-#if defined(RTEMS_SMP)
-  return the_thread->Scheduler.node;
-#else
-  return the_thread->Scheduler.nodes;
-#endif
-}
-
 /**
  * The preferred method to add a new scheduler is to define the jump table
  * entries and add a case to the _Scheduler_Initialize routine.
@@ -1323,7 +1312,6 @@ RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set(
       the_thread->Scheduler.own_control = new_scheduler;
       the_thread->Scheduler.control = new_scheduler;
       the_thread->Scheduler.own_node = new_scheduler_node;
-      the_thread->Scheduler.node = new_scheduler_node;
       _Scheduler_Node_set_priority( new_scheduler_node, priority, false );
 
       if ( _States_Is_ready( current_state ) ) {
diff --git a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
index e9e9873..68c61c1 100644
--- a/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
@@ -45,7 +45,7 @@ RTEMS_INLINE_ROUTINE Scheduler_priority_Node *_Scheduler_priority_Thread_get_nod
   Thread_Control *the_thread
 )
 {
-  return (Scheduler_priority_Node *) _Scheduler_Thread_get_node( the_thread );
+  return (Scheduler_priority_Node *) _Thread_Scheduler_get_home_node( the_thread );
 }
 
 RTEMS_INLINE_ROUTINE Scheduler_priority_Node *_Scheduler_priority_Node_downcast(
diff --git a/cpukit/score/include/rtems/score/schedulerprioritysmpimpl.h b/cpukit/score/include/rtems/score/schedulerprioritysmpimpl.h
index 9ae0103..4fe4d29 100644
--- a/cpukit/score/include/rtems/score/schedulerprioritysmpimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerprioritysmpimpl.h
@@ -48,7 +48,7 @@ static inline Scheduler_priority_SMP_Node *_Scheduler_priority_SMP_Thread_get_no
   Thread_Control *thread
 )
 {
-  return (Scheduler_priority_SMP_Node *) _Scheduler_Thread_get_node( thread );
+  return (Scheduler_priority_SMP_Node *) _Thread_Scheduler_get_home_node( thread );
 }
 
 static inline Scheduler_priority_SMP_Node *
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h
index ea7d88b..bfd7650 100644
--- a/cpukit/score/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h
@@ -376,7 +376,7 @@ static inline Scheduler_SMP_Node *_Scheduler_SMP_Thread_get_node(
   Thread_Control *thread
 )
 {
-  return (Scheduler_SMP_Node *) _Scheduler_Thread_get_node( thread );
+  return (Scheduler_SMP_Node *) _Thread_Scheduler_get_home_node( thread );
 }
 
 static inline Scheduler_SMP_Node *_Scheduler_SMP_Thread_get_own_node(
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index 450ca80..8f923cd 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -277,17 +277,6 @@ typedef struct {
   Scheduler_Node *own_node;
 
   /**
-   * @brief The scheduler node of this thread.
-   *
-   * On uni-processor configurations this field is constant after
-   * initialization.
-   *
-   * On SMP configurations the scheduler helping protocol may change this
-   * field.
-   */
-  Scheduler_Node *node;
-
-  /**
    * @brief The processor assigned by the current scheduler.
    */
   struct Per_CPU_Control *cpu;
@@ -297,6 +286,9 @@ typedef struct {
    * scheduler instance and due to thread queue ownerships.
    *
    * This chain is protected by the thread wait lock.
+   *
+   * This chain is never empty.  The first scheduler node on the chain is the
+   * scheduler node of the home scheduler instance.
    */
   Chain_Control Wait_nodes;
 
@@ -305,6 +297,9 @@ typedef struct {
    * thread.
    *
    * This chain is protected by the thread state lock.
+   *
+   * This chain is never empty.  The first scheduler node on the chain is the
+   * scheduler node of the home scheduler instance.
    */
   Chain_Control Scheduler_nodes;
 
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index 1163a1a..9c8fd3c 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -70,7 +70,7 @@ _Scheduler_priority_affinity_SMP_Thread_get_node(
 )
 {
   return (Scheduler_priority_affinity_SMP_Node *)
-    _Scheduler_Thread_get_node( thread );
+    _Thread_Scheduler_get_home_node( thread );
 }
 
 static Scheduler_priority_affinity_SMP_Node *
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index f151989..37feb37 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -235,7 +235,6 @@ bool _Thread_Initialize(
   the_thread->Scheduler.own_control = scheduler;
   the_thread->Scheduler.control = scheduler;
   the_thread->Scheduler.own_node = scheduler_node;
-  the_thread->Scheduler.node = scheduler_node;
   _ISR_lock_Initialize( &the_thread->Scheduler.Lock, "Thread Scheduler" );
   _ISR_lock_Initialize( &the_thread->Wait.Lock.Default, "Thread Wait Default" );
   _Thread_queue_Gate_open( &the_thread->Wait.Lock.Tranquilizer );
-- 
1.8.4.5




More information about the devel mailing list