From 806fe963a299ab2b59a7735dcd8a52bc9d5f8666 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 19 Dec 2019 11:38:45 +0100 Subject: 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. --- cpukit/include/rtems/scheduler.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cpukit/include/rtems/scheduler.h') 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 + #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 ) -- cgit v1.2.3