source: rtems/cpukit/score/include/rtems/score/schedulersimple.h @ dacdda30

4.115
Last change on this file since dacdda30 was dacdda30, checked in by Ralf Corsepius <ralf.corsepius@…>, on 05/24/11 at 02:44:58

Remove white-spaces.

  • Property mode set to 100644
File size: 5.4 KB
Line 
1/**
2 *  @file  rtems/score/schedulersimple.h
3 *
4 *  This include file contains all the constants and structures associated
5 *  with the manipulation of threads on a simple-priority-based ready queue.
6 *
7 *
8 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 *
14 *  $Id$
15 */
16
17#ifndef _RTEMS_SCORE_SCHEDULERSIMPLE_H
18#define _RTEMS_SCORE_SCHEDULERSIMPLE_H
19
20/**
21 *  @addtogroup ScoreScheduler
22 *
23 */
24/**@{*/
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include <rtems/score/scheduler.h>
31
32/**
33 *  Entry points for Scheduler Simple
34 */
35#define SCHEDULER_SIMPLE_ENTRY_POINTS \
36  { \
37    _Scheduler_simple_Initialize,    /* initialize entry point */ \
38    _Scheduler_simple_Schedule,      /* schedule entry point */ \
39    _Scheduler_simple_Yield,         /* yield entry point */ \
40    _Scheduler_simple_Block,         /* block entry point */ \
41    _Scheduler_simple_Unblock,       /* unblock entry point */ \
42    _Scheduler_simple_Allocate,      /* allocate entry point */ \
43    _Scheduler_simple_Free,          /* free entry point */ \
44    _Scheduler_simple_Update,        /* update entry point */ \
45    _Scheduler_simple_Enqueue,       /* enqueue entry point */ \
46    _Scheduler_simple_Enqueue_first, /* enqueue_first entry point */ \
47    _Scheduler_simple_Extract        /* extract entry point */ \
48  }
49
50/**
51 * This routine initializes the simple scheduler.
52 */
53void _Scheduler_simple_Initialize( void );
54
55/**
56 *  This routine sets the heir thread to be the next ready thread
57 *  on the ready queue by getting the first node in the scheduler
58 *  information.
59 */
60void _Scheduler_simple_Schedule( void );
61
62/**
63 *  This routine is invoked when a thread wishes to voluntarily
64 *  transfer control of the processor to another thread in the queue.
65 *  It will remove the running THREAD from the scheduler.informaiton
66 *  (where the ready queue is stored) and place it immediately at the
67 *  between the last entry of its priority and the next priority thread.
68 *  Reset timeslice and yield the processor functions both use this routine,
69 *  therefore if reset is true and this is the only thread on the queue then
70 *  the timeslice counter is reset.  The heir THREAD will be updated if the
71 *  running is also the currently the heir.
72*/
73void _Scheduler_simple_Yield( void );
74
75/**
76 *  This routine removes @a the_thread from the scheduling decision,
77 *  that is, removes it from the ready queue.  It performs
78 *  any necessary scheduling operations including the selection of
79 *  a new heir thread.
80 *
81 *  @param[in] the_thread is the thread that is to be blocked
82 */
83void _Scheduler_simple_Block(
84  Thread_Control *the_thread
85);
86
87/**
88 *  This routine adds @a the_thread to the scheduling decision,
89 *  that is, adds it to the ready queue and
90 *  updates any appropriate scheduling variables, for example the heir thread.
91 *
92 *  @param[in] the_thread is the thread that is to be unblocked
93 */
94void _Scheduler_simple_Unblock(
95  Thread_Control *the_thread
96);
97
98/**
99 *  This routine removes a specific thread from the specified
100 *  simple-based ready queue.
101 *
102 *  @param[in] the_thread is the thread to be blocked
103 */
104void _Scheduler_simple_Extract(
105  Thread_Control *the_thread
106);
107
108/**
109 *  This routine puts @a the_thread on to the ready queue.
110 *
111 *  @param[in] the_thread is the thread to be blocked
112 */
113void _Scheduler_simple_Enqueue(
114  Thread_Control *the_thread
115);
116
117/**
118 *  This routine puts @a the_thread to the head of the ready queue.
119 *  The thread will be the first thread at its priority level.
120 *
121 *  @param[in] the_thread is the thread to be blocked
122 */
123void _Scheduler_simple_Enqueue_first(
124  Thread_Control *the_thread
125);
126
127/**
128 *  This routine is a place holder for any memeory allocation needed
129 *  by the scheduler.  For the simple scheduler the routine is an empty
130 *  place holder.
131 *
132 *  @param[in] the_thread is the thread the scheduler is allocating
133 *             management memory for
134 *
135 *  @return this routine returns -1 since this is just an empty placeholder
136 *  and the return value may be defined differently by each scheduler.
137 */
138void *_Scheduler_simple_Allocate(
139  Thread_Control *the_thread
140);
141
142/**
143 * This routine does nothing, and is used as a stub for Schedule update
144 *
145 * The overhead of a function call will still be imposed.
146 *
147 *  @param[in] the_thread is the thread to be blocked
148 */
149void _Scheduler_simple_Update(
150  Thread_Control *the_thread
151);
152
153/**
154 * This routine does nothing, and is used as a stub for Schedule free
155 *
156 * The overhead of a function call will still be imposed.
157 *
158 *  @param[in] the_thread is the thread to be blocked
159 */
160void _Scheduler_simple_Free(
161  Thread_Control *the_thread
162);
163
164/**
165 *  _Scheduler_simple_Ready_queue_enqueue
166 *
167 *  This routine puts @a the_thread on the ready queue
168 *  at the end of its priority group.
169 *
170 *  @param[in] the_thread - pointer to a thread control block
171 */
172void _Scheduler_simple_Ready_queue_enqueue(
173  Thread_Control    *the_thread
174);
175
176/**
177 *  _Scheduler_simple_Ready_queue_enqueue_first
178 *
179 *  This routine puts @a the_thread on to the ready queue
180 *  at the beginning of its priority group.
181 *
182 *  @param[in] the_thread - pointer to a thread control block
183 */
184void _Scheduler_simple_Ready_queue_enqueue_first(
185  Thread_Control    *the_thread
186);
187
188#ifndef __RTEMS_APPLICATION__
189#include <rtems/score/schedulersimple.inl>
190#endif
191
192#ifdef __cplusplus
193}
194#endif
195
196/**@}*/
197
198#endif
199/* end of include file */
Note: See TracBrowser for help on using the repository browser.