37#ifndef _RTEMS_SAPI_SCHEDULER_H
38#define _RTEMS_SAPI_SCHEDULER_H
42#define SCHEDULER_CONTEXT_NAME( name ) \
43 _Configuration_Scheduler_ ## name
46 #define SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( value ) \
49 #define SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( value )
65 #define RTEMS_SCHEDULER_ASSIGN_DEFAULT \
66 SCHEDULER_ASSIGN_DEFAULT
80 #define RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL \
81 SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL
96 #define RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY \
97 SCHEDULER_ASSIGN_PROCESSOR_MANDATORY
111 #define RTEMS_SCHEDULER_ASSIGN( index, attr ) \
113 ( index ) < RTEMS_ARRAY_SIZE( _Scheduler_Table ) ? \
114 &_Scheduler_Table[ ( index ) ] : &RTEMS_SCHEDULER_INVALID_INDEX, \
128 #define RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER { NULL, 0 }
145#define SCHEDULER_CBS_CONTEXT_NAME( name ) \
146 SCHEDULER_CONTEXT_NAME( CBS_ ## name )
155#define RTEMS_SCHEDULER_CBS( name ) \
156 static Scheduler_EDF_Context SCHEDULER_CBS_CONTEXT_NAME( name )
170#define RTEMS_SCHEDULER_TABLE_CBS( name, obj_name ) \
172 &SCHEDULER_CBS_CONTEXT_NAME( name ).Base, \
173 SCHEDULER_CBS_ENTRY_POINTS, \
174 SCHEDULER_CBS_MAXIMUM_PRIORITY, \
176 SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( true ) \
179#ifdef CONFIGURE_SCHEDULER_CBS
184 #define RTEMS_SCHEDULER_CONTEXT_CBS( name ) \
185 RTEMS_SCHEDULER_CBS( name )
187 #define RTEMS_SCHEDULER_CONTROL_CBS( name, obj_name ) \
188 RTEMS_SCHEDULER_TABLE_CBS( name, obj_name )
197#define SCHEDULER_EDF_CONTEXT_NAME( name ) \
198 SCHEDULER_CONTEXT_NAME( EDF_ ## name )
207#define RTEMS_SCHEDULER_EDF( name ) \
208 static Scheduler_EDF_Context SCHEDULER_EDF_CONTEXT_NAME( name )
222#define RTEMS_SCHEDULER_TABLE_EDF( name, obj_name ) \
224 &SCHEDULER_EDF_CONTEXT_NAME( name ).Base, \
225 SCHEDULER_EDF_ENTRY_POINTS, \
226 SCHEDULER_EDF_MAXIMUM_PRIORITY, \
228 SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( true ) \
231#ifdef CONFIGURE_SCHEDULER_EDF
236 #define RTEMS_SCHEDULER_CONTEXT_EDF( name ) \
237 RTEMS_SCHEDULER_EDF( name )
239 #define RTEMS_SCHEDULER_CONTROL_EDF( name, obj_name ) \
240 RTEMS_SCHEDULER_TABLE_EDF( name, obj_name )
249#define SCHEDULER_EDF_SMP_CONTEXT_NAME( name ) \
250 SCHEDULER_CONTEXT_NAME( EDF_SMP_ ## name )
259#define RTEMS_SCHEDULER_EDF_SMP( name ) \
261 Scheduler_EDF_SMP_Context Base; \
262 Scheduler_EDF_SMP_Ready_queue Ready[ CONFIGURE_MAXIMUM_PROCESSORS + 1 ]; \
263 } SCHEDULER_EDF_SMP_CONTEXT_NAME( name )
277#define RTEMS_SCHEDULER_TABLE_EDF_SMP( name, obj_name ) \
279 &SCHEDULER_EDF_SMP_CONTEXT_NAME( name ).Base.Base.Base, \
280 SCHEDULER_EDF_SMP_ENTRY_POINTS, \
281 SCHEDULER_EDF_MAXIMUM_PRIORITY, \
283 SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \
286#ifdef CONFIGURE_SCHEDULER_EDF_SMP
288 #error "CONFIGURE_SCHEDULER_EDF_SMP cannot be used if RTEMS_SMP is disabled"
291 #ifndef CONFIGURE_MAXIMUM_PROCESSORS
292 #error "CONFIGURE_MAXIMUM_PROCESSORS must be defined to configure the EDF SMP Scheduler"
299 #define RTEMS_SCHEDULER_CONTEXT_EDF_SMP( name, max_cpu_count ) \
300 RTEMS_SCHEDULER_EDF_SMP( name )
302 #define RTEMS_SCHEDULER_CONTROL_EDF_SMP( name, obj_name ) \
303 RTEMS_SCHEDULER_TABLE_EDF_SMP( name, obj_name )
312#define SCHEDULER_PRIORITY_CONTEXT_NAME( name ) \
313 SCHEDULER_CONTEXT_NAME( priority_ ## name )
324#define RTEMS_SCHEDULER_PRIORITY( name, prio_count ) \
326 Scheduler_priority_Context Base; \
327 Chain_Control Ready[ ( prio_count ) ]; \
328 } SCHEDULER_PRIORITY_CONTEXT_NAME( name )
343#define RTEMS_SCHEDULER_TABLE_PRIORITY( name, obj_name ) \
345 &SCHEDULER_PRIORITY_CONTEXT_NAME( name ).Base.Base, \
346 SCHEDULER_PRIORITY_ENTRY_POINTS, \
348 SCHEDULER_PRIORITY_CONTEXT_NAME( name ).Ready \
351 SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( true ) \
354#ifdef CONFIGURE_SCHEDULER_PRIORITY
359 #define RTEMS_SCHEDULER_CONTEXT_PRIORITY( name, prio_count ) \
360 RTEMS_SCHEDULER_PRIORITY( name, prio_count )
362 #define RTEMS_SCHEDULER_CONTROL_PRIORITY( name, obj_name ) \
363 RTEMS_SCHEDULER_TABLE_PRIORITY( name, obj_name )
372#define SCHEDULER_PRIORITY_AFFINITY_SMP_CONTEXT_NAME( name ) \
373 SCHEDULER_CONTEXT_NAME( priority_affinity_SMP_ ## name )
385#define RTEMS_SCHEDULER_PRIORITY_AFFINITY_SMP( name, prio_count ) \
387 Scheduler_priority_SMP_Context Base; \
388 Chain_Control Ready[ ( prio_count ) ]; \
389 } SCHEDULER_PRIORITY_AFFINITY_SMP_CONTEXT_NAME( name )
404#define RTEMS_SCHEDULER_TABLE_PRIORITY_AFFINITY_SMP( name, obj_name ) \
406 &SCHEDULER_PRIORITY_AFFINITY_SMP_CONTEXT_NAME( name ).Base.Base.Base, \
407 SCHEDULER_PRIORITY_AFFINITY_SMP_ENTRY_POINTS, \
409 SCHEDULER_PRIORITY_AFFINITY_SMP_CONTEXT_NAME( name ).Ready \
412 SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \
415#ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP
417 #error "CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP cannot be used if RTEMS_SMP is disabled"
424 #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP( name, prio_count ) \
425 RTEMS_SCHEDULER_PRIORITY_AFFINITY_SMP( name, prio_count )
427 #define RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP( name, obj_name ) \
428 RTEMS_SCHEDULER_TABLE_PRIORITY_AFFINITY_SMP( name, obj_name )
437#define SCHEDULER_PRIORITY_SMP_CONTEXT_NAME( name ) \
438 SCHEDULER_CONTEXT_NAME( priority_SMP_ ## name )
449#define RTEMS_SCHEDULER_PRIORITY_SMP( name, prio_count ) \
451 Scheduler_priority_SMP_Context Base; \
452 Chain_Control Ready[ ( prio_count ) ]; \
453 } SCHEDULER_PRIORITY_SMP_CONTEXT_NAME( name )
468#define RTEMS_SCHEDULER_TABLE_PRIORITY_SMP( name, obj_name ) \
470 &SCHEDULER_PRIORITY_SMP_CONTEXT_NAME( name ).Base.Base.Base, \
471 SCHEDULER_PRIORITY_SMP_ENTRY_POINTS, \
473 SCHEDULER_PRIORITY_SMP_CONTEXT_NAME( name ).Ready \
476 SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \
479#ifdef CONFIGURE_SCHEDULER_PRIORITY_SMP
481 #error "CONFIGURE_SCHEDULER_PRIORITY_SMP cannot be used if RTEMS_SMP is disabled"
488 #define RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP( name, prio_count ) \
489 RTEMS_SCHEDULER_PRIORITY_SMP( name, prio_count )
491 #define RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( name, obj_name ) \
492 RTEMS_SCHEDULER_TABLE_PRIORITY_SMP( name, obj_name )
501#define SCHEDULER_STRONG_APA_CONTEXT_NAME( name ) \
502 SCHEDULER_CONTEXT_NAME( strong_APA_ ## name )
511#define RTEMS_SCHEDULER_STRONG_APA( name, prio_count ) \
513 Scheduler_strong_APA_Context Base; \
514 Scheduler_strong_APA_CPU CPU[ CONFIGURE_MAXIMUM_PROCESSORS ]; \
515 } SCHEDULER_STRONG_APA_CONTEXT_NAME( name )
529#define RTEMS_SCHEDULER_TABLE_STRONG_APA( name, obj_name ) \
531 &SCHEDULER_STRONG_APA_CONTEXT_NAME( name ).Base.Base.Base, \
532 SCHEDULER_STRONG_APA_ENTRY_POINTS, \
533 SCHEDULER_STRONG_APA_MAXIMUM_PRIORITY, \
535 SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \
538#ifdef CONFIGURE_SCHEDULER_STRONG_APA
540 #error "CONFIGURE_SCHEDULER_STRONG_APA cannot be used if RTEMS_SMP is disabled"
543 #ifndef CONFIGURE_MAXIMUM_PROCESSORS
544 #error "CONFIGURE_MAXIMUM_PROCESSORS must be defined to configure the Strong APA Scheduler"
551 #define RTEMS_SCHEDULER_CONTEXT_STRONG_APA( name, prio_count ) \
552 RTEMS_SCHEDULER_STRONG_APA( name, prio_count )
554 #define RTEMS_SCHEDULER_CONTROL_STRONG_APA( name, obj_name ) \
555 RTEMS_SCHEDULER_TABLE_STRONG_APA( name, obj_name )
564#define SCHEDULER_SIMPLE_CONTEXT_NAME( name ) \
565 SCHEDULER_CONTEXT_NAME( simple_ ## name )
574#define RTEMS_SCHEDULER_SIMPLE( name ) \
575 static Scheduler_simple_Context \
576 SCHEDULER_SIMPLE_CONTEXT_NAME( name )
590#define RTEMS_SCHEDULER_TABLE_SIMPLE( name, obj_name ) \
592 &SCHEDULER_SIMPLE_CONTEXT_NAME( name ).Base, \
593 SCHEDULER_SIMPLE_ENTRY_POINTS, \
594 SCHEDULER_SIMPLE_MAXIMUM_PRIORITY, \
596 SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( true ) \
599#ifdef CONFIGURE_SCHEDULER_SIMPLE
604 #define RTEMS_SCHEDULER_CONTEXT_SIMPLE( name ) \
605 RTEMS_SCHEDULER_SIMPLE( name )
607 #define RTEMS_SCHEDULER_CONTROL_SIMPLE( name, obj_name ) \
608 RTEMS_SCHEDULER_TABLE_SIMPLE( name, obj_name )
617#define SCHEDULER_SIMPLE_SMP_CONTEXT_NAME( name ) \
618 SCHEDULER_CONTEXT_NAME( simple_SMP_ ## name )
627#define RTEMS_SCHEDULER_SIMPLE_SMP( name ) \
628 static Scheduler_simple_SMP_Context \
629 SCHEDULER_SIMPLE_SMP_CONTEXT_NAME( name )
643#define RTEMS_SCHEDULER_TABLE_SIMPLE_SMP( name, obj_name ) \
645 &SCHEDULER_SIMPLE_SMP_CONTEXT_NAME( name ).Base.Base, \
646 SCHEDULER_SIMPLE_SMP_ENTRY_POINTS, \
647 SCHEDULER_SIMPLE_SMP_MAXIMUM_PRIORITY, \
649 SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \
652#ifdef CONFIGURE_SCHEDULER_SIMPLE_SMP
654 #error "CONFIGURE_SCHEDULER_SIMPLE_SMP cannot be used if RTEMS_SMP is disabled"
661 #define RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP( name ) \
662 RTEMS_SCHEDULER_SIMPLE_SMP( name )
664 #define RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP( name, obj_name ) \
665 RTEMS_SCHEDULER_TABLE_SIMPLE_SMP( name, obj_name )
This header file provides interfaces of the Constant Bandwidth Server (CBS) Scheduler which are used ...
This header file provides interfaces of the EDF Scheduler which are used by the implementation and th...
This header file provides the interfaces of the Earliest Deadline First (EDF) Priority SMP Scheduler.
This header file provides interfaces of the Deterministic Priority Scheduler which are used by the im...
This header file provides the interfaces of the Deterministic Priority Affinity SMP Scheduler.
This header file provides interfaces of the Deterministic Priority SMP Scheduler which are used by th...
This header file provides interfaces of the Simple Priority Scheduler which are used by the implement...
This header file provides the interfaces of the Simple Priority SMP Scheduler.
This header file provides the interfaces of the Strong APA Scheduler.
This header file provides interfaces of the Scheduler Handler which are used by the implementation an...
Scheduler control.
Definition: scheduler.h:337