From 010192dd9fcfe40b82ca7595a732ed3ffbe9fdc1 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 17 Feb 2011 22:21:44 +0000 Subject: 2011-02-17 Joel Sherrill * sapi/include/confdefs.h, sapi/include/rtems/config.h, score/include/rtems/score/scheduler.h, score/include/rtems/score/schedulerpriority.h, score/inline/rtems/score/scheduler.inl, score/inline/rtems/score/schedulerpriority.inl, score/src/scheduler.c, score/src/schedulerpriority.c, score/src/schedulerpriorityblock.c, score/src/schedulerpriorityschedule.c, score/src/schedulerprioritythreadschedulerallocate.c, score/src/schedulerprioritythreadschedulerfree.c, score/src/schedulerprioritythreadschedulerupdate.c, score/src/schedulerpriorityunblock.c, score/src/schedulerpriorityyield.c, score/src/threadchangepriority.c, score/src/threadclearstate.c, score/src/threadclose.c, score/src/threadinitialize.c, score/src/threadready.c, score/src/threadresume.c, score/src/threadsetpriority.c, score/src/threadsetstate.c, score/src/threadsuspend.c: Simplify the pluggable scheduler interface. Its configuration made a table of available schedulers and set a pointer to one of the. This was heavy handed since you can only use one scheduler in an application. This configuration mechanism resulted in a scheduler pointer being passed around when you could put all scheduler configuration in an initialized structure. --- cpukit/score/inline/rtems/score/scheduler.inl | 31 +++++++++++---------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'cpukit/score/inline/rtems/score/scheduler.inl') diff --git a/cpukit/score/inline/rtems/score/scheduler.inl b/cpukit/score/inline/rtems/score/scheduler.inl index 81290eb84a..813365fcf9 100644 --- a/cpukit/score/inline/rtems/score/scheduler.inl +++ b/cpukit/score/inline/rtems/score/scheduler.inl @@ -7,6 +7,7 @@ /* * Copyright (C) 2010 Gedare Bloom. + * Copyright (C) 2011 On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -45,13 +46,11 @@ /** @brief _Scheduler_Schedule * * This kernel routine implements the scheduling decision logic for - * @a the_scheduler. It does NOT dispatch. + * the scheduler. It does NOT dispatch. */ -RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( - Scheduler_Control *the_scheduler -) +RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { - the_scheduler->Operations.schedule( the_scheduler ); + _Scheduler.Operations.schedule(); } /** @brief _Scheduler_Yield @@ -63,37 +62,35 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { - _Scheduler.Operations.yield( &_Scheduler ); + _Scheduler.Operations.yield(); } /** @brief _Scheduler_Block * * This routine removes @a the_thread from the scheduling decision for - * @a the_scheduler. The primary task is to remove the thread from the + * the scheduler. The primary task is to remove the thread from the * ready queue. It performs any necessary schedulering operations * including the selection of a new heir thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Block( - Scheduler_Control *the_scheduler, Thread_Control *the_thread ) { - the_scheduler->Operations.block( the_scheduler, the_thread ); + _Scheduler.Operations.block( the_thread ); } /** @brief _Scheduler_Unblock * * This routine adds @a the_thread to the scheduling decision for - * @a the_scheduler. The primary task is to add the thread to the + * the scheduler. The primary task is to add the thread to the * ready queue per the schedulering policy and update any appropriate * scheduling variables, for example the heir thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( - Scheduler_Control *the_scheduler, Thread_Control *the_thread ) { - the_scheduler->Operations.unblock( the_scheduler, the_thread ); + _Scheduler.Operations.unblock( the_thread ); } /** @brief _Scheduler_Thread_scheduler_allocate @@ -101,12 +98,10 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( * This routine allocates @a the_thread->scheduler */ RTEMS_INLINE_ROUTINE void* _Scheduler_Thread_scheduler_allocate( - Scheduler_Control *the_scheduler, Thread_Control *the_thread ) { - return - the_scheduler->Operations.scheduler_allocate( the_scheduler, the_thread ); + return _Scheduler.Operations.scheduler_allocate( the_thread ); } /** @brief _Scheduler_Thread_scheduler_free @@ -114,11 +109,10 @@ RTEMS_INLINE_ROUTINE void* _Scheduler_Thread_scheduler_allocate( * This routine frees @a the_thread->scheduler */ RTEMS_INLINE_ROUTINE void _Scheduler_Thread_scheduler_free( - Scheduler_Control *the_scheduler, Thread_Control *the_thread ) { - return the_scheduler->Operations.scheduler_free( the_scheduler, the_thread ); + return _Scheduler.Operations.scheduler_free( the_thread ); } /** @brief _Scheduler_Thread_scheduler_update @@ -126,11 +120,10 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Thread_scheduler_free( * This routine updates @a the_thread->scheduler */ RTEMS_INLINE_ROUTINE void _Scheduler_Thread_scheduler_update( - Scheduler_Control *the_scheduler, Thread_Control *the_thread ) { - the_scheduler->Operations.scheduler_update( the_scheduler, the_thread ); + _Scheduler.Operations.scheduler_update( the_thread ); } /**@}*/ -- cgit v1.2.3