From f95fa38764c007459cb0bd62a67e83a442f55433 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 1 Feb 2017 12:11:33 +0100 Subject: Remove CONFIGURE_SMP_APPLICATION Enable the SMP support if CONFIGURE_SMP_MAXIMUM_PROCESSORS > 1. Update #2893. --- cpukit/sapi/include/confdefs.h | 38 ++++++++++++++++---------------------- cpukit/sapi/include/rtems/config.h | 8 ++------ 2 files changed, 18 insertions(+), 28 deletions(-) (limited to 'cpukit/sapi/include') diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index e00d079554..c931fda50f 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -206,19 +206,20 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; extern int rtems_telnetd_maximum_ptys; #endif -#if defined(RTEMS_SMP) - /* - * If configured for SMP, then we need to know the maximum CPU cores. - */ - #if !defined(CONFIGURE_SMP_APPLICATION) - #if !defined(CONFIGURE_SMP_MAXIMUM_PROCESSORS) - #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 1 - #endif - #else - #if !defined(CONFIGURE_SMP_MAXIMUM_PROCESSORS) - #error "CONFIGURE_SMP_MAXIMUM_PROCESSORS not specified for SMP Application" - #endif - #endif +#ifndef CONFIGURE_SMP_MAXIMUM_PROCESSORS + #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 1 +#endif + +/* + * An internal define to indicate that this is an SMP application + * configuration. + */ +#if CONFIGURE_SMP_MAXIMUM_PROCESSORS > 1 + #define _CONFIGURE_SMP_APPLICATION +#endif + +#ifdef CONFIGURE_SMP_APPLICATION + #warning "CONFIGURE_SMP_APPLICATION is obsolete since RTEMS 4.12" #endif /* @@ -797,7 +798,7 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; !defined(CONFIGURE_SCHEDULER_SIMPLE_SMP) && \ !defined(CONFIGURE_SCHEDULER_EDF) && \ !defined(CONFIGURE_SCHEDULER_CBS) - #if defined(RTEMS_SMP) && defined(CONFIGURE_SMP_APPLICATION) + #ifdef _CONFIGURE_SMP_APPLICATION /** * If no scheduler is specified in an SMP configuration, the * priority scheduler is default. @@ -1499,7 +1500,7 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; * used to specify the initial execution mode of the single Classic API task. */ #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES - #if defined(RTEMS_SMP) && defined(CONFIGURE_SMP_APPLICATION) + #ifdef _CONFIGURE_SMP_APPLICATION #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES #else #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT @@ -3416,13 +3417,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #else false, #endif - #ifdef RTEMS_SMP - #ifdef CONFIGURE_SMP_APPLICATION - true, - #else - false, - #endif - #endif CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of static extensions */ CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to static extensions */ #if defined(RTEMS_MULTIPROCESSING) diff --git a/cpukit/sapi/include/rtems/config.h b/cpukit/sapi/include/rtems/config.h index 1b48ea92de..ddcb77cc87 100644 --- a/cpukit/sapi/include/rtems/config.h +++ b/cpukit/sapi/include/rtems/config.h @@ -237,10 +237,6 @@ typedef struct { */ bool stack_allocator_avoids_work_space; - #ifdef RTEMS_SMP - bool smp_enabled; - #endif - uint32_t number_of_initial_extensions; const rtems_extensions_table *User_extension_table; #if defined(RTEMS_MULTIPROCESSING) @@ -356,7 +352,7 @@ extern const rtems_configuration_table Configuration; * @brief Returns true if the SMP mode of operation is enabled, and false * otherwise. * - * On single-processor configurations this is a compile time constant which + * In uni-processor configurations this is a compile-time constant which * evaluates to false. * * @retval true SMP mode of operation is enabled. @@ -364,7 +360,7 @@ extern const rtems_configuration_table Configuration; */ #ifdef RTEMS_SMP #define rtems_configuration_is_smp_enabled() \ - (Configuration.smp_enabled) + (rtems_configuration_get_maximum_processors() > 1) #else #define rtems_configuration_is_smp_enabled() \ false -- cgit v1.2.3