21 #ifndef _RTEMS_SAPI_SCHEDULER_H 22 #define _RTEMS_SAPI_SCHEDULER_H 26 #define SCHEDULER_CONTEXT_NAME( name ) \ 27 _Configuration_Scheduler_ ## name 29 #if defined(RTEMS_SMP) 33 #define RTEMS_SCHEDULER_ASSIGN_DEFAULT \ 34 SCHEDULER_ASSIGN_DEFAULT 36 #define RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL \ 37 SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL 39 #define RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY \ 40 SCHEDULER_ASSIGN_PROCESSOR_MANDATORY 42 #define RTEMS_SCHEDULER_ASSIGN( index, attr ) \ 44 ( index ) < RTEMS_ARRAY_SIZE( _Scheduler_Table ) ? \ 45 &_Scheduler_Table[ ( index ) ] : &RTEMS_SCHEDULER_INVALID_INDEX, \ 49 #define RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER { NULL, 0 } 60 #ifdef CONFIGURE_SCHEDULER_CBS 63 #define SCHEDULER_CBS_CONTEXT_NAME( name ) \ 64 SCHEDULER_CONTEXT_NAME( CBS_ ## name ) 66 #define RTEMS_SCHEDULER_CBS( name ) \ 67 static Scheduler_EDF_Context SCHEDULER_CBS_CONTEXT_NAME( name ) 69 #define RTEMS_SCHEDULER_TABLE_CBS( name, obj_name ) \ 71 &SCHEDULER_CBS_CONTEXT_NAME( name ).Base, \ 72 SCHEDULER_CBS_ENTRY_POINTS, \ 73 SCHEDULER_CBS_MAXIMUM_PRIORITY, \ 79 #define RTEMS_SCHEDULER_CONTEXT_CBS( name ) \ 80 RTEMS_SCHEDULER_CBS( name ) 82 #define RTEMS_SCHEDULER_CONTROL_CBS( name, obj_name ) \ 83 RTEMS_SCHEDULER_TABLE_CBS( name, obj_name ) 86 #ifdef CONFIGURE_SCHEDULER_EDF 89 #define SCHEDULER_EDF_CONTEXT_NAME( name ) \ 90 SCHEDULER_CONTEXT_NAME( EDF_ ## name ) 92 #define RTEMS_SCHEDULER_EDF( name ) \ 93 static Scheduler_EDF_Context SCHEDULER_EDF_CONTEXT_NAME( name ) 95 #define RTEMS_SCHEDULER_TABLE_EDF( name, obj_name ) \ 97 &SCHEDULER_EDF_CONTEXT_NAME( name ).Base, \ 98 SCHEDULER_EDF_ENTRY_POINTS, \ 99 SCHEDULER_EDF_MAXIMUM_PRIORITY, \ 105 #define RTEMS_SCHEDULER_CONTEXT_EDF( name ) \ 106 RTEMS_SCHEDULER_EDF( name ) 108 #define RTEMS_SCHEDULER_CONTROL_EDF( name, obj_name ) \ 109 RTEMS_SCHEDULER_TABLE_EDF( name, obj_name ) 112 #ifdef CONFIGURE_SCHEDULER_EDF_SMP 115 #define SCHEDULER_EDF_SMP_CONTEXT_NAME( name ) \ 116 SCHEDULER_CONTEXT_NAME( EDF_SMP_ ## name ) 118 #define RTEMS_SCHEDULER_EDF_SMP( name, max_cpu_count ) \ 120 Scheduler_EDF_SMP_Context Base; \ 121 Scheduler_EDF_SMP_Ready_queue Ready[ ( max_cpu_count ) + 1 ]; \ 122 } SCHEDULER_EDF_SMP_CONTEXT_NAME( name ) 124 #define RTEMS_SCHEDULER_TABLE_EDF_SMP( name, obj_name ) \ 126 &SCHEDULER_EDF_SMP_CONTEXT_NAME( name ).Base.Base.Base, \ 127 SCHEDULER_EDF_SMP_ENTRY_POINTS, \ 128 SCHEDULER_EDF_MAXIMUM_PRIORITY, \ 134 #define RTEMS_SCHEDULER_CONTEXT_EDF_SMP( name, max_cpu_count ) \ 135 RTEMS_SCHEDULER_EDF_SMP( name, max_cpu_count ) 137 #define RTEMS_SCHEDULER_CONTROL_EDF_SMP( name, obj_name ) \ 138 RTEMS_SCHEDULER_TABLE_EDF_SMP( name, obj_name ) 141 #ifdef CONFIGURE_SCHEDULER_PRIORITY 144 #define SCHEDULER_PRIORITY_CONTEXT_NAME( name ) \ 145 SCHEDULER_CONTEXT_NAME( priority_ ## name ) 147 #define RTEMS_SCHEDULER_PRIORITY( name, prio_count ) \ 149 Scheduler_priority_Context Base; \ 150 Chain_Control Ready[ ( prio_count ) ]; \ 151 } SCHEDULER_PRIORITY_CONTEXT_NAME( name ) 153 #define RTEMS_SCHEDULER_TABLE_PRIORITY( name, obj_name ) \ 155 &SCHEDULER_PRIORITY_CONTEXT_NAME( name ).Base.Base, \ 156 SCHEDULER_PRIORITY_ENTRY_POINTS, \ 158 SCHEDULER_PRIORITY_CONTEXT_NAME( name ).Ready \ 165 #define RTEMS_SCHEDULER_CONTEXT_PRIORITY( name, prio_count ) \ 166 RTEMS_SCHEDULER_PRIORITY( name, prio_count ) 168 #define RTEMS_SCHEDULER_CONTROL_PRIORITY( name, obj_name ) \ 169 RTEMS_SCHEDULER_TABLE_PRIORITY( name, obj_name ) 172 #ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP 175 #define SCHEDULER_PRIORITY_AFFINITY_SMP_CONTEXT_NAME( name ) \ 176 SCHEDULER_CONTEXT_NAME( priority_affinity_SMP_ ## name ) 178 #define RTEMS_SCHEDULER_PRIORITY_AFFINITY_SMP( name, prio_count ) \ 180 Scheduler_priority_SMP_Context Base; \ 181 Chain_Control Ready[ ( prio_count ) ]; \ 182 } SCHEDULER_PRIORITY_AFFINITY_SMP_CONTEXT_NAME( name ) 184 #define RTEMS_SCHEDULER_TABLE_PRIORITY_AFFINITY_SMP( name, obj_name ) \ 186 &SCHEDULER_PRIORITY_AFFINITY_SMP_CONTEXT_NAME( name ).Base.Base.Base, \ 187 SCHEDULER_PRIORITY_AFFINITY_SMP_ENTRY_POINTS, \ 189 SCHEDULER_PRIORITY_AFFINITY_SMP_CONTEXT_NAME( name ).Ready \ 196 #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP( name, prio_count ) \ 197 RTEMS_SCHEDULER_PRIORITY_AFFINITY_SMP( name, prio_count ) 199 #define RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP( name, obj_name ) \ 200 RTEMS_SCHEDULER_TABLE_PRIORITY_AFFINITY_SMP( name, obj_name ) 203 #ifdef CONFIGURE_SCHEDULER_PRIORITY_SMP 206 #define SCHEDULER_PRIORITY_SMP_CONTEXT_NAME( name ) \ 207 SCHEDULER_CONTEXT_NAME( priority_SMP_ ## name ) 209 #define RTEMS_SCHEDULER_PRIORITY_SMP( name, prio_count ) \ 211 Scheduler_priority_SMP_Context Base; \ 212 Chain_Control Ready[ ( prio_count ) ]; \ 213 } SCHEDULER_PRIORITY_SMP_CONTEXT_NAME( name ) 215 #define RTEMS_SCHEDULER_TABLE_PRIORITY_SMP( name, obj_name ) \ 217 &SCHEDULER_PRIORITY_SMP_CONTEXT_NAME( name ).Base.Base.Base, \ 218 SCHEDULER_PRIORITY_SMP_ENTRY_POINTS, \ 220 SCHEDULER_PRIORITY_SMP_CONTEXT_NAME( name ).Ready \ 227 #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP( name, prio_count ) \ 228 RTEMS_SCHEDULER_PRIORITY_SMP( name, prio_count ) 230 #define RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( name, obj_name ) \ 231 RTEMS_SCHEDULER_TABLE_PRIORITY_SMP( name, obj_name ) 234 #ifdef CONFIGURE_SCHEDULER_STRONG_APA 237 #define SCHEDULER_STRONG_APA_CONTEXT_NAME( name ) \ 238 SCHEDULER_CONTEXT_NAME( strong_APA_ ## name ) 240 #define RTEMS_SCHEDULER_STRONG_APA( name, prio_count ) \ 242 Scheduler_strong_APA_Context Base; \ 243 Chain_Control Ready[ ( prio_count ) ]; \ 244 } SCHEDULER_STRONG_APA_CONTEXT_NAME( name ) 246 #define RTEMS_SCHEDULER_TABLE_STRONG_APA( name, obj_name ) \ 248 &SCHEDULER_STRONG_APA_CONTEXT_NAME( name ).Base.Base.Base, \ 249 SCHEDULER_STRONG_APA_ENTRY_POINTS, \ 251 SCHEDULER_STRONG_APA_CONTEXT_NAME( name ).Ready \ 258 #define RTEMS_SCHEDULER_CONTEXT_STRONG_APA( name, prio_count ) \ 259 RTEMS_SCHEDULER_STRONG_APA( name, prio_count ) 261 #define RTEMS_SCHEDULER_CONTROL_STRONG_APA( name, obj_name ) \ 262 RTEMS_SCHEDULER_TABLE_STRONG_APA( name, obj_name ) 265 #ifdef CONFIGURE_SCHEDULER_SIMPLE 268 #define SCHEDULER_SIMPLE_CONTEXT_NAME( name ) \ 269 SCHEDULER_CONTEXT_NAME( simple_ ## name ) 271 #define RTEMS_SCHEDULER_SIMPLE( name ) \ 272 static Scheduler_simple_Context \ 273 SCHEDULER_SIMPLE_CONTEXT_NAME( name ) 275 #define RTEMS_SCHEDULER_TABLE_SIMPLE( name, obj_name ) \ 277 &SCHEDULER_SIMPLE_CONTEXT_NAME( name ).Base, \ 278 SCHEDULER_SIMPLE_ENTRY_POINTS, \ 279 SCHEDULER_SIMPLE_MAXIMUM_PRIORITY, \ 285 #define RTEMS_SCHEDULER_CONTEXT_SIMPLE( name ) \ 286 RTEMS_SCHEDULER_SIMPLE( name ) 288 #define RTEMS_SCHEDULER_CONTROL_SIMPLE( name, obj_name ) \ 289 RTEMS_SCHEDULER_TABLE_SIMPLE( name, obj_name ) 292 #ifdef CONFIGURE_SCHEDULER_SIMPLE_SMP 295 #define SCHEDULER_SIMPLE_SMP_CONTEXT_NAME( name ) \ 296 SCHEDULER_CONTEXT_NAME( simple_SMP_ ## name ) 298 #define RTEMS_SCHEDULER_SIMPLE_SMP( name ) \ 299 static Scheduler_simple_SMP_Context \ 300 SCHEDULER_SIMPLE_SMP_CONTEXT_NAME( name ) 302 #define RTEMS_SCHEDULER_TABLE_SIMPLE_SMP( name, obj_name ) \ 304 &SCHEDULER_SIMPLE_SMP_CONTEXT_NAME( name ).Base.Base, \ 305 SCHEDULER_SIMPLE_SMP_ENTRY_POINTS, \ 306 SCHEDULER_SIMPLE_SMP_MAXIMUM_PRIORITY, \ 312 #define RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP( name ) \ 313 RTEMS_SCHEDULER_SIMPLE_SMP( name ) 315 #define RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP( name, obj_name ) \ 316 RTEMS_SCHEDULER_TABLE_SIMPLE_SMP( name, obj_name ) Strong APA Scheduler API.
Thread Manipulation with the Priority-Based Scheduler.
Data Related to the Manipulation of Threads for the EDF Scheduler.
Simple SMP Scheduler API.
Deterministic Priority SMP Scheduler API.
Manipulation of Threads Simple-Priority-Based Ready Queue.
Scheduler control.
Definition: scheduler.h:266
Deterministic Priority Affinity SMP Scheduler API.
Constants and Structures Associated with the Scheduler.
Thread manipulation for the CBS scheduler.