From 6eba7c857b9e72bc4ed8e55f0c9538c45631484f Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 10 Jun 2013 16:15:46 +0200 Subject: scheduler: Specify thread of yield operation The yielding thread of the yield operation is now specified by a parameter. The tick operation may be performed for each executing thread in a SMP configuration. --- cpukit/score/include/rtems/score/scheduler.h | 8 ++++++-- cpukit/score/include/rtems/score/scheduleredf.h | 8 +++++--- cpukit/score/include/rtems/score/schedulerpriority.h | 8 +++++--- cpukit/score/include/rtems/score/schedulersimple.h | 8 +++++--- 4 files changed, 21 insertions(+), 11 deletions(-) (limited to 'cpukit/score/include') diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h index 9e08b23e4f..aa40e9ba9f 100644 --- a/cpukit/score/include/rtems/score/scheduler.h +++ b/cpukit/score/include/rtems/score/scheduler.h @@ -49,8 +49,12 @@ typedef struct { /** Implements the scheduling decision logic (policy). */ void ( *schedule )(void); - /** Voluntarily yields the processor per the scheduling policy. */ - void ( *yield )(void); + /** + * @brief Voluntarily yields the processor per the scheduling policy. + * + * @see _Scheduler_Yield(). + */ + void ( *yield )( Thread_Control *thread ); /** Removes the given thread from scheduling decisions. */ void ( *block )(Thread_Control *); diff --git a/cpukit/score/include/rtems/score/scheduleredf.h b/cpukit/score/include/rtems/score/scheduleredf.h index e84b3f5909..7846067a7d 100644 --- a/cpukit/score/include/rtems/score/scheduleredf.h +++ b/cpukit/score/include/rtems/score/scheduleredf.h @@ -189,11 +189,13 @@ void _Scheduler_EDF_Unblock( * 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 running THREAD from the ready queue - * and place back. The rbtree ready queue is responsible for FIFO ordering + * 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/out] thread The yielding thread. */ -void _Scheduler_EDF_Yield( void ); +void _Scheduler_EDF_Yield( Thread_Control *thread ); /** * @brief Put @a the_thread to the rbtree ready queue. diff --git a/cpukit/score/include/rtems/score/schedulerpriority.h b/cpukit/score/include/rtems/score/schedulerpriority.h index 81c3582e76..f0582c1315 100644 --- a/cpukit/score/include/rtems/score/schedulerpriority.h +++ b/cpukit/score/include/rtems/score/schedulerpriority.h @@ -145,12 +145,12 @@ void _Scheduler_priority_Unblock( ); /** - * @brief Remove the running THREAD to the rear of this chain. + * @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 running THREAD from the ready 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 @@ -160,8 +160,10 @@ void _Scheduler_priority_Unblock( * - INTERRUPT LATENCY: * + ready chain * + select heir + * + * @param[in/out] thread The yielding thread. */ -void _Scheduler_priority_Yield( void ); +void _Scheduler_priority_Yield( Thread_Control *thread ); /** * @brief Puts @a the_thread on to the priority-based ready queue. diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h index 6682074b7c..47b74befbe 100644 --- a/cpukit/score/include/rtems/score/schedulersimple.h +++ b/cpukit/score/include/rtems/score/schedulersimple.h @@ -74,15 +74,17 @@ void _Scheduler_simple_Schedule( void ); * * 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 running THREAD from the scheduler.informaiton + * 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. -*/ -void _Scheduler_simple_Yield( void ); + * + * @param[in/out] thread The yielding thread. + */ +void _Scheduler_simple_Yield( Thread_Control *thread ); /** * @brief Remove a simple-priority-based thread from the queue. -- cgit v1.2.3