source: rtems/cpukit/sapi/include/rtems/scheduler.h @ e1598a6

4.11
Last change on this file since e1598a6 was e1598a6, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 4, 2014 at 8:56:36 AM

score: Static scheduler configuration

Do not allocate the scheduler control structures from the workspace.
This is a preparation step for configuration of clustered/partitioned
schedulers on SMP.

  • Property mode set to 100644
File size: 4.8 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 ) \
47    { \
48      &RTEMS_SCHEDULER_CONTEXT_CBS_NAME( name ).Base, \
49      SCHEDULER_CBS_ENTRY_POINTS \
50    }
51#endif
52
53#ifdef CONFIGURE_SCHEDULER_EDF
54  #include <rtems/score/scheduleredf.h>
55
56  #define RTEMS_SCHEDULER_CONTEXT_EDF_NAME( name ) \
57    RTEMS_SCHEDULER_CONTEXT_NAME( EDF_ ## name )
58
59  #define RTEMS_SCHEDULER_CONTEXT_EDF( name ) \
60    static Scheduler_EDF_Context RTEMS_SCHEDULER_CONTEXT_EDF_NAME( name )
61
62  #define RTEMS_SCHEDULER_CONTROL_EDF( name ) \
63    { \
64      &RTEMS_SCHEDULER_CONTEXT_EDF_NAME( name ).Base, \
65      SCHEDULER_EDF_ENTRY_POINTS \
66    }
67#endif
68
69#ifdef CONFIGURE_SCHEDULER_PRIORITY
70  #include <rtems/score/schedulerpriority.h>
71
72  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_NAME( name ) \
73    RTEMS_SCHEDULER_CONTEXT_NAME( priority_ ## name )
74
75  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY( name, prio_count ) \
76    static struct { \
77      Scheduler_priority_Context Base; \
78      Chain_Control              Ready[ ( prio_count ) ]; \
79    } RTEMS_SCHEDULER_CONTEXT_PRIORITY_NAME( name )
80
81  #define RTEMS_SCHEDULER_CONTROL_PRIORITY( name ) \
82    { \
83      &RTEMS_SCHEDULER_CONTEXT_PRIORITY_NAME( name ).Base.Base, \
84      SCHEDULER_PRIORITY_ENTRY_POINTS \
85    }
86#endif
87
88#ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP
89  #include <rtems/score/schedulerpriorityaffinitysmp.h>
90
91  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP_NAME( name ) \
92    RTEMS_SCHEDULER_CONTEXT_NAME( priority_affinity_SMP_ ## name )
93
94  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP( name, prio_count ) \
95    static struct { \
96      Scheduler_priority_SMP_Context Base; \
97      Chain_Control                  Ready[ ( prio_count ) ]; \
98    } RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP_NAME( name )
99
100  #define RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP( name ) \
101    { \
102      &RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP_NAME( name ).Base.Base, \
103      SCHEDULER_PRIORITY_AFFINITY_SMP_ENTRY_POINTS \
104    }
105#endif
106
107#ifdef CONFIGURE_SCHEDULER_PRIORITY_SMP
108  #include <rtems/score/schedulerprioritysmp.h>
109
110  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP_NAME( name ) \
111    RTEMS_SCHEDULER_CONTEXT_NAME( priority_SMP_ ## name )
112
113  #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP( name, prio_count ) \
114    static struct { \
115      Scheduler_priority_SMP_Context Base; \
116      Chain_Control                  Ready[ ( prio_count ) ]; \
117    } RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP_NAME( name )
118
119  #define RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( name ) \
120    { \
121      &RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP_NAME( name ).Base.Base, \
122      SCHEDULER_PRIORITY_SMP_ENTRY_POINTS \
123    }
124#endif
125
126#ifdef CONFIGURE_SCHEDULER_SIMPLE
127  #include <rtems/score/schedulersimple.h>
128
129  #define RTEMS_SCHEDULER_CONTEXT_SIMPLE_NAME( name ) \
130    RTEMS_SCHEDULER_CONTEXT_NAME( simple_ ## name )
131
132  #define RTEMS_SCHEDULER_CONTEXT_SIMPLE( name ) \
133    static Scheduler_simple_Context \
134      RTEMS_SCHEDULER_CONTEXT_SIMPLE_NAME( name )
135
136  #define RTEMS_SCHEDULER_CONTROL_SIMPLE( name ) \
137    { \
138      &RTEMS_SCHEDULER_CONTEXT_SIMPLE_NAME( name ).Base, \
139      SCHEDULER_SIMPLE_ENTRY_POINTS \
140    }
141#endif
142
143#ifdef CONFIGURE_SCHEDULER_SIMPLE_SMP
144  #include <rtems/score/schedulersimplesmp.h>
145
146  #define RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP_NAME( name ) \
147    RTEMS_SCHEDULER_CONTEXT_NAME( simple_SMP_ ## name )
148
149  #define RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP( name ) \
150    static Scheduler_simple_SMP_Context \
151      RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP_NAME( name )
152
153  #define RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP( name ) \
154    { \
155      &RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP_NAME( name ).Base, \
156      SCHEDULER_SIMPLE_SMP_ENTRY_POINTS \
157    }
158#endif
159
160#endif /* _RTEMS_SAPI_SCHEDULER_H */
Note: See TracBrowser for help on using the repository browser.