[rtems commit] confdefs.h: Add SMP enabled field to configuration

Sebastian Huber sebh at rtems.org
Tue May 16 07:48:48 UTC 2017


Module:    rtems
Branch:    master
Commit:    6bc63df199f82b90a3ffe471b452f813bf7c7a70
Changeset: http://git.rtems.org/rtems/commit/?id=6bc63df199f82b90a3ffe471b452f813bf7c7a70

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri May 12 09:53:35 2017 +0200

confdefs.h: Add SMP enabled field to configuration

Do not use the processor count to determine if SMP is enabled.  Instead
use a dedicated configuration option.  Enable SMP by default in SMP
configurations.

Add CONFIGURE_DISABLE_SMP_CONFIGURATION to all test which would fail
otherwise.

Update #3001.

---

 cpukit/sapi/include/confdefs.h           | 7 +++++++
 cpukit/sapi/include/rtems/config.h       | 6 +++++-
 testsuites/libtests/cpuuse/system.h      | 2 ++
 testsuites/libtests/rtmonuse/system.h    | 2 ++
 testsuites/libtests/termios05/init.c     | 2 ++
 testsuites/sptests/sp01/system.h         | 2 ++
 testsuites/sptests/sp08/init.c           | 2 ++
 testsuites/sptests/sp14/system.h         | 2 ++
 testsuites/sptests/sp20/system.h         | 2 ++
 testsuites/sptests/sp37/system.h         | 2 ++
 testsuites/sptests/spcbssched01/system.h | 2 ++
 testsuites/sptests/spcbssched02/system.h | 2 ++
 testsuites/sptests/spcbssched03/system.h | 2 ++
 testsuites/sptests/spedfsched01/system.h | 2 ++
 testsuites/sptests/spedfsched02/system.h | 2 ++
 testsuites/sptests/spedfsched03/system.h | 2 ++
 testsuites/sptests/spfifo03/init.c       | 2 +-
 testsuites/sptests/spfifo05/init.c       | 2 +-
 testsuites/tmtests/tm08/system.h         | 2 ++
 testsuites/tmtests/tm22/system.h         | 2 ++
 20 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index 331e747..604539b 100755
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -3320,6 +3320,13 @@ 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 ddcb77c..2993e70 100644
--- a/cpukit/sapi/include/rtems/config.h
+++ b/cpukit/sapi/include/rtems/config.h
@@ -237,6 +237,10 @@ 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)
@@ -360,7 +364,7 @@ extern const rtems_configuration_table Configuration;
  */
 #ifdef RTEMS_SMP
   #define rtems_configuration_is_smp_enabled() \
-        (rtems_configuration_get_maximum_processors() > 1)
+        (Configuration.smp_enabled)
 #else
   #define rtems_configuration_is_smp_enabled() \
         false
diff --git a/testsuites/libtests/cpuuse/system.h b/testsuites/libtests/cpuuse/system.h
index 0501d41..562f2db 100644
--- a/testsuites/libtests/cpuuse/system.h
+++ b/testsuites/libtests/cpuuse/system.h
@@ -50,6 +50,8 @@ void Task_switch(
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 /* global variables */
diff --git a/testsuites/libtests/rtmonuse/system.h b/testsuites/libtests/rtmonuse/system.h
index 1544f80..b7bb5f1 100644
--- a/testsuites/libtests/rtmonuse/system.h
+++ b/testsuites/libtests/rtmonuse/system.h
@@ -47,6 +47,8 @@ void Get_all_counters( void );
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
 #define CONFIGURE_EXTRA_TASK_STACKS           (20 * RTEMS_MINIMUM_STACK_SIZE)
+
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
 #include <rtems/confdefs.h>
 
 /* global variables */
diff --git a/testsuites/libtests/termios05/init.c b/testsuites/libtests/termios05/init.c
index 3cdf969..e9f1531 100644
--- a/testsuites/libtests/termios05/init.c
+++ b/testsuites/libtests/termios05/init.c
@@ -166,6 +166,8 @@ rtems_task Init(
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #define CONFIGURE_INIT
 
 #include <rtems/confdefs.h>
diff --git a/testsuites/sptests/sp01/system.h b/testsuites/sptests/sp01/system.h
index a317dd9..68f8277 100644
--- a/testsuites/sptests/sp01/system.h
+++ b/testsuites/sptests/sp01/system.h
@@ -31,6 +31,8 @@ rtems_task Task_1_through_3(
 #define CONFIGURE_EXTRA_TASK_STACKS         (4 * RTEMS_MINIMUM_STACK_SIZE)
 #define CONFIGURE_MAXIMUM_TASKS             4
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 /* global variables */
diff --git a/testsuites/sptests/sp08/init.c b/testsuites/sptests/sp08/init.c
index 77e9819..2364c70 100644
--- a/testsuites/sptests/sp08/init.c
+++ b/testsuites/sptests/sp08/init.c
@@ -300,6 +300,8 @@ rtems_task Init(
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #define CONFIGURE_INIT
 #include <rtems/confdefs.h>
 /* end of file */
diff --git a/testsuites/sptests/sp14/system.h b/testsuites/sptests/sp14/system.h
index 7721366..3a63a8d 100644
--- a/testsuites/sptests/sp14/system.h
+++ b/testsuites/sptests/sp14/system.h
@@ -51,6 +51,8 @@ rtems_task Task_2(
 
 #define CONFIGURE_EXTRA_TASK_STACKS         (1 * RTEMS_MINIMUM_STACK_SIZE)
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 /* global variables */
diff --git a/testsuites/sptests/sp20/system.h b/testsuites/sptests/sp20/system.h
index dfefe4b..cbc926a 100644
--- a/testsuites/sptests/sp20/system.h
+++ b/testsuites/sptests/sp20/system.h
@@ -47,6 +47,8 @@ void Get_all_counters( void );
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 /* global variables */
diff --git a/testsuites/sptests/sp37/system.h b/testsuites/sptests/sp37/system.h
index 6bb47ec..67a62d2 100644
--- a/testsuites/sptests/sp37/system.h
+++ b/testsuites/sptests/sp37/system.h
@@ -39,6 +39,8 @@ rtems_task Init(
 #define CONFIGURE_MAXIMUM_TASKS             2
 #define CONFIGURE_MAXIMUM_TIMERS            1
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 /* end of include file */
diff --git a/testsuites/sptests/spcbssched01/system.h b/testsuites/sptests/spcbssched01/system.h
index 2ba1db5..813a7a0 100644
--- a/testsuites/sptests/spcbssched01/system.h
+++ b/testsuites/sptests/spcbssched01/system.h
@@ -37,6 +37,8 @@ rtems_task Task_1_through_3(
 #define CONFIGURE_EXTRA_TASK_STACKS         (4 * RTEMS_MINIMUM_STACK_SIZE)
 #define CONFIGURE_MAXIMUM_TASKS             4
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 /* global variables */
diff --git a/testsuites/sptests/spcbssched02/system.h b/testsuites/sptests/spcbssched02/system.h
index dba3d13..302b9b5 100644
--- a/testsuites/sptests/spcbssched02/system.h
+++ b/testsuites/sptests/spcbssched02/system.h
@@ -43,6 +43,8 @@ rtems_task Task_Periodic(
 
 #define CONFIGURE_SCHEDULER_CBS
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 #include <rtems/rtems/clock.h>
diff --git a/testsuites/sptests/spcbssched03/system.h b/testsuites/sptests/spcbssched03/system.h
index 4ad5204..7ce4884 100644
--- a/testsuites/sptests/spcbssched03/system.h
+++ b/testsuites/sptests/spcbssched03/system.h
@@ -47,6 +47,8 @@ rtems_task Tasks_Aperiodic(
 
 #define CONFIGURE_SCHEDULER_CBS
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 #include <rtems/rtems/clock.h>
diff --git a/testsuites/sptests/spedfsched01/system.h b/testsuites/sptests/spedfsched01/system.h
index b930cb1..e673b1f 100644
--- a/testsuites/sptests/spedfsched01/system.h
+++ b/testsuites/sptests/spedfsched01/system.h
@@ -37,6 +37,8 @@ rtems_task Task_1_through_3(
 #define CONFIGURE_EXTRA_TASK_STACKS         (4 * RTEMS_MINIMUM_STACK_SIZE)
 #define CONFIGURE_MAXIMUM_TASKS             4
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 /* global variables */
diff --git a/testsuites/sptests/spedfsched02/system.h b/testsuites/sptests/spedfsched02/system.h
index c92a398..cbdb7ad 100644
--- a/testsuites/sptests/spedfsched02/system.h
+++ b/testsuites/sptests/spedfsched02/system.h
@@ -49,6 +49,8 @@ void Get_all_counters( void );
 
 #define CONFIGURE_SCHEDULER_EDF
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 /* global variables */
diff --git a/testsuites/sptests/spedfsched03/system.h b/testsuites/sptests/spedfsched03/system.h
index 95922ae..ec5af82 100644
--- a/testsuites/sptests/spedfsched03/system.h
+++ b/testsuites/sptests/spedfsched03/system.h
@@ -47,6 +47,8 @@ rtems_task Tasks_Aperiodic(
 
 #define CONFIGURE_SCHEDULER_EDF
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 #include <rtems/rtems/clock.h>
diff --git a/testsuites/sptests/spfifo03/init.c b/testsuites/sptests/spfifo03/init.c
index 0fb024a..5aa4800 100644
--- a/testsuites/sptests/spfifo03/init.c
+++ b/testsuites/sptests/spfifo03/init.c
@@ -215,9 +215,9 @@ rtems_task Init(
 
 #define CONFIGURE_MAXIMUM_BARRIERS 1
 
-#define CONFIGURE_INIT
 #define CONFIGURE_MAXIMUM_FIFOS 1
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
 
 #define CONFIGURE_INIT
 #include <rtems/confdefs.h>
diff --git a/testsuites/sptests/spfifo05/init.c b/testsuites/sptests/spfifo05/init.c
index 1ccdd49..a5ce313 100644
--- a/testsuites/sptests/spfifo05/init.c
+++ b/testsuites/sptests/spfifo05/init.c
@@ -270,9 +270,9 @@ rtems_task Init(
 
 #define CONFIGURE_MAXIMUM_BARRIERS 2
 
-#define CONFIGURE_INIT
 #define CONFIGURE_MAXIMUM_FIFOS 1
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
 
 #define CONFIGURE_INIT
 #include <rtems/confdefs.h>
diff --git a/testsuites/tmtests/tm08/system.h b/testsuites/tmtests/tm08/system.h
index 3610fe9..e6af3c1 100644
--- a/testsuites/tmtests/tm08/system.h
+++ b/testsuites/tmtests/tm08/system.h
@@ -32,6 +32,8 @@ rtems_task Init(
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 /* end of include file */
diff --git a/testsuites/tmtests/tm22/system.h b/testsuites/tmtests/tm22/system.h
index fa7795f..89c7138 100644
--- a/testsuites/tmtests/tm22/system.h
+++ b/testsuites/tmtests/tm22/system.h
@@ -38,6 +38,8 @@ rtems_task Init(
   CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(100, MESSAGE_SIZE )
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
+#define CONFIGURE_DISABLE_SMP_CONFIGURATION
+
 #include <rtems/confdefs.h>
 
 /* end of include file */




More information about the vc mailing list