summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/schedulerpriority.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-02-18 15:12:44 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-02-18 15:12:44 +0000
commit108c4b085ccf88e9644fccbf5cec1b79c39e67e4 (patch)
treedf0df1d699d02955750d1691e75ef26fe0c8e1b1 /cpukit/score/include/rtems/score/schedulerpriority.h
parent2011-02-17 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-108c4b085ccf88e9644fccbf5cec1b79c39e67e4.tar.bz2
2011-02-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* 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.
Diffstat (limited to 'cpukit/score/include/rtems/score/schedulerpriority.h')
-rw-r--r--cpukit/score/include/rtems/score/schedulerpriority.h89
1 files changed, 72 insertions, 17 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerpriority.h b/cpukit/score/include/rtems/score/schedulerpriority.h
index 162cb7011a..767e8425d5 100644
--- a/cpukit/score/include/rtems/score/schedulerpriority.h
+++ b/cpukit/score/include/rtems/score/schedulerpriority.h
@@ -21,9 +21,7 @@
#include <rtems/score/chain.h>
#include <rtems/score/priority.h>
-#include <rtems/score/percpu.h>
#include <rtems/score/scheduler.h>
-#include <rtems/score/wkspace.h>
#ifdef __cplusplus
extern "C" {
@@ -40,17 +38,31 @@ extern "C" {
*/
#define SCHEDULER_PRIORITY_ENTRY_POINTS \
{ \
- .initialize = _Scheduler_priority_Initialize, \
- .schedule = _Scheduler_priority_Schedule, \
- .yield = _Scheduler_priority_Yield, \
- .block = _Scheduler_priority_Block, \
- .unblock = _Scheduler_priority_Unblock, \
- .scheduler_allocate = _Scheduler_priority_Thread_scheduler_allocate, \
- .scheduler_free = _Scheduler_priority_Thread_scheduler_free, \
- .scheduler_update = _Scheduler_priority_Thread_scheduler_update \
+ .initialize = _Scheduler_priority_Initialize, \
+ .schedule = _Scheduler_priority_Schedule, \
+ .yield = _Scheduler_priority_Yield, \
+ .block = _Scheduler_priority_Block, \
+ .unblock = _Scheduler_priority_Unblock, \
+ .allocate = _Scheduler_priority_Allocate, \
+ .free = _Scheduler_priority_Free, \
+ .update = _Scheduler_priority_Update, \
+ .enqueue = _Scheduler_priority_Enqueue, \
+ .enqueue_first = _Scheduler_priority_Enqueue_first, \
+ .extract = _Scheduler_priority_Extract \
}
/**
+ * 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;
+
+/**
* This routine initializes the priority scheduler.
*/
void _Scheduler_priority_Initialize(void);
@@ -60,6 +72,8 @@ void _Scheduler_priority_Initialize(void);
* that is, removes it from the ready queue. It performs
* any necessary scheduling operations including the selection of
* a new heir thread.
+ *
+ * @param[in] the_thread is the thread to be blocked
*/
void _Scheduler_priority_Block(
Thread_Control *the_thread
@@ -72,24 +86,33 @@ void _Scheduler_priority_Block(
void _Scheduler_priority_Schedule(void);
/**
- * This routine allocates @a the_thread->scheduler.
+ * This routine allocates @a the_thread->scheduler.
+ *
+ * @param[in] the_thread is the thread the scheduler is allocating
+ * management memory for
*/
-void * _Scheduler_priority_Thread_scheduler_allocate(
+void * _Scheduler_priority_Allocate(
Thread_Control *the_thread
);
/**
- * This routine frees @a the_thread->scheduler.
+ * This routine frees @a the_thread->scheduler.
+ *
+ * @param[in] the_thread is the thread whose scheduler specific information
+ * will be deallocated.
*/
-void _Scheduler_priority_Thread_scheduler_free(
+void _Scheduler_priority_Free(
Thread_Control *the_thread
);
/**
- * This routine updates @a the_thread->scheduler based on @a the_scheduler
- * structures and thread state
+ * This routine updates @a the_thread->scheduler based on @a the_scheduler
+ * structures and thread state.
+ *
+ * @param[in] the_thread will have its scheduler specific information
+ * structure updated.
*/
-void _Scheduler_priority_Thread_scheduler_update(
+void _Scheduler_priority_Update(
Thread_Control *the_thread
);
@@ -97,6 +120,8 @@ void _Scheduler_priority_Thread_scheduler_update(
* This routine adds @a the_thread to the scheduling decision,
* that is, adds it to the ready queue and
* updates any appropriate scheduling variables, for example the heir thread.
+ *
+ * @param[in] the_thread will be unblocked
*/
void _Scheduler_priority_Unblock(
Thread_Control *the_thread
@@ -115,6 +140,36 @@ void _Scheduler_priority_Unblock(
*/
void _Scheduler_priority_Yield( void );
+/**
+ * This routine puts @a the_thread on to the priority-based ready queue.
+ *
+ * @param[in] the_thread will be enqueued at the TAIL of its priority.
+ */
+void _Scheduler_priority_Enqueue(
+ Thread_Control *the_thread
+);
+
+/**
+ * This routine puts @a the_thread to the head of the ready queue.
+ * For priority-based ready queues, the thread will be the first thread
+ * at its priority level.
+ *
+ * @param[in] the_thread will be enqueued at the HEAD of its priority.
+ */
+void _Scheduler_priority_Enqueue_first(
+ Thread_Control *the_thread
+);
+
+/**
+ * This routine removes a specific thread from the scheduler's set
+ * of ready threads.
+ *
+ * @param[in] the_thread will be extracted from the ready set.
+ */
+void _Scheduler_priority_Extract(
+ Thread_Control *the_thread
+);
+
#ifndef __RTEMS_APPLICATION__
#include <rtems/score/schedulerpriority.inl>
#endif