[PATCH 03/27] score: Rename _Scheduler_Set_idle_thread()

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Nov 15 17:12:35 UTC 2021


Rename _Scheduler_Set_idle_thread() in _Scheduler_Node_set_idle_user() and move
it to <rtems/score/schedulernodeimpl.h>.

Update #4531.
---
 cpukit/include/rtems/score/schedulerimpl.h    | 24 ++-----------------
 .../include/rtems/score/schedulernodeimpl.h   | 21 ++++++++++++++++
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/cpukit/include/rtems/score/schedulerimpl.h b/cpukit/include/rtems/score/schedulerimpl.h
index 6e079f3a80..1109933e69 100644
--- a/cpukit/include/rtems/score/schedulerimpl.h
+++ b/cpukit/include/rtems/score/schedulerimpl.h
@@ -899,26 +899,6 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Thread_change_state(
   the_thread->Scheduler.state = new_state;
 }
 
-/**
- * @brief Sets the scheduler node's idle thread.
- *
- * @param[in, out] node The node to receive an idle thread.
- * @param idle The idle thread control for the operation.
- */
-RTEMS_INLINE_ROUTINE void _Scheduler_Set_idle_thread(
-  Scheduler_Node *node,
-  Thread_Control *idle
-)
-{
-  _Assert( _Scheduler_Node_get_idle( node ) == NULL );
-  _Assert(
-    _Scheduler_Node_get_owner( node ) == _Scheduler_Node_get_user( node )
-  );
-
-  _Scheduler_Node_set_user( node, idle );
-  node->idle = idle;
-}
-
 /**
  * @brief Uses an idle thread for this scheduler node.
  *
@@ -941,7 +921,7 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Use_idle_thread(
 {
   Thread_Control *idle = ( *get_idle_thread )( context );
 
-  _Scheduler_Set_idle_thread( node, idle );
+  _Scheduler_Node_set_idle_user( node, idle );
   _Thread_Set_CPU( idle, cpu );
   return idle;
 }
@@ -1079,7 +1059,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Exchange_idle_thread(
     uses_idle,
     _Scheduler_Node_get_owner( uses_idle )
   );
-  _Scheduler_Set_idle_thread( needs_idle, idle );
+  _Scheduler_Node_set_idle_user( needs_idle, idle );
 }
 
 /**
diff --git a/cpukit/include/rtems/score/schedulernodeimpl.h b/cpukit/include/rtems/score/schedulernodeimpl.h
index e222de953b..ecdc3c6d62 100644
--- a/cpukit/include/rtems/score/schedulernodeimpl.h
+++ b/cpukit/include/rtems/score/schedulernodeimpl.h
@@ -264,6 +264,27 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_idle(
 {
   return node->idle;
 }
+
+/**
+ * @brief Sets the scheduler node's user to the idle thread.
+ *
+ * @param[in, out] node is the node to receive an idle thread.
+ *
+ * @param idle is the idle thread to use.
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_idle_user(
+  Scheduler_Node *node,
+  Thread_Control *idle
+)
+{
+  _Assert( _Scheduler_Node_get_idle( node ) == NULL );
+  _Assert(
+    _Scheduler_Node_get_owner( node ) == _Scheduler_Node_get_user( node )
+  );
+
+  _Scheduler_Node_set_user( node, idle );
+  node->idle = idle;
+}
 #endif
 
 #ifdef __cplusplus
-- 
2.26.2



More information about the devel mailing list