Changeset 3fe0711 in rtems


Ignore:
Timestamp:
Sep 21, 2021, 11:34:57 AM (4 weeks ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
abda559
Parents:
c2f24048
git-author:
Sebastian Huber <sebastian.huber@…> (09/21/21 11:34:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/22/21 16:31:46)
Message:

score: Improve variable names in thread init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/threadinitialize.c

    rc2f24048 r3fe0711  
    102102)
    103103{
     104  Scheduler_Node          *home_scheduler_node;
     105#if defined(RTEMS_SMP)
    104106  Scheduler_Node          *scheduler_node;
    105 #if defined(RTEMS_SMP)
    106   Scheduler_Node          *scheduler_node_for_index;
    107   const Scheduler_Control *scheduler_for_index;
     107  const Scheduler_Control *scheduler;
    108108  size_t                   scheduler_index;
    109109#endif
    110110
    111111#if defined(RTEMS_SMP)
    112   scheduler_node = NULL;
    113   scheduler_node_for_index = the_thread->Scheduler.nodes;
    114   scheduler_for_index = &_Scheduler_Table[ 0 ];
     112  home_scheduler_node = NULL;
     113  scheduler_node = the_thread->Scheduler.nodes;
     114  scheduler = &_Scheduler_Table[ 0 ];
    115115  scheduler_index = 0;
    116116
     
    122122   */
    123123  while ( scheduler_index < _Scheduler_Count ) {
    124     Priority_Control priority_for_index;
    125 
    126     if ( scheduler_for_index == config->scheduler ) {
    127       priority_for_index = config->priority;
    128       scheduler_node = scheduler_node_for_index;
     124    Priority_Control priority;
     125
     126    if ( scheduler == config->scheduler ) {
     127      priority = config->priority;
     128      home_scheduler_node = scheduler_node;
    129129    } else {
    130130      /*
     
    132132       * default.
    133133       */
    134       priority_for_index = _Scheduler_Map_priority(
    135         scheduler_for_index,
    136         scheduler_for_index->maximum_priority
     134      priority = _Scheduler_Map_priority(
     135        scheduler,
     136        scheduler->maximum_priority
    137137      );
    138138    }
    139139
    140140    _Scheduler_Node_initialize(
    141       scheduler_for_index,
    142       scheduler_node_for_index,
     141      scheduler,
     142      scheduler_node,
    143143      the_thread,
    144       priority_for_index
     144      priority
    145145    );
    146146
     
    150150     * scheduler node.  Using sizeof( Scheduler_Node ) would be wrong.
    151151     */
    152     scheduler_node_for_index = (Scheduler_Node *)
    153       ( (uintptr_t) scheduler_node_for_index + _Scheduler_Node_size );
    154     ++scheduler_for_index;
     152    scheduler_node = (Scheduler_Node *)
     153      ( (uintptr_t) scheduler_node + _Scheduler_Node_size );
     154    ++scheduler;
    155155    ++scheduler_index;
    156156  }
     
    160160   * provided by its home scheduler.
    161161   */
    162   _Assert( scheduler_node != NULL );
     162  _Assert( home_scheduler_node != NULL );
    163163  _Chain_Initialize_one(
    164164    &the_thread->Scheduler.Wait_nodes,
    165     &scheduler_node->Thread.Wait_node
     165    &home_scheduler_node->Thread.Wait_node
    166166  );
    167167  _Chain_Initialize_one(
    168168    &the_thread->Scheduler.Scheduler_nodes,
    169     &scheduler_node->Thread.Scheduler_node.Chain
     169    &home_scheduler_node->Thread.Scheduler_node.Chain
    170170  );
    171171#else
     
    173173   * In uniprocessor configurations, the thread has exactly one scheduler node.
    174174   */
    175   scheduler_node = _Thread_Scheduler_get_home_node( the_thread );
     175  home_scheduler_node = _Thread_Scheduler_get_home_node( the_thread );
    176176  _Scheduler_Node_initialize(
    177177    config->scheduler,
    178     scheduler_node,
     178    home_scheduler_node,
    179179    the_thread,
    180180    config->priority
     
    190190  _Priority_Node_initialize( &the_thread->Real_priority, config->priority );
    191191  _Priority_Initialize_one(
    192     &scheduler_node->Wait.Priority,
     192    &home_scheduler_node->Wait.Priority,
    193193    &the_thread->Real_priority
    194194  );
Note: See TracChangeset for help on using the changeset viewer.