[rtems commit] score: Rename _Scheduler_Set_idle_thread()

Sebastian Huber sebh at rtems.org
Tue Nov 23 13:34:54 UTC 2021


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Oct 18 09:05:30 2021 +0200

score: Rename _Scheduler_Set_idle_thread()

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 ++----------------------
 cpukit/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 6e079f3..1109933 100644
--- a/cpukit/include/rtems/score/schedulerimpl.h
+++ b/cpukit/include/rtems/score/schedulerimpl.h
@@ -900,26 +900,6 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Thread_change_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.
  *
  * A thread whose home scheduler node has a sticky level greater than zero may
@@ -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 e222de9..ecdc3c6 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



More information about the vc mailing list