From 7f7424329eafab755381bc638c2cdddc152a909b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 31 Oct 2016 08:22:02 +0100 Subject: score: Delete Thread_Scheduler_control::own_node Update #2556. --- cpukit/score/include/rtems/score/coremuteximpl.h | 6 +++--- cpukit/score/include/rtems/score/mrspimpl.h | 9 ++++++--- cpukit/score/include/rtems/score/schedulerimpl.h | 5 ++--- cpukit/score/include/rtems/score/schedulersmpimpl.h | 2 +- cpukit/score/include/rtems/score/thread.h | 8 -------- cpukit/score/include/rtems/score/threadimpl.h | 13 +------------ 6 files changed, 13 insertions(+), 30 deletions(-) (limited to 'cpukit/score/include/rtems/score') diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h index 2580606a9a..5078c26c0a 100644 --- a/cpukit/score/include/rtems/score/coremuteximpl.h +++ b/cpukit/score/include/rtems/score/coremuteximpl.h @@ -280,16 +280,16 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_ceiling_mutex_Set_owner( ) { ISR_lock_Context lock_context; - Scheduler_Node *own_node; + Scheduler_Node *scheduler_node; Per_CPU_Control *cpu_self; _Thread_queue_Context_clear_priority_updates( queue_context ); _Thread_Wait_acquire_default_critical( owner, &lock_context ); - own_node = _Thread_Scheduler_get_own_node( owner ); + scheduler_node = _Thread_Scheduler_get_home_node( owner ); if ( - own_node->Wait.Priority.Node.priority + _Priority_Get_priority( &scheduler_node->Wait.Priority ) < the_mutex->Priority_ceiling.priority ) { _Thread_Wait_release_default_critical( owner, &lock_context ); diff --git a/cpukit/score/include/rtems/score/mrspimpl.h b/cpukit/score/include/rtems/score/mrspimpl.h index 4b4e8c3c67..9555197672 100644 --- a/cpukit/score/include/rtems/score/mrspimpl.h +++ b/cpukit/score/include/rtems/score/mrspimpl.h @@ -100,16 +100,19 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Raise_priority( ISR_lock_Context lock_context; const Scheduler_Control *scheduler; Priority_Control ceiling_priority; - Scheduler_Node *own_node; + Scheduler_Node *scheduler_node; _Thread_queue_Context_clear_priority_updates( queue_context ); _Thread_Wait_acquire_default_critical( thread, &lock_context ); scheduler = _Scheduler_Get_own( thread ); - own_node = _Thread_Scheduler_get_own_node( thread ); + scheduler_node = _Thread_Scheduler_get_home_node( thread ); ceiling_priority = _MRSP_Get_priority( mrsp, scheduler ); - if ( ceiling_priority <= own_node->Wait.Priority.Node.priority ) { + if ( + ceiling_priority + <= _Priority_Get_priority( &scheduler_node->Wait.Priority ) + ) { _Priority_Node_initialize( priority_node, ceiling_priority ); _Thread_Priority_add( thread, priority_node, queue_context ); status = STATUS_SUCCESSFUL; diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h index aaa28e0129..acd5ba28f5 100644 --- a/cpukit/score/include/rtems/score/schedulerimpl.h +++ b/cpukit/score/include/rtems/score/schedulerimpl.h @@ -893,7 +893,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Thread_set_priority( { Scheduler_Node *scheduler_node; - scheduler_node = _Thread_Scheduler_get_own_node( the_thread ); + scheduler_node = _Thread_Scheduler_get_home_node( the_thread ); _Scheduler_Node_set_priority( scheduler_node, new_priority, prepend_it ); } @@ -1247,7 +1247,7 @@ RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set( return STATUS_RESOURCE_IN_USE; } - old_scheduler_node = _Thread_Scheduler_get_own_node( the_thread ); + old_scheduler_node = _Thread_Scheduler_get_home_node( the_thread ); _Priority_Plain_extract( &old_scheduler_node->Wait.Priority, &the_thread->Real_priority @@ -1314,7 +1314,6 @@ RTEMS_INLINE_ROUTINE Status_Control _Scheduler_Set( the_thread->Scheduler.own_control = new_scheduler; the_thread->Scheduler.control = new_scheduler; - the_thread->Scheduler.own_node = new_scheduler_node; _Scheduler_Node_set_priority( new_scheduler_node, priority, false ); if ( _States_Is_ready( current_state ) ) { diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h index bfd7650bea..992668403d 100644 --- a/cpukit/score/include/rtems/score/schedulersmpimpl.h +++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h @@ -383,7 +383,7 @@ static inline Scheduler_SMP_Node *_Scheduler_SMP_Thread_get_own_node( Thread_Control *thread ) { - return (Scheduler_SMP_Node *) _Thread_Scheduler_get_own_node( thread ); + return (Scheduler_SMP_Node *) _Thread_Scheduler_get_home_node( thread ); } static inline Scheduler_SMP_Node *_Scheduler_SMP_Node_downcast( diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 76cc333782..37b978818e 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -268,14 +268,6 @@ typedef struct { */ const struct Scheduler_Control *control; - /** - * @brief The own scheduler node of this thread. - * - * This field is constant after initialization. It is used by change - * priority and ask for help operations. - */ - Scheduler_Node *own_node; - /** * @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 00402b642b..5bf45067c1 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -1005,17 +1005,6 @@ RTEMS_INLINE_ROUTINE void _Thread_Scheduler_cancel_need_for_help( } #endif -RTEMS_INLINE_ROUTINE Scheduler_Node *_Thread_Scheduler_get_own_node( - const Thread_Control *the_thread -) -{ -#if defined(RTEMS_SMP) - return the_thread->Scheduler.own_node; -#else - return the_thread->Scheduler.nodes; -#endif -} - RTEMS_INLINE_ROUTINE Scheduler_Node *_Thread_Scheduler_get_home_node( const Thread_Control *the_thread ) @@ -1150,7 +1139,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_priority( { Scheduler_Node *scheduler_node; - scheduler_node = _Thread_Scheduler_get_own_node( the_thread ); + scheduler_node = _Thread_Scheduler_get_home_node( the_thread ); return _Priority_Get_priority( &scheduler_node->Wait.Priority ); } -- cgit v1.2.3