1 #ifndef _SCHEDULER_EDF_H
2 #define _SCHEDULER_EDF_H
4 #include <rtems/score/scheduler.h>
5 #include <rtems/score/chain.h>
6 #include <rtems/score/thread.h>
10 // keeps the ready queue for EDF
11 EDF_Chain_Control _Thread_Ready_EDF_chain;
13 #define SCHEDULER_EDF_ENTRY_POINTS \
15 _Scheduler_edf_Initialize, /* initialize entry point */ \
16 _Scheduler_edf_Schedule, /* schedule entry point */ \
17 _Scheduler_edf_Yield, /* yield entry point */ \
18 _Scheduler_edf_Block, /* block entry point */ \
19 _Scheduler_edf_Unblock, /* unblock entry point */ \
20 _Scheduler_edf_Allocate, /* allocate entry point */ \
21 _Scheduler_edf_Free, /* free entry point */ \
22 _Scheduler_edf_Update, /* update entry point */ \
23 _Scheduler_edf_Enqueue, /* enqueue entry point */ \
24 _Scheduler_edf_Enqueue_first, /* enqueue_first entry point */ \
25 _Scheduler_edf_Extract /* extract entry point */ \
31 * This routine initializes the priority scheduler.
33 void _Scheduler_edf_Initialize(void);
36 * This routine removes @a the_thread from the scheduling decision,
37 * that is, removes it from the ready queue. It performs
38 * any necessary scheduling operations including the selection of
41 * @param[in] the_thread is the thread to be blocked
43 void _Scheduler_edf_Block(
44 Thread_Control *the_thread
48 * This kernel routine sets the heir thread to be the next ready thread
49 * by invoking the_scheduler->ready_queue->operations->first().
51 void _Scheduler_edf_Schedule(void);
54 * This routine allocates @a the_thread->scheduler.
56 * @param[in] the_thread is the thread the scheduler is allocating
57 * management memory for
59 void * _Scheduler_edf_Allocate(
60 Thread_Control *the_thread
64 * This routine frees @a the_thread->scheduler.
66 * @param[in] the_thread is the thread whose scheduler specific information
67 * will be deallocated.
69 void _Scheduler_edf_Free(
70 Thread_Control *the_thread
74 * This routine updates @a the_thread->scheduler based on @a the_scheduler
75 * structures and thread state.
77 * @param[in] the_thread will have its scheduler specific information
80 void _Scheduler_edf_Update(
81 Thread_Control *the_thread
85 * This routine adds @a the_thread to the scheduling decision,
86 * that is, adds it to the ready queue and
87 * updates any appropriate scheduling variables, for example the heir thread.
89 * @param[in] the_thread will be unblocked
91 void _Scheduler_edf_Unblock(
92 Thread_Control *the_thread
96 * This routine is invoked when a thread wishes to voluntarily
97 * transfer control of the processor to another thread in the queue.
99 * This routine will remove the running THREAD from the ready queue
100 * and place it immediately at the rear of this chain. Reset timeslice
101 * and yield the processor functions both use this routine, therefore if
102 * reset is true and this is the only thread on the queue then the
103 * timeslice counter is reset. The heir THREAD will be updated if the
104 * running is also the currently the heir.
106 void _Scheduler_edf_Yield( void );
109 * This routine puts @a the_thread on to the priority-based ready queue.
111 * @param[in] the_thread will be enqueued at the TAIL of its priority.
113 void _Scheduler_edf_Enqueue(
114 Thread_Control *the_thread
118 * This routine puts @a the_thread to the head of the ready queue.
119 * For priority-based ready queues, the thread will be the first thread
120 * at its priority level.
122 * @param[in] the_thread will be enqueued at the HEAD of its priority.
124 void _Scheduler_edf_Enqueue_first(
125 Thread_Control *the_thread
129 * This routine removes a specific thread from the scheduler's set
132 * @param[in] the_thread will be extracted from the ready set.
134 void _Scheduler_edf_Extract(
135 Thread_Control *the_thread
140 #endif /*_SCHEDULER_EDF_H*/