diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-10-10 14:01:55 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-02 10:05:40 +0100 |
commit | 2df4abcee2fd762a9688bef13e152d5b81cc763e (patch) | |
tree | 840277642e69e77c326aec7a4ff6322591cb1467 /cpukit/score/include/rtems | |
parent | score: Pass scheduler node to update priority op (diff) | |
download | rtems-2df4abcee2fd762a9688bef13e152d5b81cc763e.tar.bz2 |
score: Pass scheduler node to yield operation
Changed for consistency with other scheduler operations.
Update #2556.
Diffstat (limited to 'cpukit/score/include/rtems')
9 files changed, 25 insertions, 67 deletions
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h index 0fc7d5a880..745fbec621 100644 --- a/cpukit/score/include/rtems/score/scheduler.h +++ b/cpukit/score/include/rtems/score/scheduler.h @@ -65,7 +65,8 @@ typedef struct { /** @see _Scheduler_Yield() */ Scheduler_Void_or_thread ( *yield )( const Scheduler_Control *, - Thread_Control * + Thread_Control *, + Scheduler_Node * ); /** @see _Scheduler_Block() */ diff --git a/cpukit/score/include/rtems/score/scheduleredf.h b/cpukit/score/include/rtems/score/scheduleredf.h index 0ae33cf359..005f2da5f0 100644 --- a/cpukit/score/include/rtems/score/scheduleredf.h +++ b/cpukit/score/include/rtems/score/scheduleredf.h @@ -185,25 +185,10 @@ Priority_Control _Scheduler_EDF_Unmap_priority( Priority_Control priority ); -/** - * @brief invoked when a thread wishes to voluntarily - * transfer control of the processor to another thread - * with equal deadline. - * - * This routine is invoked when a thread wishes to voluntarily - * transfer control of the processor to another thread in the queue with - * equal deadline. This does not have to happen very often. - * - * This routine will remove the specified THREAD from the ready queue - * and place it back. The rbtree ready queue is responsible for FIFO ordering - * in such a case. - * - * @param[in] scheduler The scheduler instance. - * @param[in,out] the_thread The yielding thread. - */ Scheduler_Void_or_thread _Scheduler_EDF_Yield( const Scheduler_Control *scheduler, - Thread_Control *the_thread + Thread_Control *the_thread, + Scheduler_Node *node ); void _Scheduler_EDF_Release_job( diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h index 211b7a7fd9..a431a3af08 100644 --- a/cpukit/score/include/rtems/score/schedulerimpl.h +++ b/cpukit/score/include/rtems/score/schedulerimpl.h @@ -299,7 +299,11 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( Thread_Control *the_thread ) #if defined(RTEMS_SMP) needs_help = #endif - ( *scheduler->Operations.yield )( scheduler, the_thread ); + ( *scheduler->Operations.yield )( + scheduler, + the_thread, + _Thread_Scheduler_get_home_node( the_thread ) + ); #if defined(RTEMS_SMP) _Scheduler_Ask_for_help_if_necessary( needs_help ); diff --git a/cpukit/score/include/rtems/score/schedulerpriority.h b/cpukit/score/include/rtems/score/schedulerpriority.h index 4c9c698830..175def49a3 100644 --- a/cpukit/score/include/rtems/score/schedulerpriority.h +++ b/cpukit/score/include/rtems/score/schedulerpriority.h @@ -166,29 +166,10 @@ void _Scheduler_priority_Node_initialize( Priority_Control priority ); -/** - * @brief The specified THREAD yields. - * - * This routine is invoked when a thread wishes to voluntarily - * transfer control of the processor to another thread in the queue. - * - * This routine will remove the specified THREAD from the ready queue - * and place it immediately at the rear of this chain. Reset timeslice - * and yield the processor functions both use this routine, therefore if - * reset is true and this is the only thread on the queue then the - * timeslice counter is reset. The heir THREAD will be updated if the - * running is also the currently the heir. - * - * - INTERRUPT LATENCY: - * + ready chain - * + select heir - * - * @param[in] scheduler The scheduler instance. - * @param[in,out] the_thread The yielding thread. - */ Scheduler_Void_or_thread _Scheduler_priority_Yield( const Scheduler_Control *scheduler, - Thread_Control *the_thread + Thread_Control *the_thread, + Scheduler_Node *node ); /**@}*/ diff --git a/cpukit/score/include/rtems/score/schedulerprioritysmp.h b/cpukit/score/include/rtems/score/schedulerprioritysmp.h index afde45b82d..8350038d1c 100644 --- a/cpukit/score/include/rtems/score/schedulerprioritysmp.h +++ b/cpukit/score/include/rtems/score/schedulerprioritysmp.h @@ -129,7 +129,8 @@ Thread_Control *_Scheduler_priority_SMP_Ask_for_help_X( Thread_Control *_Scheduler_priority_SMP_Yield( const Scheduler_Control *scheduler, - Thread_Control *thread + Thread_Control *thread, + Scheduler_Node *node ); /** @} */ diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h index 5d610691a6..d8bc02ed0d 100644 --- a/cpukit/score/include/rtems/score/schedulersimple.h +++ b/cpukit/score/include/rtems/score/schedulersimple.h @@ -92,26 +92,10 @@ void _Scheduler_simple_Schedule( Thread_Control *the_thread ); -/** - * @brief Invoked when a thread wishes to voluntarily - * transfer control of the processor to another thread in the queue. - * - * This routine is invoked when a thread wishes to voluntarily - * transfer control of the processor to another thread in the queue. - * It will remove the specified THREAD from the scheduler.informaiton - * (where the ready queue is stored) and place it immediately at the - * between the last entry of its priority and the next priority thread. - * Reset timeslice and yield the processor functions both use this routine, - * therefore if reset is true and this is the only thread on the queue then - * the timeslice counter is reset. The heir THREAD will be updated if the - * running is also the currently the heir. - * - * @param[in] scheduler The scheduler instance. - * @param[in,out] the_thread The yielding thread. - */ Scheduler_Void_or_thread _Scheduler_simple_Yield( const Scheduler_Control *scheduler, - Thread_Control *the_thread + Thread_Control *the_thread, + Scheduler_Node *node ); /** diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h index 42734455b1..36f5fb38c7 100644 --- a/cpukit/score/include/rtems/score/schedulersimplesmp.h +++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h @@ -112,7 +112,8 @@ Thread_Control *_Scheduler_simple_SMP_Ask_for_help_X( Thread_Control *_Scheduler_simple_SMP_Yield( const Scheduler_Control *scheduler, - Thread_Control *thread + Thread_Control *thread, + Scheduler_Node *node ); /** @} */ diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h index cec0357f32..6deb160405 100644 --- a/cpukit/score/include/rtems/score/schedulersmpimpl.h +++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h @@ -1084,22 +1084,22 @@ static inline Thread_Control *_Scheduler_SMP_Ask_for_help_X( static inline Thread_Control *_Scheduler_SMP_Yield( Scheduler_Context *context, Thread_Control *thread, + Scheduler_Node *node, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Enqueue enqueue_fifo, Scheduler_SMP_Enqueue_scheduled enqueue_scheduled_fifo ) { - Scheduler_SMP_Node *node = _Scheduler_SMP_Thread_get_node( thread ); Thread_Control *needs_help; - if ( node->state == SCHEDULER_SMP_NODE_SCHEDULED ) { - _Scheduler_SMP_Extract_from_scheduled( &node->Base ); + if ( _Scheduler_SMP_Node_state( node ) == SCHEDULER_SMP_NODE_SCHEDULED ) { + _Scheduler_SMP_Extract_from_scheduled( node ); - needs_help = ( *enqueue_scheduled_fifo )( context, &node->Base ); + needs_help = ( *enqueue_scheduled_fifo )( context, node ); } else { - ( *extract_from_ready )( context, &node->Base ); + ( *extract_from_ready )( context, node ); - needs_help = ( *enqueue_fifo )( context, &node->Base, NULL ); + needs_help = ( *enqueue_fifo )( context, node, NULL ); } return needs_help; diff --git a/cpukit/score/include/rtems/score/schedulerstrongapa.h b/cpukit/score/include/rtems/score/schedulerstrongapa.h index 35d3eddee2..aa352e2964 100644 --- a/cpukit/score/include/rtems/score/schedulerstrongapa.h +++ b/cpukit/score/include/rtems/score/schedulerstrongapa.h @@ -129,7 +129,8 @@ Thread_Control *_Scheduler_strong_APA_Ask_for_help_X( Thread_Control *_Scheduler_strong_APA_Yield( const Scheduler_Control *scheduler, - Thread_Control *the_thread + Thread_Control *the_thread, + Scheduler_Node *node ); /** @} */ |