From 981eed21761cd0036f0ac61042adea09d8a595a2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 29 Apr 2016 12:09:32 +0200 Subject: score: Add dummy Strong APA scheduler Start with a copy of the Priority SMP scheduler implementation. Update #2510. --- cpukit/sapi/include/confdefs.h | 29 +++++++++++++++++++++++++++++ cpukit/sapi/include/rtems/scheduler.h | 20 ++++++++++++++++++++ 2 files changed, 49 insertions(+) (limited to 'cpukit/sapi') diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 006cdbd6f5..ceed2a4b9d 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -771,6 +771,7 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; * - CONFIGURE_SCHEDULER_PRIORITY_SMP - Deterministic Priority SMP Scheduler * - CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP - Deterministic * Priority SMP Affinity Scheduler + * - CONFIGURE_SCHEDULER_STRONG_APA - Strong APA Scheduler * - CONFIGURE_SCHEDULER_SIMPLE - Light-weight Priority Scheduler * - CONFIGURE_SCHEDULER_SIMPLE_SMP - Simple SMP Priority Scheduler * - CONFIGURE_SCHEDULER_EDF - EDF Scheduler @@ -795,6 +796,7 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; !defined(CONFIGURE_SCHEDULER_PRIORITY) && \ !defined(CONFIGURE_SCHEDULER_PRIORITY_SMP) && \ !defined(CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP) && \ + !defined(CONFIGURE_SCHEDULER_STRONG_APA) && \ !defined(CONFIGURE_SCHEDULER_SIMPLE) && \ !defined(CONFIGURE_SCHEDULER_SIMPLE_SMP) && \ !defined(CONFIGURE_SCHEDULER_EDF) && \ @@ -889,6 +891,30 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #endif #endif +/* + * If the Strong APA Scheduler is selected, then configure for + * it. + */ +#if defined(CONFIGURE_SCHEDULER_STRONG_APA) + #if !defined(CONFIGURE_SCHEDULER_NAME) + /** Configure the name of the scheduler instance */ + #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'A', 'P', 'A') + #endif + + #if !defined(CONFIGURE_SCHEDULER_CONTROLS) + /** Configure the context needed by the scheduler instance */ + #define CONFIGURE_SCHEDULER_CONTEXT \ + RTEMS_SCHEDULER_CONTEXT_STRONG_APA( \ + dflt, \ + CONFIGURE_MAXIMUM_PRIORITY + 1 \ + ) + + /** Configure the controls for this scheduler instance */ + #define CONFIGURE_SCHEDULER_CONTROLS \ + RTEMS_SCHEDULER_CONTROL_STRONG_APA(dflt, CONFIGURE_SCHEDULER_NAME) + #endif +#endif + /* * If the Simple Priority Scheduler is selected, then configure for it. */ @@ -3264,6 +3290,9 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP Scheduler_priority_affinity_SMP_Node Priority_affinity_SMP; #endif + #ifdef CONFIGURE_SCHEDULER_STRONG_APA + Scheduler_strong_APA_Node Strong_APA; + #endif #ifdef CONFIGURE_SCHEDULER_USER_PER_THREAD CONFIGURE_SCHEDULER_USER_PER_THREAD User; #endif diff --git a/cpukit/sapi/include/rtems/scheduler.h b/cpukit/sapi/include/rtems/scheduler.h index a1afa668a9..39dff903d4 100644 --- a/cpukit/sapi/include/rtems/scheduler.h +++ b/cpukit/sapi/include/rtems/scheduler.h @@ -151,6 +151,26 @@ } #endif +#ifdef CONFIGURE_SCHEDULER_STRONG_APA + #include + + #define RTEMS_SCHEDULER_CONTEXT_STRONG_APA_NAME( name ) \ + RTEMS_SCHEDULER_CONTEXT_NAME( strong_APA_ ## name ) + + #define RTEMS_SCHEDULER_CONTEXT_STRONG_APA( name, prio_count ) \ + static struct { \ + Scheduler_strong_APA_Context Base; \ + Chain_Control Ready[ ( prio_count ) ]; \ + } RTEMS_SCHEDULER_CONTEXT_STRONG_APA_NAME( name ) + + #define RTEMS_SCHEDULER_CONTROL_STRONG_APA( name, obj_name ) \ + { \ + &RTEMS_SCHEDULER_CONTEXT_STRONG_APA_NAME( name ).Base.Base.Base, \ + SCHEDULER_STRONG_APA_ENTRY_POINTS, \ + ( obj_name ) \ + } +#endif + #ifdef CONFIGURE_SCHEDULER_SIMPLE #include -- cgit v1.2.3