[rtems commit] score: Introduce Thread_Scheduler_control::home

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


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Oct 31 08:33:11 2016 +0100

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.

---

 cpukit/libmisc/capture/capture.h                 |  2 +-
 cpukit/libmisc/cpuuse/cpuusagereset.c            |  2 +-
 cpukit/posix/src/mutexinit.c                     |  2 +-
 cpukit/posix/src/pthread.c                       |  2 +-
 cpukit/posix/src/pthreadcreate.c                 |  2 +-
 cpukit/posix/src/pthreadgetschedparam.c          |  2 +-
 cpukit/posix/src/pthreadsetschedparam.c          |  2 +-
 cpukit/posix/src/pthreadsetschedprio.c           |  2 +-
 cpukit/posix/src/sched_getprioritymax.c          |  2 +-
 cpukit/rtems/src/semcreate.c                     |  4 +--
 cpukit/rtems/src/taskgetscheduler.c              |  2 +-
 cpukit/rtems/src/tasksetpriority.c               |  2 +-
 cpukit/score/include/rtems/score/coremuteximpl.h |  2 +-
 cpukit/score/include/rtems/score/mrspimpl.h      |  2 +-
 cpukit/score/include/rtems/score/schedulerimpl.h | 45 +++++-------------------
 cpukit/score/include/rtems/score/thread.h        | 13 ++-----
 cpukit/score/include/rtems/score/threadimpl.h    | 12 +++++++
 cpukit/score/src/sched.c                         |  2 +-
 cpukit/score/src/schedulergetaffinity.c          |  2 +-
 cpukit/score/src/schedulersetaffinity.c          |  2 +-
 cpukit/score/src/threadgetcputimeused.c          |  2 +-
 cpukit/score/src/threadinitialize.c              |  3 +-
 cpukit/score/src/threadrestart.c                 |  2 +-
 testsuites/smptests/smpscheduler03/init.c        |  8 ++---
 testsuites/tmtests/tm26/task1.c                  |  8 ++---
 testsuites/tmtests/tm27/task1.c                  |  4 +--
 26 files changed, 54 insertions(+), 79 deletions(-)

diff --git a/cpukit/libmisc/capture/capture.h b/cpukit/libmisc/capture/capture.h
index 5e3237d..f847ee0 100644
--- a/cpukit/libmisc/capture/capture.h
+++ b/cpukit/libmisc/capture/capture.h
@@ -872,7 +872,7 @@ rtems_capture_task_control_flags (rtems_tcb* tcb)
 static inline rtems_task_priority
 rtems_capture_task_start_priority (rtems_tcb* tcb)
 {
-  return _RTEMS_Priority_From_core (_Scheduler_Get_own( tcb ),
+  return _RTEMS_Priority_From_core (_Thread_Scheduler_get_home( tcb ),
                                     tcb->Start.initial_priority);
 }
 
diff --git a/cpukit/libmisc/cpuuse/cpuusagereset.c b/cpukit/libmisc/cpuuse/cpuusagereset.c
index 608c6a1..507044a 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereset.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereset.c
@@ -36,7 +36,7 @@ static bool CPU_usage_Per_thread_handler(
   ISR_lock_Context         scheduler_lock_context;
 
   _Thread_State_acquire( the_thread, &state_lock_context );
-  scheduler = _Scheduler_Get( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
 
   _Timestamp_Set_to_zero( &the_thread->cpu_time_used );
diff --git a/cpukit/posix/src/mutexinit.c b/cpukit/posix/src/mutexinit.c
index 0dacc3f..39139a4 100644
--- a/cpukit/posix/src/mutexinit.c
+++ b/cpukit/posix/src/mutexinit.c
@@ -110,7 +110,7 @@ int pthread_mutex_init(
     int  prio_ceiling;
     bool valid;
 
-    scheduler = _Scheduler_Get_own( _Thread_Get_executing() );
+    scheduler = _Thread_Scheduler_get_home( _Thread_Get_executing() );
     prio_ceiling = the_attr->prio_ceiling;
 
     if ( prio_ceiling == INT_MAX ) {
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 9cd730b..6a39e3e 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -168,7 +168,7 @@ static bool _POSIX_Threads_Create_extension(
   api->thread = created;
   _POSIX_Threads_Initialize_attributes( &api->Attributes );
   api->Attributes.schedparam.sched_priority = _POSIX_Priority_From_core(
-    _Scheduler_Get_own( created ),
+    _Thread_Scheduler_get_home( created ),
     _Thread_Get_priority( created )
   );
 
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index f1983ac..a04ac00 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -151,7 +151,7 @@ int pthread_create(
 
   normal_prio = schedparam.sched_priority;
 
-  scheduler = _Scheduler_Get_own( executing );
+  scheduler = _Thread_Scheduler_get_home( executing );
 
   core_normal_prio = _POSIX_Priority_To_core( scheduler, normal_prio, &valid );
   if ( !valid ) {
diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c
index 1d4812c..88cd5fd 100644
--- a/cpukit/posix/src/pthreadgetschedparam.c
+++ b/cpukit/posix/src/pthreadgetschedparam.c
@@ -58,7 +58,7 @@ int pthread_getschedparam(
   *policy = api->Attributes.schedpolicy;
   *param  = api->Attributes.schedparam;
 
-  scheduler = _Scheduler_Get_own( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   priority = the_thread->Real_priority.priority;
 
   _Thread_Wait_release( the_thread, &queue_context );
diff --git a/cpukit/posix/src/pthreadsetschedparam.c b/cpukit/posix/src/pthreadsetschedparam.c
index 9aa2122..14ea1cd 100644
--- a/cpukit/posix/src/pthreadsetschedparam.c
+++ b/cpukit/posix/src/pthreadsetschedparam.c
@@ -55,7 +55,7 @@ static int _POSIX_Set_sched_param(
     high_prio = low_prio;
   }
 
-  scheduler = _Scheduler_Get_own( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
 
   core_normal_prio = _POSIX_Priority_To_core( scheduler, low_prio, &valid );
   if ( !valid ) {
diff --git a/cpukit/posix/src/pthreadsetschedprio.c b/cpukit/posix/src/pthreadsetschedprio.c
index e3d9de0..16b6f3f 100644
--- a/cpukit/posix/src/pthreadsetschedprio.c
+++ b/cpukit/posix/src/pthreadsetschedprio.c
@@ -36,7 +36,7 @@ int pthread_setschedprio( pthread_t thread, int prio )
   _Thread_queue_Context_clear_priority_updates( &queue_context );
   _Thread_Wait_acquire_critical( the_thread, &queue_context );
 
-  scheduler = _Scheduler_Get_own( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
 
   new_priority = _POSIX_Priority_To_core( scheduler, prio, &valid );
   if ( !valid ) {
diff --git a/cpukit/posix/src/sched_getprioritymax.c b/cpukit/posix/src/sched_getprioritymax.c
index 5903f25..d882153 100644
--- a/cpukit/posix/src/sched_getprioritymax.c
+++ b/cpukit/posix/src/sched_getprioritymax.c
@@ -43,6 +43,6 @@ int sched_get_priority_max(
       rtems_set_errno_and_return_minus_one( EINVAL );
   }
 
-  scheduler = _Scheduler_Get_own( _Thread_Get_executing() );
+  scheduler = _Thread_Scheduler_get_home( _Thread_Get_executing() );
   return _POSIX_Priority_Get_maximum( scheduler );
 }
diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c
index 77ecdd7..c38e69f 100644
--- a/cpukit/rtems/src/semcreate.c
+++ b/cpukit/rtems/src/semcreate.c
@@ -157,7 +157,7 @@ rtems_status_code rtems_semaphore_create(
       status = STATUS_SUCCESSFUL;
       break;
     case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
-      scheduler = _Scheduler_Get_own( executing );
+      scheduler = _Thread_Scheduler_get_home( executing );
       priority = _RTEMS_Priority_To_core( scheduler, priority_ceiling, &valid );
 
       if ( valid ) {
@@ -195,7 +195,7 @@ rtems_status_code rtems_semaphore_create(
       break;
 #if defined(RTEMS_SMP)
     case SEMAPHORE_VARIANT_MRSP:
-      scheduler = _Scheduler_Get_own( executing );
+      scheduler = _Thread_Scheduler_get_home( executing );
       priority = _RTEMS_Priority_To_core( scheduler, priority_ceiling, &valid );
 
       if ( valid ) {
diff --git a/cpukit/rtems/src/taskgetscheduler.c b/cpukit/rtems/src/taskgetscheduler.c
index 869e0f5..e874c30 100644
--- a/cpukit/rtems/src/taskgetscheduler.c
+++ b/cpukit/rtems/src/taskgetscheduler.c
@@ -46,7 +46,7 @@ rtems_status_code rtems_task_get_scheduler(
 
   _Thread_State_acquire_critical( the_thread, &lock_context );
 
-  scheduler = _Scheduler_Get( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   *scheduler_id = _Scheduler_Build_id( _Scheduler_Get_index( scheduler ) );
 
   _Thread_State_release( the_thread, &lock_context );
diff --git a/cpukit/rtems/src/tasksetpriority.c b/cpukit/rtems/src/tasksetpriority.c
index 6b8ab4e..8f0ce31 100644
--- a/cpukit/rtems/src/tasksetpriority.c
+++ b/cpukit/rtems/src/tasksetpriority.c
@@ -90,7 +90,7 @@ rtems_status_code rtems_task_set_priority(
 
   _Thread_Wait_acquire_critical( the_thread, &queue_context );
 
-  scheduler = _Scheduler_Get_own( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   old_priority = _Thread_Get_priority( the_thread );
 
   if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h
index 5078c26..bbe2f07 100644
--- a/cpukit/score/include/rtems/score/coremuteximpl.h
+++ b/cpukit/score/include/rtems/score/coremuteximpl.h
@@ -332,7 +332,7 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Seize(
   if ( owner == NULL ) {
 #if defined(RTEMS_SMP)
     if (
-      _Scheduler_Get_own( executing )
+      _Thread_Scheduler_get_home( executing )
         != _CORE_ceiling_mutex_Get_scheduler( the_mutex )
     ) {
       _CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context );
diff --git a/cpukit/score/include/rtems/score/mrspimpl.h b/cpukit/score/include/rtems/score/mrspimpl.h
index 9555197..96d88ad 100644
--- a/cpukit/score/include/rtems/score/mrspimpl.h
+++ b/cpukit/score/include/rtems/score/mrspimpl.h
@@ -105,7 +105,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Raise_priority(
   _Thread_queue_Context_clear_priority_updates( queue_context );
   _Thread_Wait_acquire_default_critical( thread, &lock_context );
 
-  scheduler = _Scheduler_Get_own( thread );
+  scheduler = _Thread_Scheduler_get_home( thread );
   scheduler_node = _Thread_Scheduler_get_home_node( thread );
   ceiling_priority = _MRSP_Get_priority( mrsp, scheduler );
 
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index acd5ba2..5ef60e6 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -53,32 +53,6 @@ RTEMS_INLINE_ROUTINE Scheduler_Context *_Scheduler_Get_context(
   return scheduler->context;
 }
 
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get(
-  const Thread_Control *the_thread
-)
-{
-#if defined(RTEMS_SMP)
-  return the_thread->Scheduler.control;
-#else
-  (void) the_thread;
-
-  return &_Scheduler_Table[ 0 ];
-#endif
-}
-
-RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_own(
-  const Thread_Control *the_thread
-)
-{
-#if defined(RTEMS_SMP)
-  return the_thread->Scheduler.own_control;
-#else
-  (void) the_thread;
-
-  return &_Scheduler_Table[ 0 ];
-#endif
-}
-
 RTEMS_INLINE_ROUTINE const Scheduler_Control *_Scheduler_Get_by_CPU_index(
   uint32_t cpu_index
 )
@@ -177,7 +151,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( Thread_Control *the_thread )
   const Scheduler_Control *scheduler;
   ISR_lock_Context         lock_context;
 
-  scheduler = _Scheduler_Get( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   _Scheduler_Acquire_critical( scheduler, &lock_context );
 
   ( *scheduler->Operations.schedule )( scheduler, the_thread );
@@ -246,7 +220,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( Thread_Control *the_thread )
 #else
   const Scheduler_Control *scheduler;
 
-  scheduler = _Scheduler_Get( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   ( *scheduler->Operations.yield )(
     scheduler,
     the_thread,
@@ -308,7 +282,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Block( Thread_Control *the_thread )
 #else
   const Scheduler_Control *scheduler;
 
-  scheduler = _Scheduler_Get( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   ( *scheduler->Operations.block )(
     scheduler,
     the_thread,
@@ -380,7 +354,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( Thread_Control *the_thread )
 #else
   const Scheduler_Control *scheduler;
 
-  scheduler = _Scheduler_Get( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   ( *scheduler->Operations.unblock )(
     scheduler,
     the_thread,
@@ -435,7 +409,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Update_priority( Thread_Control *the_thread
 #else
   const Scheduler_Control *scheduler;
 
-  scheduler = _Scheduler_Get( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   ( *scheduler->Operations.update_priority )(
     scheduler,
     the_thread,
@@ -601,7 +575,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Release_job(
   Thread_queue_Context *queue_context
 )
 {
-  const Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
+  const Scheduler_Control *scheduler = _Thread_Scheduler_get_home( the_thread );
 
   _Thread_queue_Context_clear_priority_updates( queue_context );
   ( *scheduler->Operations.release_job )(
@@ -627,7 +601,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Cancel_job(
   Thread_queue_Context *queue_context
 )
 {
-  const Scheduler_Control *scheduler = _Scheduler_Get( the_thread );
+  const Scheduler_Control *scheduler = _Thread_Scheduler_get_home( the_thread );
 
   _Thread_queue_Context_clear_priority_updates( queue_context );
   ( *scheduler->Operations.cancel_job )(
@@ -1283,7 +1257,7 @@ RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set(
   {
     const Scheduler_Control *old_scheduler;
 
-    old_scheduler = _Scheduler_Get( the_thread );
+    old_scheduler = _Thread_Scheduler_get_home( the_thread );
 
     if ( old_scheduler != new_scheduler ) {
       States_Control current_state;
@@ -1312,8 +1286,7 @@ RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set(
         &new_scheduler_node->Thread.Scheduler_node.Chain
       );
 
-      the_thread->Scheduler.own_control = new_scheduler;
-      the_thread->Scheduler.control = new_scheduler;
+      the_thread->Scheduler.home = new_scheduler;
       _Scheduler_Node_set_priority( new_scheduler_node, priority, false );
 
       if ( _States_Is_ready( current_state ) ) {
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index 37b9788..ff7f13b 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -255,18 +255,9 @@ typedef struct {
   Thread_Scheduler_state state;
 
   /**
-   * @brief The own scheduler control of this thread.
-   *
-   * This field is constant after initialization.
-   */
-  const struct Scheduler_Control *own_control;
-
-  /**
-   * @brief The scheduler control of this thread.
-   *
-   * The scheduler helping protocol may change this field.
+   * @brief The home scheduler control of this thread.
    */
-  const struct Scheduler_Control *control;
+  const struct Scheduler_Control *home;
 
   /**
    * @brief The processor assigned by the current scheduler.
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 5bf4506..c7eef97 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -1005,6 +1005,18 @@ RTEMS_INLINE_ROUTINE void _Thread_Scheduler_cancel_need_for_help(
 }
 #endif
 
+RTEMS_INLINE_ROUTINE const Scheduler_Control *_Thread_Scheduler_get_home(
+  const Thread_Control *the_thread
+)
+{
+#if defined(RTEMS_SMP)
+  return the_thread->Scheduler.home;
+#else
+  (void) the_thread;
+  return &_Scheduler_Table[ 0 ];
+#endif
+}
+
 RTEMS_INLINE_ROUTINE Scheduler_Node *_Thread_Scheduler_get_home_node(
   const Thread_Control *the_thread
 )
diff --git a/cpukit/score/src/sched.c b/cpukit/score/src/sched.c
index e694564..36d3f0c 100644
--- a/cpukit/score/src/sched.c
+++ b/cpukit/score/src/sched.c
@@ -31,7 +31,7 @@ int _Sched_Index( void )
 {
   Thread_Control *executing = _Thread_Get_executing();
 
-  return (int) _Scheduler_Get_index( _Scheduler_Get( executing ) );
+  return (int) _Scheduler_Get_index( _Thread_Scheduler_get_home( executing ) );
 }
 
 int _Sched_Name_to_index( const char *name, size_t len )
diff --git a/cpukit/score/src/schedulergetaffinity.c b/cpukit/score/src/schedulergetaffinity.c
index c910a75..8489957 100644
--- a/cpukit/score/src/schedulergetaffinity.c
+++ b/cpukit/score/src/schedulergetaffinity.c
@@ -34,7 +34,7 @@ bool _Scheduler_Get_affinity(
     return false;
   }
 
-  scheduler = _Scheduler_Get( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   _Scheduler_Acquire_critical( scheduler, &lock_context );
 
 #if defined(RTEMS_SMP)
diff --git a/cpukit/score/src/schedulersetaffinity.c b/cpukit/score/src/schedulersetaffinity.c
index b59d8eb..6635ffa 100644
--- a/cpukit/score/src/schedulersetaffinity.c
+++ b/cpukit/score/src/schedulersetaffinity.c
@@ -34,7 +34,7 @@ bool _Scheduler_Set_affinity(
     return false;
   }
 
-  scheduler = _Scheduler_Get( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   _Scheduler_Acquire_critical( scheduler, &lock_context );
 
 #if defined(RTEMS_SMP)
diff --git a/cpukit/score/src/threadgetcputimeused.c b/cpukit/score/src/threadgetcputimeused.c
index 9026007..7b5b73b 100644
--- a/cpukit/score/src/threadgetcputimeused.c
+++ b/cpukit/score/src/threadgetcputimeused.c
@@ -38,7 +38,7 @@ void _Thread_Get_CPU_time_used(
   ISR_lock_Context         scheduler_lock_context;
 
   _Thread_State_acquire( the_thread, &state_lock_context );
-  scheduler = _Scheduler_Get( the_thread );
+  scheduler = _Thread_Scheduler_get_home( the_thread );
   _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
 
   if ( _Thread_Is_scheduled( the_thread ) ) {
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index d34cb34..16c225e 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -232,8 +232,7 @@ bool _Thread_Initialize(
 
 #if defined(RTEMS_SMP)
   RTEMS_STATIC_ASSERT( THREAD_SCHEDULER_BLOCKED == 0, Scheduler_state );
-  the_thread->Scheduler.own_control = scheduler;
-  the_thread->Scheduler.control = scheduler;
+  the_thread->Scheduler.home = scheduler;
   _ISR_lock_Initialize( &the_thread->Scheduler.Lock, "Thread Scheduler" );
   _ISR_lock_Initialize( &the_thread->Wait.Lock.Default, "Thread Wait Default" );
   _Thread_queue_Gate_open( &the_thread->Wait.Lock.Tranquilizer );
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index 08e3c80..4d9e2c9 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -169,7 +169,7 @@ static void _Thread_Free( Thread_Control *the_thread )
   _User_extensions_Destroy_iterators( the_thread );
   _ISR_lock_Destroy( &the_thread->Keys.Lock );
   _Scheduler_Node_destroy(
-    _Scheduler_Get( the_thread ),
+    _Thread_Scheduler_get_home( the_thread ),
     _Thread_Scheduler_get_home_node( the_thread )
   );
   _ISR_lock_Destroy( &the_thread->Timer.Lock );
diff --git a/testsuites/smptests/smpscheduler03/init.c b/testsuites/smptests/smpscheduler03/init.c
index d9e4862..55c7942 100644
--- a/testsuites/smptests/smpscheduler03/init.c
+++ b/testsuites/smptests/smpscheduler03/init.c
@@ -214,7 +214,7 @@ static void update_priority_op(
   apply_priority(thread, new_priority, prepend_it, &queue_context);
 
   _Thread_State_acquire( thread, &state_lock_context );
-  scheduler = _Scheduler_Get( thread );
+  scheduler = _Thread_Scheduler_get_home( thread );
   _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
 
   (*scheduler->Operations.update_priority)(
@@ -325,7 +325,7 @@ static Thread_Control *yield_op(
   Thread_Control *needs_help;
 
   _Thread_State_acquire( thread, &state_lock_context );
-  scheduler = _Scheduler_Get( thread );
+  scheduler = _Thread_Scheduler_get_home( thread );
   _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
 
   needs_help = (*scheduler->Operations.yield)(
@@ -464,7 +464,7 @@ static void block_op(
   ISR_lock_Context scheduler_lock_context;
 
   _Thread_State_acquire( thread, &state_lock_context );
-  scheduler = _Scheduler_Get( thread );
+  scheduler = _Thread_Scheduler_get_home( thread );
   _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
 
   (*scheduler->Operations.block)(scheduler, thread, &scheduler_node->Base);
@@ -484,7 +484,7 @@ static Thread_Control *unblock_op(
   Thread_Control *needs_help;
 
   _Thread_State_acquire( thread, &state_lock_context );
-  scheduler = _Scheduler_Get( thread );
+  scheduler = _Thread_Scheduler_get_home( thread );
   _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
 
   needs_help = (*scheduler->Operations.unblock)(
diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c
index 0e52d3d..173cf7f 100644
--- a/testsuites/tmtests/tm26/task1.c
+++ b/testsuites/tmtests/tm26/task1.c
@@ -316,7 +316,7 @@ rtems_task Middle_task(
 )
 {
   Scheduler_priority_Context *scheduler_context =
-    _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
+    _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) );
 
   thread_dispatch_no_fp_time = benchmark_timer_read();
 
@@ -349,7 +349,7 @@ rtems_task Low_task(
 )
 {
   Scheduler_priority_Context *scheduler_context =
-    _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
+    _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) );
   Thread_Control             *executing;
 
   context_switch_no_fp_time = benchmark_timer_read();
@@ -389,7 +389,7 @@ rtems_task Floating_point_task_1(
 )
 {
   Scheduler_priority_Context *scheduler_context =
-    _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
+    _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) );
   Thread_Control             *executing;
   FP_DECLARE;
 
@@ -445,7 +445,7 @@ rtems_task Floating_point_task_2(
 )
 {
   Scheduler_priority_Context *scheduler_context =
-    _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
+    _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) );
   Thread_Control             *executing;
   FP_DECLARE;
 
diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c
index aba835c..9126391 100644
--- a/testsuites/tmtests/tm27/task1.c
+++ b/testsuites/tmtests/tm27/task1.c
@@ -107,7 +107,7 @@ rtems_task Task_1(
 )
 {
   Scheduler_priority_Context *scheduler_context =
-    _Scheduler_priority_Get_context( _Scheduler_Get( _Thread_Get_executing() ) );
+    _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) );
 #if defined(RTEMS_SMP)
   rtems_interrupt_level level;
 #endif
@@ -231,7 +231,7 @@ rtems_task Task_2(
   ISR_lock_Context scheduler_lock_context;
 
   _Thread_State_acquire( executing, &state_lock_context );
-  scheduler = _Scheduler_Get( executing );
+  scheduler = _Thread_Scheduler_get_home( executing );
   scheduler_context = _Scheduler_priority_Get_context( scheduler );
   _Thread_State_release( executing, &state_lock_context );
 



More information about the vc mailing list