source: rtems/cpukit/score/inline/rtems/score/scheduler.inl @ 108c4b0

4.115
Last change on this file since 108c4b0 was 108c4b0, checked in by Joel Sherrill <joel.sherrill@…>, on 02/18/11 at 15:12:44

2011-02-18 Joel Sherrill <joel.sherrill@…>

  • sapi/include/confdefs.h, score/Makefile.am, score/include/rtems/score/scheduler.h, score/include/rtems/score/schedulerpriority.h, score/include/rtems/score/thread.h, score/inline/rtems/score/scheduler.inl, score/inline/rtems/score/schedulerpriority.inl, score/src/scheduler.c, score/src/schedulerpriority.c, score/src/schedulerpriorityblock.c, score/src/schedulerpriorityschedule.c, score/src/schedulerpriorityunblock.c, score/src/schedulerpriorityyield.c, score/src/threadchangepriority.c, score/src/threadclose.c, score/src/threadinitialize.c, score/src/threadsetpriority.c, score/src/threadsettransient.c: Significant clean up on Scheduler Plugin Interface. Names were shortened. Missing operations added. Many scheduler files had unneeded includes removed. Made pointer to scheduler information in Thread_Control and Scheduler_Control a void * pointer because the thread and scheduler wrapper should be unaware of scheduler types AND this is broken for user provided schedulers.
  • score/src/schedulerpriorityallocate.c, score/src/schedulerpriorityenqueue.c, score/src/schedulerpriorityenqueuefirst.c, score/src/schedulerpriorityextract.c, score/src/schedulerpriorityfree.c, score/src/schedulerpriorityupdate.c: New files.
  • score/src/schedulerprioritythreadschedulerallocate.c, score/src/schedulerprioritythreadschedulerfree.c, score/src/schedulerprioritythreadschedulerupdate.c: Removed.
  • Property mode set to 100644
File size: 4.0 KB
Line 
1/**
2 *  @file  rtems/score/scheduler.inl
3 *
4 *  This inline file contains all of the inlined routines associated with
5 *  the manipulation of the scheduler.
6 */
7
8/*
9 *  Copyright (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 *  $Id$
17 */
18
19#ifndef _RTEMS_SCORE_SCHEDULER_H
20# error "Never use <rtems/score/scheduler.inl> directly; include <rtems/score/scheduler.h> instead."
21#endif
22
23#ifndef _RTEMS_SCORE_SCHEDULER_INL
24#define _RTEMS_SCORE_SCHEDULER_INL
25
26/**
27 *  @addtogroup ScoreScheduler
28 * @{
29 */
30
31/**
32 * The preferred method to add a new scheduler is to define the jump table
33 * entries and add a case to the _Scheduler_Initialize routine.
34 *
35 * Generic scheduling implementations that rely on the ready queue only can
36 * be found in the _Scheduler_queue_XXX functions.
37 *
38 */
39
40/* Passing the Scheduler_Control* to these functions allows for multiple
41 * scheduler's to exist simultaneously, which could be useful on an SMP
42 * system.  Then remote Schedulers may be accessible.  How to protect such
43 * accesses remains an open problem.
44 */
45
46/** @brief _Scheduler_Schedule
47 *
48 *  This kernel routine implements the scheduling decision logic for
49 *  the scheduler. It does NOT dispatch.
50 */
51RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void )
52{
53  _Scheduler.Operations.schedule();
54}
55
56/** @brief _Scheduler_Yield
57 *
58 *  This routine is invoked when a thread wishes to voluntarily
59 *  transfer control of the processor to another thread. This routine
60 *  always operates on the scheduler that 'owns' the currently executing
61 *  thread.
62 */
63RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void )
64{
65  _Scheduler.Operations.yield();
66}
67
68/** @brief _Scheduler_Block
69 *
70 *  This routine removes @a the_thread from the scheduling decision for
71 *  the scheduler. The primary task is to remove the thread from the
72 *  ready queue.  It performs any necessary schedulering operations
73 *  including the selection of a new heir thread.
74 */
75RTEMS_INLINE_ROUTINE void _Scheduler_Block(
76    Thread_Control    *the_thread
77)
78{
79  _Scheduler.Operations.block( the_thread );
80}
81
82/** @brief _Scheduler_Unblock
83 *
84 *  This routine adds @a the_thread to the scheduling decision for
85 *  the scheduler.  The primary task is to add the thread to the
86 *  ready queue per the schedulering policy and update any appropriate
87 *  scheduling variables, for example the heir thread.
88 */
89RTEMS_INLINE_ROUTINE void _Scheduler_Unblock(
90    Thread_Control    *the_thread
91)
92{
93  _Scheduler.Operations.unblock( the_thread );
94}
95
96/** @brief _Scheduler_Allocate
97 *
98 * This routine allocates @a the_thread->scheduler
99 */
100RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate(
101  Thread_Control    *the_thread
102)
103{
104  return _Scheduler.Operations.allocate( the_thread );
105}
106
107/** @brief _Scheduler_Free
108 *
109 * This routine frees @a the_thread->scheduler
110 */
111RTEMS_INLINE_ROUTINE void _Scheduler_Free(
112  Thread_Control    *the_thread
113)
114{
115  return _Scheduler.Operations.free( the_thread );
116}
117
118/** @brief _Scheduler_Update
119 *
120 * This routine updates @a the_thread->scheduler
121 */
122RTEMS_INLINE_ROUTINE void _Scheduler_Update(
123  Thread_Control    *the_thread
124)
125{
126  _Scheduler.Operations.update( the_thread );
127}
128
129/** @brief _Scheduler_Enqueue
130 *
131 * This routine enqueue @a the_thread->scheduler
132 */
133RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue(
134  Thread_Control    *the_thread
135)
136{
137  _Scheduler.Operations.enqueue( the_thread );
138}
139
140/** @brief _Scheduler_Enqueue_first
141 *
142 * This routine enqueue_first @a the_thread->scheduler
143 */
144RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first(
145  Thread_Control    *the_thread
146)
147{
148  _Scheduler.Operations.enqueue_first( the_thread );
149}
150
151/** @brief _Scheduler_Extract
152 *
153 * This routine extract @a the_thread->scheduler
154 */
155RTEMS_INLINE_ROUTINE void _Scheduler_Extract(
156  Thread_Control    *the_thread
157)
158{
159  _Scheduler.Operations.extract( the_thread );
160}
161
162/**@}*/
163
164#endif
165/* end of include file */
Note: See TracBrowser for help on using the repository browser.