From 108c4b085ccf88e9644fccbf5cec1b79c39e67e4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 18 Feb 2011 15:12:44 +0000 Subject: 2011-02-18 Joel Sherrill * sapi/include/confdefs.h, score/Makefile.am, score/include/rtems/score/scheduler.h, score/include/rtems/score/schedulerpriority.h, score/include/rtems/score/thread.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/schedulerpriorityunblock.c, score/src/schedulerpriorityyield.c, score/src/threadchangepriority.c, score/src/threadclose.c, score/src/threadinitialize.c, score/src/threadsetpriority.c, score/src/threadsettransient.c: Significant clean up on Scheduler Plugin Interface. Names were shortened. Missing operations added. Many scheduler files had unneeded includes removed. Made pointer to scheduler information in Thread_Control and Scheduler_Control a void * pointer because the thread and scheduler wrapper should be unaware of scheduler types AND this is broken for user provided schedulers. * score/src/schedulerpriorityallocate.c, score/src/schedulerpriorityenqueue.c, score/src/schedulerpriorityenqueuefirst.c, score/src/schedulerpriorityextract.c, score/src/schedulerpriorityfree.c, score/src/schedulerpriorityupdate.c: New files. * score/src/schedulerprioritythreadschedulerallocate.c, score/src/schedulerprioritythreadschedulerfree.c, score/src/schedulerprioritythreadschedulerupdate.c: Removed. --- cpukit/score/include/rtems/score/scheduler.h | 63 ++++++++-------------------- 1 file changed, 18 insertions(+), 45 deletions(-) (limited to 'cpukit/score/include/rtems/score/scheduler.h') diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h index 2ca6c4a0fe..c094b9400a 100644 --- a/cpukit/score/include/rtems/score/scheduler.h +++ b/cpukit/score/include/rtems/score/scheduler.h @@ -36,35 +36,6 @@ extern "C" { */ /**@{*/ -typedef struct Scheduler_Control_struct Scheduler_Control; - -/* - * This type defines the scheduler initialization table entry, which is set up - * by confdefs.h based on the user's choice of scheduler policy. - */ -typedef struct { - void ( *scheduler_init )( Scheduler_Control * ); -} Scheduler_Table_entry; - -/** - * The following Scheduler_Per_thread_xxx structures are used to - * hold per-thread data used by the scheduler. Thread_Control->scheduler is a - * union of pointers, one for each of the following structures. The - * scheduler->xxx field points to an instantion of one of these structures, - * which is allocated from the workspace during _Thread_Start. - */ - -/** - * Per-thread data related to the _Scheduler_PRIORITY scheduling policy. - */ -typedef struct { - /** This field points to the Ready FIFO for this thread's priority. */ - Chain_Control *ready_chain; - - /** This field contains precalculated priority map indices. */ - Priority_bit_map_Information Priority_map; -} Scheduler_priority_Per_thread; - /** * function jump table that holds pointers to the functions that * implement specific schedulers. @@ -86,37 +57,39 @@ typedef struct { void ( *unblock )(Thread_Control *); /** allocates the scheduler field of the given thread */ - void * ( *scheduler_allocate )(Thread_Control *); + void * ( *allocate )(Thread_Control *); /** frees the scheduler field of the given thread */ - void ( *scheduler_free )(Thread_Control *); + void ( *free )(Thread_Control *); /** updates the scheduler field of the given thread -- primarily used * when changing the thread's priority. */ - void ( *scheduler_update )(Thread_Control *); + void ( *update )(Thread_Control *); + + /** enqueue a thread as the last of its priority group */ + void ( *enqueue )(Thread_Control *); + + /** enqueue a thread as the first of its priority group */ + void ( *enqueue_first )(Thread_Control *); + + /** extract a thread from the ready set */ + void ( *extract )(Thread_Control *); } Scheduler_Operations; /** * This is the structure used to manage the scheduler. */ -struct Scheduler_Control_struct { +typedef struct { /** - * This union contains the pointer to the data structure used to manage - * the ready set of tasks. The pointer varies based upon the type of + * This points to the data structure used to manage the ready set of + * tasks. The pointer varies based upon the type of * ready queue required by the scheduler. */ - union { - /** - * This is the set of lists (an array of Chain_Control) for - * priority scheduling. - */ - Chain_Control *priority; - - } Ready_queues; + void *information; /** The jump table for scheduler-specific functions */ - Scheduler_Operations Operations; -}; + Scheduler_Operations Operations; +} Scheduler_Control; /** * The _Scheduler holds the structures used to manage the -- cgit v1.2.3