Changeset 4d1f500 in rtems


Ignore:
Timestamp:
Jun 3, 2014, 1:58:30 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
bb58190
Parents:
8e467384
git-author:
Sebastian Huber <sebastian.huber@…> (06/03/14 13:58:30)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/04/14 07:47:11)
Message:

score: Rename _Scheduler_Update()

Rename _Scheduler_Update() to _Scheduler_Update_priority(). Add
parameter for the new thread priority to avoid direct usage of
Thread_Control::current_priority in the scheduler operation.

Location:
cpukit/score
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/scheduler.h

    r8e467384 r4d1f500  
    7878  void ( *node_destroy )( const Scheduler_Control *, Thread_Control * );
    7979
    80   /** @see _Scheduler_Update() */
    81   void ( *update )( const Scheduler_Control *, Thread_Control * );
     80  /** @see _Scheduler_Update_priority() */
     81  void ( *update_priority )(
     82    const Scheduler_Control *,
     83    Thread_Control *,
     84    Priority_Control
     85  );
    8286
    8387  /** @see _Scheduler_Priority_compare() */
     
    278282 * @param[in] scheduler Unused.
    279283 * @param[in] the_thread Unused.
    280  */
    281 void _Scheduler_default_Update(
    282   const Scheduler_Control *scheduler,
    283   Thread_Control          *the_thread
     284 * @param[in] new_priority Unused.
     285 */
     286void _Scheduler_default_Update_priority(
     287  const Scheduler_Control *scheduler,
     288  Thread_Control          *the_thread,
     289  Priority_Control         new_priority
    284290);
    285291
  • cpukit/score/include/rtems/score/schedulercbs.h

    r8e467384 r4d1f500  
    5656    _Scheduler_CBS_Node_initialize,  /* node initialize entry point */ \
    5757    _Scheduler_default_Node_destroy, /* node destroy entry point */ \
    58     _Scheduler_EDF_Update,           /* update entry point */ \
     58    _Scheduler_EDF_Update_priority,  /* update priority entry point */ \
    5959    _Scheduler_EDF_Priority_compare, /* compares two priorities */ \
    6060    _Scheduler_CBS_Release_job,      /* new period of task */ \
  • cpukit/score/include/rtems/score/scheduleredf.h

    r8e467384 r4d1f500  
    4949    _Scheduler_EDF_Node_initialize,  /* node initialize entry point */ \
    5050    _Scheduler_default_Node_destroy, /* node destroy entry point */ \
    51     _Scheduler_EDF_Update,           /* update entry point */ \
     51    _Scheduler_EDF_Update_priority,  /* update priority entry point */ \
    5252    _Scheduler_EDF_Priority_compare, /* compares two priorities */ \
    5353    _Scheduler_EDF_Release_job,      /* new period of task */ \
     
    162162 *             structure updated.
    163163 */
    164 void _Scheduler_EDF_Update(
    165   const Scheduler_Control *scheduler,
    166   Thread_Control          *the_thread
     164void _Scheduler_EDF_Update_priority(
     165  const Scheduler_Control *scheduler,
     166  Thread_Control          *the_thread,
     167  Priority_Control         new_priority
    167168);
    168169
  • cpukit/score/include/rtems/score/schedulerimpl.h

    r8e467384 r4d1f500  
    210210
    211211/**
    212  * @brief Scheduler update.
    213  *
    214  * This routine updates @a the_thread->scheduler
    215  */
    216 RTEMS_INLINE_ROUTINE void _Scheduler_Update(
    217   const Scheduler_Control *scheduler,
    218   Thread_Control          *the_thread
    219 )
    220 {
    221   ( *scheduler->Operations.update )( scheduler, the_thread );
     212 * @brief Updates the scheduler about a priority change of a not ready thread.
     213 *
     214 * @param[in] the_thread The thread.
     215 * @param[in] new_priority The new priority of the thread.
     216 */
     217RTEMS_INLINE_ROUTINE void _Scheduler_Update_priority(
     218  const Scheduler_Control *scheduler,
     219  Thread_Control          *the_thread,
     220  Priority_Control         new_priority
     221)
     222{
     223  ( *scheduler->Operations.update_priority )(
     224    scheduler,
     225    the_thread,
     226    new_priority
     227  );
    222228}
    223229
     
    368374    the_thread->scheduler = scheduler;
    369375    _Scheduler_Node_initialize( scheduler, the_thread );
    370     _Scheduler_Update( scheduler, the_thread );
     376    _Scheduler_Update_priority(
     377      scheduler,
     378      the_thread,
     379      the_thread->current_priority
     380    );
    371381    _Thread_Clear_state( the_thread, STATES_MIGRATING );
    372382  }
  • cpukit/score/include/rtems/score/schedulerpriority.h

    r8e467384 r4d1f500  
    5656    _Scheduler_default_Node_initialize,   /* node initialize entry point */ \
    5757    _Scheduler_default_Node_destroy,      /* node destroy entry point */ \
    58     _Scheduler_priority_Update,           /* update entry point */ \
     58    _Scheduler_priority_Update_priority,  /* update priority entry point */ \
    5959    _Scheduler_priority_Priority_compare, /* compares two priorities */ \
    6060    _Scheduler_default_Release_job,       /* new period of task */ \
     
    140140
    141141/**
    142  *  @brief Update the scheduler priority.
    143  *  This routine updates @a the_thread->scheduler based on @a the_scheduler
    144  *  structures and thread state.
    145  *
    146  *  @param[in] the_thread will have its scheduler specific information
    147  *             structure updated.
    148  */
    149 void _Scheduler_priority_Update(
    150   const Scheduler_Control *scheduler,
    151   Thread_Control          *the_thread
     142 *  @brief Updates the scheduler node to reflect the new priority of the
     143 *  thread.
     144 */
     145void _Scheduler_priority_Update_priority(
     146  const Scheduler_Control *scheduler,
     147  Thread_Control          *the_thread,
     148  Priority_Control         new_priority
    152149);
    153150
  • cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h

    r8e467384 r4d1f500  
    5858    _Scheduler_priority_affinity_SMP_Node_initialize, \
    5959    _Scheduler_default_Node_destroy, \
    60     _Scheduler_priority_SMP_Update, \
     60    _Scheduler_priority_SMP_Update_priority, \
    6161    _Scheduler_priority_Priority_compare, \
    6262    _Scheduler_default_Release_job, \
  • cpukit/score/include/rtems/score/schedulerprioritysmp.h

    r8e467384 r4d1f500  
    8787    _Scheduler_priority_SMP_Node_initialize, \
    8888    _Scheduler_default_Node_destroy, \
    89     _Scheduler_priority_SMP_Update, \
     89    _Scheduler_priority_SMP_Update_priority, \
    9090    _Scheduler_priority_Priority_compare, \
    9191    _Scheduler_default_Release_job, \
     
    120120);
    121121
    122 void _Scheduler_priority_SMP_Update(
     122void _Scheduler_priority_SMP_Update_priority(
    123123  const Scheduler_Control *scheduler,
    124   Thread_Control *thread
     124  Thread_Control *thread,
     125  Priority_Control new_priority
    125126);
    126127
  • cpukit/score/include/rtems/score/schedulersimple.h

    r8e467384 r4d1f500  
    4646    _Scheduler_default_Node_initialize,   /* node initialize entry point */ \
    4747    _Scheduler_default_Node_destroy,      /* node destroy entry point */ \
    48     _Scheduler_default_Update,            /* update entry point */ \
     48    _Scheduler_default_Update_priority,   /* update priority entry point */ \
    4949    _Scheduler_priority_Priority_compare, /* compares two priorities */ \
    5050    _Scheduler_default_Release_job,       /* new period of task */ \
  • cpukit/score/include/rtems/score/schedulersimplesmp.h

    r8e467384 r4d1f500  
    6868    _Scheduler_simple_SMP_Node_initialize, \
    6969    _Scheduler_default_Node_destroy, \
    70     _Scheduler_default_Update, \
     70    _Scheduler_default_Update_priority, \
    7171    _Scheduler_priority_Priority_compare, \
    7272    _Scheduler_default_Release_job, \
  • cpukit/score/src/schedulerdefaultupdate.c

    r8e467384 r4d1f500  
    2222#include <rtems/score/scheduler.h>
    2323
    24 void _Scheduler_default_Update(
     24void _Scheduler_default_Update_priority(
    2525  const Scheduler_Control *scheduler,
    26   Thread_Control          *the_thread
     26  Thread_Control          *the_thread,
     27  Priority_Control         new_priority
    2728)
    2829{
    29   ( void ) scheduler;
    30   ( void ) the_thread;
     30  (void) scheduler;
     31  (void) the_thread;
     32  (void) new_priority;
    3133}
  • cpukit/score/src/scheduleredfupdate.c

    r8e467384 r4d1f500  
    2121#include <rtems/score/scheduleredfimpl.h>
    2222
    23 void _Scheduler_EDF_Update(
     23void _Scheduler_EDF_Update_priority(
    2424  const Scheduler_Control *scheduler,
    25   Thread_Control          *the_thread
     25  Thread_Control          *the_thread,
     26  Priority_Control         new_priority
    2627)
    2728{
     
    2930
    3031  (void) scheduler;
     32  (void) new_priority;
    3133
    3234  if (node->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) {
  • cpukit/score/src/schedulerprioritysmp.c

    r8e467384 r4d1f500  
    9494}
    9595
    96 void _Scheduler_priority_SMP_Update(
    97   const Scheduler_Control *scheduler,
    98   Thread_Control *thread
     96void _Scheduler_priority_SMP_Update_priority(
     97  const Scheduler_Control *scheduler,
     98  Thread_Control *thread,
     99  Priority_Control new_priority
    99100)
    100101{
     
    102103  Scheduler_Node *node = _Scheduler_Node_get( thread );
    103104
    104   _Scheduler_priority_SMP_Do_update( context, node, thread->current_priority );
     105  _Scheduler_priority_SMP_Do_update( context, node, new_priority );
    105106}
    106107
  • cpukit/score/src/schedulerpriorityupdate.c

    r8e467384 r4d1f500  
    2121#include <rtems/score/schedulerpriorityimpl.h>
    2222
    23 void _Scheduler_priority_Update(
     23void _Scheduler_priority_Update_priority(
    2424  const Scheduler_Control *scheduler,
    25   Thread_Control          *the_thread
     25  Thread_Control          *the_thread,
     26  Priority_Control         new_priority
    2627)
    2728{
     
    3233  _Scheduler_priority_Ready_queue_update(
    3334    &node->Ready_queue,
    34     the_thread->current_priority,
     35    new_priority,
    3536    &context->Bit_map,
    3637    &context->Ready[ 0 ]
  • cpukit/score/src/threadchangepriority.c

    r8e467384 r4d1f500  
    107107      _Scheduler_Schedule( scheduler, the_thread );
    108108    } else {
    109       _Scheduler_Update( scheduler, the_thread );
     109      _Scheduler_Update_priority( scheduler, the_thread, new_priority );
    110110    }
    111111    _ISR_Enable( level );
  • cpukit/score/src/threadsetpriority.c

    r8e467384 r4d1f500  
    2929  the_thread->current_priority = new_priority;
    3030
    31   _Scheduler_Update( _Scheduler_Get( the_thread ), the_thread );
     31  _Scheduler_Update_priority(
     32    _Scheduler_Get( the_thread),
     33    the_thread,
     34    new_priority
     35  );
    3236}
Note: See TracChangeset for help on using the changeset viewer.