Changeset 2dd098a in rtems


Ignore:
Timestamp:
Oct 31, 2016, 7:33:11 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
63e2ca1b
Parents:
7f742432
git-author:
Sebastian Huber <sebastian.huber@…> (10/31/16 07:33:11)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/02/16 09:05:45)
Message:

score: Introduce Thread_Scheduler_control::home

Replace Thread_Scheduler_control::control and
Thread_Scheduler_control::own_control with new
Thread_Scheduler_control::home.

Update #2556.

Files:
26 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/capture/capture.h

    r7f742432 r2dd098a  
    873873rtems_capture_task_start_priority (rtems_tcb* tcb)
    874874{
    875   return _RTEMS_Priority_From_core (_Scheduler_Get_own( tcb ),
     875  return _RTEMS_Priority_From_core (_Thread_Scheduler_get_home( tcb ),
    876876                                    tcb->Start.initial_priority);
    877877}
  • cpukit/libmisc/cpuuse/cpuusagereset.c

    r7f742432 r2dd098a  
    3737
    3838  _Thread_State_acquire( the_thread, &state_lock_context );
    39   scheduler = _Scheduler_Get( the_thread );
     39  scheduler = _Thread_Scheduler_get_home( the_thread );
    4040  _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
    4141
  • cpukit/posix/src/mutexinit.c

    r7f742432 r2dd098a  
    111111    bool valid;
    112112
    113     scheduler = _Scheduler_Get_own( _Thread_Get_executing() );
     113    scheduler = _Thread_Scheduler_get_home( _Thread_Get_executing() );
    114114    prio_ceiling = the_attr->prio_ceiling;
    115115
  • cpukit/posix/src/pthread.c

    r7f742432 r2dd098a  
    169169  _POSIX_Threads_Initialize_attributes( &api->Attributes );
    170170  api->Attributes.schedparam.sched_priority = _POSIX_Priority_From_core(
    171     _Scheduler_Get_own( created ),
     171    _Thread_Scheduler_get_home( created ),
    172172    _Thread_Get_priority( created )
    173173  );
  • cpukit/posix/src/pthreadcreate.c

    r7f742432 r2dd098a  
    152152  normal_prio = schedparam.sched_priority;
    153153
    154   scheduler = _Scheduler_Get_own( executing );
     154  scheduler = _Thread_Scheduler_get_home( executing );
    155155
    156156  core_normal_prio = _POSIX_Priority_To_core( scheduler, normal_prio, &valid );
  • cpukit/posix/src/pthreadgetschedparam.c

    r7f742432 r2dd098a  
    5959  *param  = api->Attributes.schedparam;
    6060
    61   scheduler = _Scheduler_Get_own( the_thread );
     61  scheduler = _Thread_Scheduler_get_home( the_thread );
    6262  priority = the_thread->Real_priority.priority;
    6363
  • cpukit/posix/src/pthreadsetschedparam.c

    r7f742432 r2dd098a  
    5656  }
    5757
    58   scheduler = _Scheduler_Get_own( the_thread );
     58  scheduler = _Thread_Scheduler_get_home( the_thread );
    5959
    6060  core_normal_prio = _POSIX_Priority_To_core( scheduler, low_prio, &valid );
  • cpukit/posix/src/pthreadsetschedprio.c

    r7f742432 r2dd098a  
    3737  _Thread_Wait_acquire_critical( the_thread, &queue_context );
    3838
    39   scheduler = _Scheduler_Get_own( the_thread );
     39  scheduler = _Thread_Scheduler_get_home( the_thread );
    4040
    4141  new_priority = _POSIX_Priority_To_core( scheduler, prio, &valid );
  • cpukit/posix/src/sched_getprioritymax.c

    r7f742432 r2dd098a  
    4444  }
    4545
    46   scheduler = _Scheduler_Get_own( _Thread_Get_executing() );
     46  scheduler = _Thread_Scheduler_get_home( _Thread_Get_executing() );
    4747  return _POSIX_Priority_Get_maximum( scheduler );
    4848}
  • cpukit/rtems/src/semcreate.c

    r7f742432 r2dd098a  
    158158      break;
    159159    case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
    160       scheduler = _Scheduler_Get_own( executing );
     160      scheduler = _Thread_Scheduler_get_home( executing );
    161161      priority = _RTEMS_Priority_To_core( scheduler, priority_ceiling, &valid );
    162162
     
    196196#if defined(RTEMS_SMP)
    197197    case SEMAPHORE_VARIANT_MRSP:
    198       scheduler = _Scheduler_Get_own( executing );
     198      scheduler = _Thread_Scheduler_get_home( executing );
    199199      priority = _RTEMS_Priority_To_core( scheduler, priority_ceiling, &valid );
    200200
  • cpukit/rtems/src/taskgetscheduler.c

    r7f742432 r2dd098a  
    4747  _Thread_State_acquire_critical( the_thread, &lock_context );
    4848
    49   scheduler = _Scheduler_Get( the_thread );
     49  scheduler = _Thread_Scheduler_get_home( the_thread );
    5050  *scheduler_id = _Scheduler_Build_id( _Scheduler_Get_index( scheduler ) );
    5151
  • cpukit/rtems/src/tasksetpriority.c

    r7f742432 r2dd098a  
    9191  _Thread_Wait_acquire_critical( the_thread, &queue_context );
    9292
    93   scheduler = _Scheduler_Get_own( the_thread );
     93  scheduler = _Thread_Scheduler_get_home( the_thread );
    9494  old_priority = _Thread_Get_priority( the_thread );
    9595
  • cpukit/score/include/rtems/score/coremuteximpl.h

    r7f742432 r2dd098a  
    333333#if defined(RTEMS_SMP)
    334334    if (
    335       _Scheduler_Get_own( executing )
     335      _Thread_Scheduler_get_home( executing )
    336336        != _CORE_ceiling_mutex_Get_scheduler( the_mutex )
    337337    ) {
  • cpukit/score/include/rtems/score/mrspimpl.h

    r7f742432 r2dd098a  
    106106  _Thread_Wait_acquire_default_critical( thread, &lock_context );
    107107
    108   scheduler = _Scheduler_Get_own( thread );
     108  scheduler = _Thread_Scheduler_get_home( thread );
    109109  scheduler_node = _Thread_Scheduler_get_home_node( thread );
    110110  ceiling_priority = _MRSP_Get_priority( mrsp, scheduler );
  • cpukit/score/include/rtems/score/schedulerimpl.h

    r7f742432 r2dd098a  
    5454}
    5555
    56 RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get(
    57   const Thread_Control *the_thread
    58 )
    59 {
    60 #if defined(RTEMS_SMP)
    61   return the_thread->Scheduler.control;
    62 #else
    63   (void) the_thread;
    64 
    65   return &_Scheduler_Table[ 0 ];
    66 #endif
    67 }
    68 
    69 RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_own(
    70   const Thread_Control *the_thread
    71 )
    72 {
    73 #if defined(RTEMS_SMP)
    74   return the_thread->Scheduler.own_control;
    75 #else
    76   (void) the_thread;
    77 
    78   return &_Scheduler_Table[ 0 ];
    79 #endif
    80 }
    81 
    8256RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_by_CPU_index(
    8357  uint32_t cpu_index
     
    178152  ISR_lock_Context         lock_context;
    179153
    180   scheduler = _Scheduler_Get( the_thread );
     154  scheduler = _Thread_Scheduler_get_home( the_thread );
    181155  _Scheduler_Acquire_critical( scheduler, &lock_context );
    182156
     
    247221  const Scheduler_Control *scheduler;
    248222
    249   scheduler = _Scheduler_Get( the_thread );
     223  scheduler = _Thread_Scheduler_get_home( the_thread );
    250224  ( *scheduler->Operations.yield )(
    251225    scheduler,
     
    309283  const Scheduler_Control *scheduler;
    310284
    311   scheduler = _Scheduler_Get( the_thread );
     285  scheduler = _Thread_Scheduler_get_home( the_thread );
    312286  ( *scheduler->Operations.block )(
    313287    scheduler,
     
    381355  const Scheduler_Control *scheduler;
    382356
    383   scheduler = _Scheduler_Get( the_thread );
     357  scheduler = _Thread_Scheduler_get_home( the_thread );
    384358  ( *scheduler->Operations.unblock )(
    385359    scheduler,
     
    436410  const Scheduler_Control *scheduler;
    437411
    438   scheduler = _Scheduler_Get( the_thread );
     412  scheduler = _Thread_Scheduler_get_home( the_thread );
    439413  ( *scheduler->Operations.update_priority )(
    440414    scheduler,
     
    602576)
    603577{
    604   const Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
     578  const Scheduler_Control *scheduler = _Thread_Scheduler_get_home( the_thread );
    605579
    606580  _Thread_queue_Context_clear_priority_updates( queue_context );
     
    628602)
    629603{
    630   const Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
     604  const Scheduler_Control *scheduler = _Thread_Scheduler_get_home( the_thread );
    631605
    632606  _Thread_queue_Context_clear_priority_updates( queue_context );
     
    12841258    const Scheduler_Control *old_scheduler;
    12851259
    1286     old_scheduler = _Scheduler_Get( the_thread );
     1260    old_scheduler = _Thread_Scheduler_get_home( the_thread );
    12871261
    12881262    if ( old_scheduler != new_scheduler ) {
     
    13131287      );
    13141288
    1315       the_thread->Scheduler.own_control = new_scheduler;
    1316       the_thread->Scheduler.control = new_scheduler;
     1289      the_thread->Scheduler.home = new_scheduler;
    13171290      _Scheduler_Node_set_priority( new_scheduler_node, priority, false );
    13181291
  • cpukit/score/include/rtems/score/thread.h

    r7f742432 r2dd098a  
    256256
    257257  /**
    258    * @brief The own scheduler control of this thread.
    259    *
    260    * This field is constant after initialization.
    261    */
    262   const struct Scheduler_Control *own_control;
    263 
    264   /**
    265    * @brief The scheduler control of this thread.
    266    *
    267    * The scheduler helping protocol may change this field.
    268    */
    269   const struct Scheduler_Control *control;
     258   * @brief The home scheduler control of this thread.
     259   */
     260  const struct Scheduler_Control *home;
    270261
    271262  /**
  • cpukit/score/include/rtems/score/threadimpl.h

    r7f742432 r2dd098a  
    10051005}
    10061006#endif
     1007
     1008RTEMS_INLINE_ROUTINE const Scheduler_Control *_Thread_Scheduler_get_home(
     1009  const Thread_Control *the_thread
     1010)
     1011{
     1012#if defined(RTEMS_SMP)
     1013  return the_thread->Scheduler.home;
     1014#else
     1015  (void) the_thread;
     1016  return &_Scheduler_Table[ 0 ];
     1017#endif
     1018}
    10071019
    10081020RTEMS_INLINE_ROUTINE Scheduler_Node *_Thread_Scheduler_get_home_node(
  • cpukit/score/src/sched.c

    r7f742432 r2dd098a  
    3232  Thread_Control *executing = _Thread_Get_executing();
    3333
    34   return (int) _Scheduler_Get_index( _Scheduler_Get( executing ) );
     34  return (int) _Scheduler_Get_index( _Thread_Scheduler_get_home( executing ) );
    3535}
    3636
  • cpukit/score/src/schedulergetaffinity.c

    r7f742432 r2dd098a  
    3535  }
    3636
    37   scheduler = _Scheduler_Get( the_thread );
     37  scheduler = _Thread_Scheduler_get_home( the_thread );
    3838  _Scheduler_Acquire_critical( scheduler, &lock_context );
    3939
  • cpukit/score/src/schedulersetaffinity.c

    r7f742432 r2dd098a  
    3535  }
    3636
    37   scheduler = _Scheduler_Get( the_thread );
     37  scheduler = _Thread_Scheduler_get_home( the_thread );
    3838  _Scheduler_Acquire_critical( scheduler, &lock_context );
    3939
  • cpukit/score/src/threadgetcputimeused.c

    r7f742432 r2dd098a  
    3939
    4040  _Thread_State_acquire( the_thread, &state_lock_context );
    41   scheduler = _Scheduler_Get( the_thread );
     41  scheduler = _Thread_Scheduler_get_home( the_thread );
    4242  _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
    4343
  • cpukit/score/src/threadinitialize.c

    r7f742432 r2dd098a  
    233233#if defined(RTEMS_SMP)
    234234  RTEMS_STATIC_ASSERT( THREAD_SCHEDULER_BLOCKED == 0, Scheduler_state );
    235   the_thread->Scheduler.own_control = scheduler;
    236   the_thread->Scheduler.control = scheduler;
     235  the_thread->Scheduler.home = scheduler;
    237236  _ISR_lock_Initialize( &the_thread->Scheduler.Lock, "Thread Scheduler" );
    238237  _ISR_lock_Initialize( &the_thread->Wait.Lock.Default, "Thread Wait Default" );
  • cpukit/score/src/threadrestart.c

    r7f742432 r2dd098a  
    170170  _ISR_lock_Destroy( &the_thread->Keys.Lock );
    171171  _Scheduler_Node_destroy(
    172     _Scheduler_Get( the_thread ),
     172    _Thread_Scheduler_get_home( the_thread ),
    173173    _Thread_Scheduler_get_home_node( the_thread )
    174174  );
  • testsuites/smptests/smpscheduler03/init.c

    r7f742432 r2dd098a  
    215215
    216216  _Thread_State_acquire( thread, &state_lock_context );
    217   scheduler = _Scheduler_Get( thread );
     217  scheduler = _Thread_Scheduler_get_home( thread );
    218218  _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
    219219
     
    326326
    327327  _Thread_State_acquire( thread, &state_lock_context );
    328   scheduler = _Scheduler_Get( thread );
     328  scheduler = _Thread_Scheduler_get_home( thread );
    329329  _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
    330330
     
    465465
    466466  _Thread_State_acquire( thread, &state_lock_context );
    467   scheduler = _Scheduler_Get( thread );
     467  scheduler = _Thread_Scheduler_get_home( thread );
    468468  _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
    469469
     
    485485
    486486  _Thread_State_acquire( thread, &state_lock_context );
    487   scheduler = _Scheduler_Get( thread );
     487  scheduler = _Thread_Scheduler_get_home( thread );
    488488  _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
    489489
  • testsuites/tmtests/tm26/task1.c

    r7f742432 r2dd098a  
    317317{
    318318  Scheduler_priority_Context *scheduler_context =
    319     _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
     319    _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) );
    320320
    321321  thread_dispatch_no_fp_time = benchmark_timer_read();
     
    350350{
    351351  Scheduler_priority_Context *scheduler_context =
    352     _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
     352    _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) );
    353353  Thread_Control             *executing;
    354354
     
    390390{
    391391  Scheduler_priority_Context *scheduler_context =
    392     _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
     392    _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) );
    393393  Thread_Control             *executing;
    394394  FP_DECLARE;
     
    446446{
    447447  Scheduler_priority_Context *scheduler_context =
    448     _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
     448    _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) );
    449449  Thread_Control             *executing;
    450450  FP_DECLARE;
  • testsuites/tmtests/tm27/task1.c

    r7f742432 r2dd098a  
    108108{
    109109  Scheduler_priority_Context *scheduler_context =
    110     _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
     110    _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) );
    111111#if defined(RTEMS_SMP)
    112112  rtems_interrupt_level level;
     
    232232
    233233  _Thread_State_acquire( executing, &state_lock_context );
    234   scheduler = _Scheduler_Get( executing );
     234  scheduler = _Thread_Scheduler_get_home( executing );
    235235  scheduler_context = _Scheduler_priority_Get_context( scheduler );
    236236  _Thread_State_release( executing, &state_lock_context );
Note: See TracChangeset for help on using the changeset viewer.