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>
9 // keeps the ready queue for EDF
10 EDF_Chain_Control _Thread_Ready_EDF_chain;
12 #define SCHEDULER_EDF_ENTRY_POINTS \
14 _Scheduler_edf_Initialize, /* initialize entry point */ \
15 _Scheduler_edf_Schedule, /* schedule entry point */ \
16 _Scheduler_edf_Yield, /* yield entry point */ \
17 _Scheduler_edf_Block, /* block entry point */ \
18 _Scheduler_edf_Unblock, /* unblock entry point */ \
19 _Scheduler_edf_Allocate, /* allocate entry point */ \
20 _Scheduler_edf_Free, /* free entry point */ \
21 _Scheduler_edf_Update, /* update entry point */ \
22 _Scheduler_edf_Enqueue, /* enqueue entry point */ \
23 _Scheduler_edf_Enqueue_first, /* enqueue_first entry point */ \
24 _Scheduler_edf_Extract /* extract entry point */ \
30 * This routine initializes the priority scheduler.
32 void _Scheduler_edf_Initialize(void);
35 * This routine removes @a the_thread from the scheduling decision,
36 * that is, removes it from the ready queue. It performs
37 * any necessary scheduling operations including the selection of
40 * @param[in] the_thread is the thread to be blocked
42 void _Scheduler_edf_Block(
43 Thread_Control *the_thread
47 * This kernel routine sets the heir thread to be the next ready thread
48 * by invoking the_scheduler->ready_queue->operations->first().
50 void _Scheduler_edf_Schedule(void);
53 * This routine allocates @a the_thread->scheduler.
55 * @param[in] the_thread is the thread the scheduler is allocating
56 * management memory for
58 void * _Scheduler_edf_Allocate(
59 Thread_Control *the_thread
63 * This routine frees @a the_thread->scheduler.
65 * @param[in] the_thread is the thread whose scheduler specific information
66 * will be deallocated.
68 void _Scheduler_edf_Free(
69 Thread_Control *the_thread
73 * This routine updates @a the_thread->scheduler based on @a the_scheduler
74 * structures and thread state.
76 * @param[in] the_thread will have its scheduler specific information
79 void _Scheduler_edf_Update(
80 Thread_Control *the_thread
84 * This routine adds @a the_thread to the scheduling decision,
85 * that is, adds it to the ready queue and
86 * updates any appropriate scheduling variables, for example the heir thread.
88 * @param[in] the_thread will be unblocked
90 void _Scheduler_edf_Unblock(
91 Thread_Control *the_thread
95 * This routine is invoked when a thread wishes to voluntarily
96 * transfer control of the processor to another thread in the queue.
98 * This routine will remove the running THREAD from the ready queue
99 * and place it immediately at the rear of this chain. Reset timeslice
100 * and yield the processor functions both use this routine, therefore if
101 * reset is true and this is the only thread on the queue then the
102 * timeslice counter is reset. The heir THREAD will be updated if the
103 * running is also the currently the heir.
105 void _Scheduler_edf_Yield( void );
108 * This routine puts @a the_thread on to the priority-based ready queue.
110 * @param[in] the_thread will be enqueued at the TAIL of its priority.
112 void _Scheduler_edf_Enqueue(
113 Thread_Control *the_thread
117 * This routine puts @a the_thread to the head of the ready queue.
118 * For priority-based ready queues, the thread will be the first thread
119 * at its priority level.
121 * @param[in] the_thread will be enqueued at the HEAD of its priority.
123 void _Scheduler_edf_Enqueue_first(
124 Thread_Control *the_thread
128 * This routine removes a specific thread from the scheduler's set
131 * @param[in] the_thread will be extracted from the ready set.
133 void _Scheduler_edf_Extract(
134 Thread_Control *the_thread
139 #endif /*_SCHEDULER_EDF_H*/