diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-19 11:38:45 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-19 14:21:05 +0100 |
commit | 806fe963a299ab2b59a7735dcd8a52bc9d5f8666 (patch) | |
tree | 9028f5f5677c9fbc07048eec237c1004829d3e66 /cpukit/include/rtems | |
parent | libmisc/top: Fix the idle time and priorities on SMP (diff) | |
download | rtems-806fe963a299ab2b59a7735dcd8a52bc9d5f8666.tar.bz2 |
config: Improve EDF SMP scheduler configuration
Use CONFIGURE_MAXIMUM_PROCESSORS to configure the EDF SMP scheduler
context. This avoids hard to debug configuration errors resulting in
memory corruptions.
Close #3815.
Diffstat (limited to 'cpukit/include/rtems')
-rw-r--r-- | cpukit/include/rtems/confdefs.h | 3 | ||||
-rw-r--r-- | cpukit/include/rtems/scheduler.h | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h index b98dffb4c8..76e2167e01 100644 --- a/cpukit/include/rtems/confdefs.h +++ b/cpukit/include/rtems/confdefs.h @@ -916,8 +916,7 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES) /** Configure the context needed by the scheduler instance */ - #define CONFIGURE_SCHEDULER \ - RTEMS_SCHEDULER_EDF_SMP(dflt, _CONFIGURE_MAXIMUM_PROCESSORS) + #define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_EDF_SMP(dflt) /** Configure the controls for this scheduler instance */ #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \ diff --git a/cpukit/include/rtems/scheduler.h b/cpukit/include/rtems/scheduler.h index 336ca71fe6..dbc161a69d 100644 --- a/cpukit/include/rtems/scheduler.h +++ b/cpukit/include/rtems/scheduler.h @@ -112,13 +112,17 @@ #ifdef CONFIGURE_SCHEDULER_EDF_SMP #include <rtems/score/scheduleredfsmp.h> + #ifndef CONFIGURE_MAXIMUM_PROCESSORS + #error "CONFIGURE_MAXIMUM_PROCESSORS must be defined to configure the EDF SMP scheduler" + #endif + #define SCHEDULER_EDF_SMP_CONTEXT_NAME( name ) \ SCHEDULER_CONTEXT_NAME( EDF_SMP_ ## name ) - #define RTEMS_SCHEDULER_EDF_SMP( name, max_cpu_count ) \ + #define RTEMS_SCHEDULER_EDF_SMP( name ) \ static struct { \ Scheduler_EDF_SMP_Context Base; \ - Scheduler_EDF_SMP_Ready_queue Ready[ ( max_cpu_count ) + 1 ]; \ + Scheduler_EDF_SMP_Ready_queue Ready[ CONFIGURE_MAXIMUM_PROCESSORS + 1 ]; \ } SCHEDULER_EDF_SMP_CONTEXT_NAME( name ) #define RTEMS_SCHEDULER_TABLE_EDF_SMP( name, obj_name ) \ @@ -132,7 +136,7 @@ /* Provided for backward compatibility */ #define RTEMS_SCHEDULER_CONTEXT_EDF_SMP( name, max_cpu_count ) \ - RTEMS_SCHEDULER_EDF_SMP( name, max_cpu_count ) + RTEMS_SCHEDULER_EDF_SMP( name ) #define RTEMS_SCHEDULER_CONTROL_EDF_SMP( name, obj_name ) \ RTEMS_SCHEDULER_TABLE_EDF_SMP( name, obj_name ) |