Changeset 806fe963 in rtems


Ignore:
Timestamp:
Dec 19, 2019, 10:38:45 AM (12 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
86abbb6e
Parents:
c737748b
git-author:
Sebastian Huber <sebastian.huber@…> (12/19/19 10:38:45)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/19/19 13:21:05)
Message:

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.

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/confdefs.h

    rc737748b r806fe963  
    917917  #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
    918918    /** Configure the context needed by the scheduler instance */
    919     #define CONFIGURE_SCHEDULER \
    920       RTEMS_SCHEDULER_EDF_SMP(dflt, _CONFIGURE_MAXIMUM_PROCESSORS)
     919    #define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_EDF_SMP(dflt)
    921920
    922921    /** Configure the controls for this scheduler instance */
  • cpukit/include/rtems/scheduler.h

    rc737748b r806fe963  
    113113  #include <rtems/score/scheduleredfsmp.h>
    114114
     115  #ifndef CONFIGURE_MAXIMUM_PROCESSORS
     116    #error "CONFIGURE_MAXIMUM_PROCESSORS must be defined to configure the EDF SMP scheduler"
     117  #endif
     118
    115119  #define SCHEDULER_EDF_SMP_CONTEXT_NAME( name ) \
    116120    SCHEDULER_CONTEXT_NAME( EDF_SMP_ ## name )
    117121
    118   #define RTEMS_SCHEDULER_EDF_SMP( name, max_cpu_count ) \
     122  #define RTEMS_SCHEDULER_EDF_SMP( name ) \
    119123    static struct { \
    120124      Scheduler_EDF_SMP_Context Base; \
    121       Scheduler_EDF_SMP_Ready_queue Ready[ ( max_cpu_count ) + 1 ]; \
     125      Scheduler_EDF_SMP_Ready_queue Ready[ CONFIGURE_MAXIMUM_PROCESSORS + 1 ]; \
    122126    } SCHEDULER_EDF_SMP_CONTEXT_NAME( name )
    123127
     
    133137
    134138  #define RTEMS_SCHEDULER_CONTEXT_EDF_SMP( name, max_cpu_count ) \
    135     RTEMS_SCHEDULER_EDF_SMP( name, max_cpu_count )
     139    RTEMS_SCHEDULER_EDF_SMP( name )
    136140
    137141  #define RTEMS_SCHEDULER_CONTROL_EDF_SMP( name, obj_name ) \
  • testsuites/smptests/smpschededf01/init.c

    rc737748b r806fe963  
    138138#include <rtems/scheduler.h>
    139139
    140 RTEMS_SCHEDULER_EDF_SMP(a, CONFIGURE_MAXIMUM_PROCESSORS);
     140RTEMS_SCHEDULER_EDF_SMP(a);
    141141
    142142#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
  • testsuites/smptests/smpschededf04/init.c

    rc737748b r806fe963  
    113113#include <rtems/scheduler.h>
    114114
    115 RTEMS_SCHEDULER_EDF_SMP(a, CONFIGURE_MAXIMUM_PROCESSORS);
     115RTEMS_SCHEDULER_EDF_SMP(a);
    116116
    117 RTEMS_SCHEDULER_EDF_SMP(b, CONFIGURE_MAXIMUM_PROCESSORS);
     117RTEMS_SCHEDULER_EDF_SMP(b);
    118118
    119119#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
  • testsuites/smptests/smpscheduler02/init.c

    rc737748b r806fe963  
    440440RTEMS_SCHEDULER_PRIORITY_SMP(a, 256);
    441441
    442 RTEMS_SCHEDULER_EDF_SMP(b, CONFIGURE_MAXIMUM_PROCESSORS);
     442RTEMS_SCHEDULER_EDF_SMP(b);
    443443
    444444RTEMS_SCHEDULER_SIMPLE_SMP(c);
  • testsuites/smptests/smpscheduler07/init.c

    rc737748b r806fe963  
    3333#include <rtems/scheduler.h>
    3434
    35 RTEMS_SCHEDULER_EDF_SMP(a, CONFIGURE_MAXIMUM_PROCESSORS);
     35RTEMS_SCHEDULER_EDF_SMP(a);
    3636
    3737#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
  • testsuites/smptests/smpthreadpin01/init.c

    rc737748b r806fe963  
    598598#include <rtems/scheduler.h>
    599599
    600 RTEMS_SCHEDULER_EDF_SMP(a, CONFIGURE_MAXIMUM_PROCESSORS);
    601 
    602 RTEMS_SCHEDULER_EDF_SMP(b, CONFIGURE_MAXIMUM_PROCESSORS);
     600RTEMS_SCHEDULER_EDF_SMP(a);
     601
     602RTEMS_SCHEDULER_EDF_SMP(b);
    603603
    604604#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
Note: See TracChangeset for help on using the changeset viewer.