source: rtems/cpukit/score/include/rtems/score/schedulersimple.h @ 3203e09

4.115
Last change on this file since 3203e09 was 3203e09, checked in by Joel Sherrill <joel.sherrill@…>, on 06/17/11 at 14:31:46

2011-06-17 Joel Sherrill <joel.sherrill@…>

PR 1819/cpukit

  • rtems/src/clocktick.c, score/Makefile.am, score/include/rtems/score/scheduler.h, score/include/rtems/score/schedulerpriority.h, score/include/rtems/score/schedulersimple.h, score/include/rtems/score/schedulersimplesmp.h, score/include/rtems/score/thread.h, score/inline/rtems/score/scheduler.inl: Add a scheduler entry point which is invoked at each clock tick. _Thread_Tickle_timeslice() is now a method owned by the Deterministic Priority Scheduler and shared by the Simple Priority Scheduler. The Simple SMP Scheduler has its own variation on this which does timeslicing bookkeeping on all cores.
  • score/src/schedulerprioritytick.c, score/src/schedulersimplesmptick.c: New files.
  • score/src/threadtickletimeslice.c: Removed.
  • Property mode set to 100644
File size: 5.5 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#include <rtems/score/schedulerpriority.h>
32
33/**
34 *  Entry points for Scheduler Simple
35 */
36#define SCHEDULER_SIMPLE_ENTRY_POINTS \
37  { \
38    _Scheduler_simple_Initialize,    /* initialize entry point */ \
39    _Scheduler_simple_Schedule,      /* schedule entry point */ \
40    _Scheduler_simple_Yield,         /* yield entry point */ \
41    _Scheduler_simple_Block,         /* block entry point */ \
42    _Scheduler_simple_Unblock,       /* unblock entry point */ \
43    _Scheduler_simple_Allocate,      /* allocate entry point */ \
44    _Scheduler_simple_Free,          /* free entry point */ \
45    _Scheduler_simple_Update,        /* update entry point */ \
46    _Scheduler_simple_Enqueue,       /* enqueue entry point */ \
47    _Scheduler_simple_Enqueue_first, /* enqueue_first entry point */ \
48    _Scheduler_simple_Extract,       /* extract entry point */ \
49    _Scheduler_priority_Tick         /* tick entry point */ \
50  }
51
52/**
53 * This routine initializes the simple scheduler.
54 */
55void _Scheduler_simple_Initialize( void );
56
57/**
58 *  This routine sets the heir thread to be the next ready thread
59 *  on the ready queue by getting the first node in the scheduler
60 *  information.
61 */
62void _Scheduler_simple_Schedule( void );
63
64/**
65 *  This routine is invoked when a thread wishes to voluntarily
66 *  transfer control of the processor to another thread in the queue.
67 *  It will remove the running THREAD from the scheduler.informaiton
68 *  (where the ready queue is stored) and place it immediately at the
69 *  between the last entry of its priority and the next priority thread.
70 *  Reset timeslice and yield the processor functions both use this routine,
71 *  therefore if reset is true and this is the only thread on the queue then
72 *  the timeslice counter is reset.  The heir THREAD will be updated if the
73 *  running is also the currently the heir.
74*/
75void _Scheduler_simple_Yield( void );
76
77/**
78 *  This routine removes @a the_thread from the scheduling decision,
79 *  that is, removes it from the ready queue.  It performs
80 *  any necessary scheduling operations including the selection of
81 *  a new heir thread.
82 *
83 *  @param[in] the_thread is the thread that is to be blocked
84 */
85void _Scheduler_simple_Block(
86  Thread_Control *the_thread
87);
88
89/**
90 *  This routine adds @a the_thread to the scheduling decision,
91 *  that is, adds it to the ready queue and
92 *  updates any appropriate scheduling variables, for example the heir thread.
93 *
94 *  @param[in] the_thread is the thread that is to be unblocked
95 */
96void _Scheduler_simple_Unblock(
97  Thread_Control *the_thread
98);
99
100/**
101 *  This routine removes a specific thread from the specified
102 *  simple-based ready queue.
103 *
104 *  @param[in] the_thread is the thread to be blocked
105 */
106void _Scheduler_simple_Extract(
107  Thread_Control *the_thread
108);
109
110/**
111 *  This routine puts @a the_thread on to the ready queue.
112 *
113 *  @param[in] the_thread is the thread to be blocked
114 */
115void _Scheduler_simple_Enqueue(
116  Thread_Control *the_thread
117);
118
119/**
120 *  This routine puts @a the_thread to the head of the ready queue.
121 *  The thread will be the first thread at its priority level.
122 *
123 *  @param[in] the_thread is the thread to be blocked
124 */
125void _Scheduler_simple_Enqueue_first(
126  Thread_Control *the_thread
127);
128
129/**
130 *  This routine is a place holder for any memeory allocation needed
131 *  by the scheduler.  For the simple scheduler the routine is an empty
132 *  place holder.
133 *
134 *  @param[in] the_thread is the thread the scheduler is allocating
135 *             management memory for
136 *
137 *  @return this routine returns -1 since this is just an empty placeholder
138 *  and the return value may be defined differently by each scheduler.
139 */
140void *_Scheduler_simple_Allocate(
141  Thread_Control *the_thread
142);
143
144/**
145 * This routine does nothing, and is used as a stub for Schedule update
146 *
147 * The overhead of a function call will still be imposed.
148 *
149 *  @param[in] the_thread is the thread to be blocked
150 */
151void _Scheduler_simple_Update(
152  Thread_Control *the_thread
153);
154
155/**
156 * This routine does nothing, and is used as a stub for Schedule free
157 *
158 * The overhead of a function call will still be imposed.
159 *
160 *  @param[in] the_thread is the thread to be blocked
161 */
162void _Scheduler_simple_Free(
163  Thread_Control *the_thread
164);
165
166/**
167 *  _Scheduler_simple_Ready_queue_enqueue
168 *
169 *  This routine puts @a the_thread on the ready queue
170 *  at the end of its priority group.
171 *
172 *  @param[in] the_thread - pointer to a thread control block
173 */
174void _Scheduler_simple_Ready_queue_enqueue(
175  Thread_Control    *the_thread
176);
177
178/**
179 *  _Scheduler_simple_Ready_queue_enqueue_first
180 *
181 *  This routine puts @a the_thread on to the ready queue
182 *  at the beginning of its priority group.
183 *
184 *  @param[in] the_thread - pointer to a thread control block
185 */
186void _Scheduler_simple_Ready_queue_enqueue_first(
187  Thread_Control    *the_thread
188);
189
190#ifndef __RTEMS_APPLICATION__
191#include <rtems/score/schedulersimple.inl>
192#endif
193
194#ifdef __cplusplus
195}
196#endif
197
198/**@}*/
199
200#endif
201/* end of include file */
Note: See TracBrowser for help on using the repository browser.