summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/scheduler.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-12-19 11:38:45 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-12-19 14:21:05 +0100
commit806fe963a299ab2b59a7735dcd8a52bc9d5f8666 (patch)
tree9028f5f5677c9fbc07048eec237c1004829d3e66 /cpukit/include/rtems/scheduler.h
parentlibmisc/top: Fix the idle time and priorities on SMP (diff)
downloadrtems-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/scheduler.h')
-rw-r--r--cpukit/include/rtems/scheduler.h10
1 files changed, 7 insertions, 3 deletions
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 )