source: rtems/cpukit/score/include/rtems/score/schedulerpriority.h @ bf54252

4.115
Last change on this file since bf54252 was bf54252, checked in by Alexandre Devienne <deviennealexandre@…>, on 11/28/12 at 20:14:50

Score misc: Clean up Doxygen #4 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

http://www.google-melange.com/gci/task/view/google/gci2012/7985215

  • Property mode set to 100644
File size: 6.6 KB
Line 
1/**
2 *  @file  rtems/score/schedulerpriority.h
3 *
4 *  This include file contains all the constants and structures associated
5 *  with the manipulation of threads for the priority-based scheduler.
6 */
7
8/*
9 *  Copryight (c) 2010 Gedare Bloom.
10 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 */
16
17#ifndef _RTEMS_SCORE_SCHEDULERPRIORITY_H
18#define _RTEMS_SCORE_SCHEDULERPRIORITY_H
19
20#include <rtems/score/chain.h>
21#include <rtems/score/priority.h>
22#include <rtems/score/scheduler.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/**
29 *  @addtogroup ScoreScheduler
30 *
31 */
32/**@{*/
33
34/**
35 *  Entry points for the Deterministic Priority Based Scheduler.
36 */
37#define SCHEDULER_PRIORITY_ENTRY_POINTS \
38  { \
39    _Scheduler_priority_Initialize,       /* initialize entry point */ \
40    _Scheduler_priority_Schedule,         /* schedule entry point */ \
41    _Scheduler_priority_Yield,            /* yield entry point */ \
42    _Scheduler_priority_Block,            /* block entry point */ \
43    _Scheduler_priority_Unblock,          /* unblock entry point */ \
44    _Scheduler_priority_Allocate,         /* allocate entry point */ \
45    _Scheduler_priority_Free,             /* free entry point */ \
46    _Scheduler_priority_Update,           /* update entry point */ \
47    _Scheduler_priority_Enqueue,          /* enqueue entry point */ \
48    _Scheduler_priority_Enqueue_first,    /* enqueue_first entry point */ \
49    _Scheduler_priority_Extract,          /* extract entry point */ \
50    _Scheduler_priority_Priority_compare, /* compares two priorities */ \
51    _Scheduler_priority_Release_job,      /* new period of task */ \
52    _Scheduler_priority_Tick              /* tick entry point */ \
53  }
54
55/**
56 * Per-thread data related to the _Scheduler_PRIORITY scheduling policy.
57 */
58typedef struct {
59  /** This field points to the Ready FIFO for this thread's priority. */
60  Chain_Control                        *ready_chain;
61
62  /** This field contains precalculated priority map indices. */
63  Priority_bit_map_Information          Priority_map;
64} Scheduler_priority_Per_thread;
65
66/**
67 * This routine initializes the priority scheduler.
68 */
69void _Scheduler_priority_Initialize(void);
70
71/**
72 *  @brief Scheduler priority Block
73 *
74 *  This routine removes @a the_thread from the scheduling decision,
75 *  that is, removes it from the ready queue.  It performs
76 *  any necessary scheduling operations including the selection of
77 *  a new heir thread.
78 *
79 *  @param[in] the_thread is the thread to be blocked
80 */
81void _Scheduler_priority_Block(
82  Thread_Control    *the_thread
83);
84
85/**
86 *  @brief schedule entry point
87 *
88 *  This kernel routine sets the heir thread to be the next ready thread
89 *  by invoking the_scheduler->ready_queue->operations->first().
90 */
91void _Scheduler_priority_Schedule(void);
92
93/**
94 *  This routine allocates @a the_thread->scheduler.
95 *
96 *  @param[in] the_thread is the thread the scheduler is allocating
97 *             management memory for
98 */
99void * _Scheduler_priority_Allocate(
100  Thread_Control      *the_thread
101);
102
103/**
104 *  This routine frees @a the_thread->scheduler.
105 *
106 *  @param[in] the_thread is the thread whose scheduler specific information
107 *             will be deallocated.
108 */
109void _Scheduler_priority_Free(
110  Thread_Control      *the_thread
111);
112
113/**
114 *  @brief Update Scheduler priority
115 *  This routine updates @a the_thread->scheduler based on @a the_scheduler
116 *  structures and thread state.
117 *
118 *  @param[in] the_thread will have its scheduler specific information
119 *             structure updated.
120 */
121void _Scheduler_priority_Update(
122  Thread_Control      *the_thread
123);
124
125/**
126 *  @brief Scheduler Priority Unblock
127 *
128 *  This routine adds @a the_thread to the scheduling decision,
129 *  that is, adds it to the ready queue and
130 *  updates any appropriate scheduling variables, for example the heir thread.
131 *
132 *  @param[in] the_thread will be unblocked
133 */
134void _Scheduler_priority_Unblock(
135  Thread_Control    *the_thread
136);
137
138/**
139 *  This routine is invoked when a thread wishes to voluntarily
140 *  transfer control of the processor to another thread in the queue.
141 *
142 *  This routine will remove the running THREAD from the ready queue
143 *  and place it immediately at the rear of this chain.  Reset timeslice
144 *  and yield the processor functions both use this routine, therefore if
145 *  reset is true and this is the only thread on the queue then the
146 *  timeslice counter is reset.  The heir THREAD will be updated if the
147 *  running is also the currently the heir.
148 */
149void _Scheduler_priority_Yield( void );
150
151/**
152 *  This routine puts @a the_thread on to the priority-based ready queue.
153 *
154 *  @param[in] the_thread will be enqueued at the TAIL of its priority.
155 */
156void _Scheduler_priority_Enqueue(
157  Thread_Control    *the_thread
158);
159
160/**
161 *  This routine puts @a the_thread to the head of the ready queue.
162 *  For priority-based ready queues, the thread will be the first thread
163 *  at its priority level.
164 *
165 *  @param[in] the_thread will be enqueued at the HEAD of its priority.
166 */
167void _Scheduler_priority_Enqueue_first(
168  Thread_Control    *the_thread
169);
170
171/**
172 *  This routine removes a specific thread from the scheduler's set
173 *  of ready threads.
174 *
175 *  @param[in] the_thread will be extracted from the ready set.
176 */
177void _Scheduler_priority_Extract(
178  Thread_Control     *the_thread
179);
180
181/**
182 *  @brief Scheduler priority Priority compare
183 *
184 *  This routine compares two priorities.
185 */
186int _Scheduler_priority_Priority_compare(
187  Priority_Control      p1,
188  Priority_Control      p2
189);
190
191/**
192 *  @brief Scheduler priority Release job
193 *
194 *  This routine is called when a new job of task is released.
195 *
196 *  @param[in] the_thread is the owner of the job.
197 *  @param[in] deadline of the new job from now. If equal to 0,
198 *             the job was cancelled or deleted.
199 */
200void _Scheduler_priority_Release_job (
201  Thread_Control  *the_thread,
202  uint32_t         deadline
203);
204
205/**
206 *  @brief Deterministic Priority Scheduler Tick Method
207 *
208 *  This routine is invoked as part of processing each clock tick.
209 *  It is responsible for determining if the current thread allows
210 *  timeslicing and, if so, when its timeslice expires.
211 */
212void _Scheduler_priority_Tick( void );
213
214/**
215 *  This is the major bit map.
216 */
217extern volatile Priority_bit_map_Control _Priority_Major_bit_map;
218
219/**
220 *  This is the minor bit map.
221 */
222extern Priority_bit_map_Control _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
223
224#ifndef __RTEMS_APPLICATION__
225#include <rtems/score/schedulerpriority.inl>
226#endif
227
228#ifdef __cplusplus
229}
230#endif
231
232/**@}*/
233
234#endif
235/* end of include file */
Note: See TracBrowser for help on using the repository browser.