source: rtems/cpukit/sapi/include/rtems/scheduler.h @ 133d54c5

4.11
Last change on this file since 133d54c5 was 133d54c5, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 9, 2014 at 8:33:00 AM

score: Add scheduler name

  • Property mode set to 100644
File size: 5.0 KB
Line 
1/**
2 * @file
3 *
4 * @brief Scheduler Configuration API
5 */
6
7/*
8 * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
9 *
10 *  embedded brains GmbH
11 *  Dornierstr. 4
12 *  82178 Puchheim
13 *  Germany
14 *  <rtems@embedded-brains.de>
15 *
16 * The license and distribution terms for this file may be
17 * found in the file LICENSE in this distribution or at
18 * http://www.rtems.org/license/LICENSE.
19 */
20
21#ifndef _RTEMS_SAPI_SCHEDULER_H
22#define _RTEMS_SAPI_SCHEDULER_H
23
24#include <rtems/score/scheduler.h>
25
26#define RTEMS_SCHEDULER_CONTEXT_NAME( name ) \
27  _Configuration_Scheduler_ ## name
28
29/*
30 * This file should be only included in the context of <rtems/confdefs.h>.
31 * Define the scheduler configuration macros only in case the corresponding
32 * configure symbol is defined.  This is necessary to prevent invalid workspace
33 * size estimates since we have to account for the per-thread scheduler
34 * information.
35 */
36
37#ifdef CONFIGURE_SCHEDULER_CBS
38  #include <rtems/score/schedulercbs.h>
39
40  #define RTEMS_SCHEDULER_CONTEXT_CBS_NAME( name ) \
41    RTEMS_SCHEDULER_CONTEXT_NAME( CBS_ ## name )
42
43  #define RTEMS_SCHEDULER_CONTEXT_CBS( name ) \
44    static Scheduler_EDF_Context RTEMS_SCHEDULER_CONTEXT_CBS_NAME( name )
45
46  #define RTEMS_SCHEDULER_CONTROL_CBS( name, obj_name ) \
47    { \
48      &RTEMS_SCHEDULER_CONTEXT_CBS_NAME( name ).Base, \
49      SCHEDULER_CBS_ENTRY_POINTS, \
50      ( obj_name ) \
51    }
52#endif
53
54#ifdef CONFIGURE_SCHEDULER_EDF
55  #include <rtems/score/scheduleredf.h>
56
57  #define RTEMS_SCHEDULER_CONTEXT_EDF_NAME( name ) \
58    RTEMS_SCHEDULER_CONTEXT_NAME( EDF_ ## name )
59
60  #define RTEMS_SCHEDULER_CONTEXT_EDF( name ) \
61    static Scheduler_EDF_Context RTEMS_SCHEDULER_CONTEXT_EDF_NAME( name )
62
63  #define RTEMS_SCHEDULER_CONTROL_EDF( name, obj_name ) \
64    { \
65      &RTEMS_SCHEDULER_CONTEXT_EDF_NAME( name ).Base, \
66      SCHEDULER_EDF_ENTRY_POINTS, \
67      ( obj_name ) \
68    }
69#endif
70
71#ifdef CONFIGURE_SCHEDULER_PRIORITY
72  #include <rtems/score/schedulerpriority.h>
73
74  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_NAME( name ) \
75    RTEMS_SCHEDULER_CONTEXT_NAME( priority_ ## name )
76
77  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY( name, prio_count ) \
78    static struct { \
79      Scheduler_priority_Context Base; \
80      Chain_Control              Ready[ ( prio_count ) ]; \
81    } RTEMS_SCHEDULER_CONTEXT_PRIORITY_NAME( name )
82
83  #define RTEMS_SCHEDULER_CONTROL_PRIORITY( name, obj_name ) \
84    { \
85      &RTEMS_SCHEDULER_CONTEXT_PRIORITY_NAME( name ).Base.Base, \
86      SCHEDULER_PRIORITY_ENTRY_POINTS, \
87      ( obj_name ) \
88    }
89#endif
90
91#ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP
92  #include <rtems/score/schedulerpriorityaffinitysmp.h>
93
94  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP_NAME( name ) \
95    RTEMS_SCHEDULER_CONTEXT_NAME( priority_affinity_SMP_ ## name )
96
97  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP( name, prio_count ) \
98    static struct { \
99      Scheduler_priority_SMP_Context Base; \
100      Chain_Control                  Ready[ ( prio_count ) ]; \
101    } RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP_NAME( name )
102
103  #define RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP( name, obj_name ) \
104    { \
105      &RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP_NAME( name ).Base.Base, \
106      SCHEDULER_PRIORITY_AFFINITY_SMP_ENTRY_POINTS, \
107      ( obj_name ) \
108    }
109#endif
110
111#ifdef CONFIGURE_SCHEDULER_PRIORITY_SMP
112  #include <rtems/score/schedulerprioritysmp.h>
113
114  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP_NAME( name ) \
115    RTEMS_SCHEDULER_CONTEXT_NAME( priority_SMP_ ## name )
116
117  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP( name, prio_count ) \
118    static struct { \
119      Scheduler_priority_SMP_Context Base; \
120      Chain_Control                  Ready[ ( prio_count ) ]; \
121    } RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP_NAME( name )
122
123  #define RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( name, obj_name ) \
124    { \
125      &RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP_NAME( name ).Base.Base, \
126      SCHEDULER_PRIORITY_SMP_ENTRY_POINTS, \
127      ( obj_name ) \
128    }
129#endif
130
131#ifdef CONFIGURE_SCHEDULER_SIMPLE
132  #include <rtems/score/schedulersimple.h>
133
134  #define RTEMS_SCHEDULER_CONTEXT_SIMPLE_NAME( name ) \
135    RTEMS_SCHEDULER_CONTEXT_NAME( simple_ ## name )
136
137  #define RTEMS_SCHEDULER_CONTEXT_SIMPLE( name ) \
138    static Scheduler_simple_Context \
139      RTEMS_SCHEDULER_CONTEXT_SIMPLE_NAME( name )
140
141  #define RTEMS_SCHEDULER_CONTROL_SIMPLE( name, obj_name ) \
142    { \
143      &RTEMS_SCHEDULER_CONTEXT_SIMPLE_NAME( name ).Base, \
144      SCHEDULER_SIMPLE_ENTRY_POINTS, \
145      ( obj_name ) \
146    }
147#endif
148
149#ifdef CONFIGURE_SCHEDULER_SIMPLE_SMP
150  #include <rtems/score/schedulersimplesmp.h>
151
152  #define RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP_NAME( name ) \
153    RTEMS_SCHEDULER_CONTEXT_NAME( simple_SMP_ ## name )
154
155  #define RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP( name ) \
156    static Scheduler_simple_SMP_Context \
157      RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP_NAME( name )
158
159  #define RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP( name, obj_name ) \
160    { \
161      &RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP_NAME( name ).Base, \
162      SCHEDULER_SIMPLE_SMP_ENTRY_POINTS, \
163      ( obj_name ) \
164    }
165#endif
166
167#endif /* _RTEMS_SAPI_SCHEDULER_H */
Note: See TracBrowser for help on using the repository browser.