[rtems commit] score: Delete unused functions

Sebastian Huber sebh at rtems.org
Wed Nov 2 09:09:23 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Oct 21 14:15:30 2016 +0200

score: Delete unused functions

Delete _Scheduler_Thread_change_resource_root() and
_Scheduler_Thread_change_help_state().

Update #2556.

---

 cpukit/score/Makefile.am                         |  1 -
 cpukit/score/include/rtems/score/schedulerimpl.h | 42 -------------
 cpukit/score/src/schedulerchangeroot.c           | 80 ------------------------
 3 files changed, 123 deletions(-)

diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index 7b88c96..7b0a71e 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -153,7 +153,6 @@ endif
 if HAS_SMP
 libscore_a_SOURCES += src/percpustatewait.c
 libscore_a_SOURCES += src/profilingsmplock.c
-libscore_a_SOURCES += src/schedulerchangeroot.c
 libscore_a_SOURCES += src/schedulerpriorityaffinitysmp.c
 libscore_a_SOURCES += src/schedulerprioritysmp.c
 libscore_a_SOURCES += src/schedulersimplesmp.c
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 92b08e5..b179f67 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -1068,48 +1068,6 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Thread_change_state(
   the_thread->Scheduler.state = new_state;
 }
 
-/**
- * @brief Changes the scheduler help state of a thread.
- *
- * @param[in] the_thread The thread.
- * @param[in] new_help_state The new help state.
- *
- * @return The previous help state.
- */
-RTEMS_INLINE_ROUTINE Scheduler_Help_state _Scheduler_Thread_change_help_state(
-  Thread_Control       *the_thread,
-  Scheduler_Help_state  new_help_state
-)
-{
-  Scheduler_Node *node = _Thread_Scheduler_get_own_node( the_thread );
-  Scheduler_Help_state previous_help_state = node->help_state;
-
-  node->help_state = new_help_state;
-
-  return previous_help_state;
-}
-
-/**
- * @brief Changes the resource tree root of a thread.
- *
- * For each node of the resource sub-tree specified by the top thread the
- * scheduler asks for help.  So the root thread gains access to all scheduler
- * nodes corresponding to the resource sub-tree.  In case a thread previously
- * granted help is displaced by this operation, then the scheduler asks for
- * help using its remaining resource tree.
- *
- * The run-time of this function depends on the size of the resource sub-tree
- * and other resource trees in case threads in need for help are produced
- * during this operation.
- *
- * @param[in] top The thread specifying the resource sub-tree top.
- * @param[in] root The thread specifying the new resource sub-tree root.
- */
-void _Scheduler_Thread_change_resource_root(
-  Thread_Control *top,
-  Thread_Control *root
-);
-
 RTEMS_INLINE_ROUTINE void _Scheduler_Set_idle_thread(
   Scheduler_Node *node,
   Thread_Control *idle
diff --git a/cpukit/score/src/schedulerchangeroot.c b/cpukit/score/src/schedulerchangeroot.c
deleted file mode 100644
index 7cddb04..0000000
--- a/cpukit/score/src/schedulerchangeroot.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
- *
- *  embedded brains GmbH
- *  Dornierstr. 4
- *  82178 Puchheim
- *  Germany
- *  <rtems at embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#if HAVE_CONFIG_H
-  #include "config.h"
-#endif
-
-#include <rtems/score/schedulerimpl.h>
-
-typedef struct {
-  Thread_Control *root;
-  Thread_Control *needs_help;
-} Scheduler_Set_root_context;
-
-RTEMS_INLINE_ROUTINE bool _Scheduler_Set_root_visitor(
-  Resource_Node *resource_node,
-  void          *arg
-)
-{
-  Scheduler_Set_root_context *ctx = arg;
-  Thread_Control *root = ctx->root;
-  Thread_Control *needs_help = root;
-  Thread_Control *offers_help =
-    THREAD_RESOURCE_NODE_TO_THREAD( resource_node );
-  const Scheduler_Control *scheduler = _Scheduler_Get_own( offers_help );
-  Thread_Control *needs_help_too;
-
-  _Resource_Node_set_root( resource_node, &root->Resource_node );
-
-  needs_help_too = ( *scheduler->Operations.ask_for_help_X )(
-    scheduler,
-    offers_help,
-    needs_help
-  );
-
-  if ( needs_help_too != needs_help && needs_help_too != NULL ) {
-    _Assert( ctx->needs_help == NULL );
-    ctx->needs_help = needs_help_too;
-  }
-
-  return false;
-}
-
-void _Scheduler_Thread_change_resource_root(
-  Thread_Control *top,
-  Thread_Control *root
-)
-{
-  Scheduler_Set_root_context ctx = { root, NULL };
-  Thread_Control *offers_help = top;
-  Scheduler_Node *offers_help_node;
-  Thread_Control *offers_help_too;
-
-  offers_help_node = _Scheduler_Thread_get_node( offers_help );
-  offers_help_too = _Scheduler_Node_get_owner( offers_help_node );
-
-  if ( offers_help != offers_help_too ) {
-    _Scheduler_Set_root_visitor( &offers_help_too->Resource_node, &ctx );
-    _Assert( ctx.needs_help == offers_help );
-    ctx.needs_help = NULL;
-  }
-
-  _Scheduler_Set_root_visitor( &top->Resource_node, &ctx );
-  _Resource_Iterate( &top->Resource_node, _Scheduler_Set_root_visitor, &ctx );
-
-  if ( ctx.needs_help != NULL ) {
-    _Scheduler_Ask_for_help_X( ctx.needs_help );
-  }
-}




More information about the vc mailing list