[rtems commit] config: Add _SMP_Processor_configure_maximum

Sebastian Huber sebh at rtems.org
Tue Feb 25 11:32:18 UTC 2020


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Feb 14 13:57:20 2020 +0100

config: Add _SMP_Processor_configure_maximum

Move the processor maximum configuration constant out of the
configuration table.

Update #3875.

---

 cpukit/include/rtems/confdefs.h  | 12 +++++++-----
 cpukit/include/rtems/config.h    | 14 +++-----------
 cpukit/include/rtems/score/smp.h | 13 +++++++++++++
 3 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 33b1aa6..f8a4eb2 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -2639,16 +2639,18 @@ struct _reent *__getreent(void)
   const rtems_configuration_table Configuration = {
     #ifdef RTEMS_SMP
       #ifdef _CONFIGURE_SMP_APPLICATION
-        true,
+        true
       #else
-        false,
+        false
       #endif
     #endif
-    #ifdef RTEMS_SMP
-      _CONFIGURE_MAXIMUM_PROCESSORS,
-    #endif
   };
 
+  #ifdef RTEMS_SMP
+    const uint32_t _SMP_Processor_configured_maximum =
+      _CONFIGURE_MAXIMUM_PROCESSORS;
+  #endif
+
   const uintptr_t _Workspace_Size = CONFIGURE_EXECUTIVE_RAM_SIZE;
 
   #ifdef CONFIGURE_UNIFIED_WORK_AREAS
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 6489e4e..5550397 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -30,6 +30,7 @@
 #include <rtems/score/object.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/memory.h>
+#include <rtems/score/smp.h>
 #include <rtems/score/stack.h>
 #include <rtems/score/userextdata.h>
 #include <rtems/score/threadidledata.h>
@@ -86,10 +87,6 @@ typedef struct {
   #ifdef RTEMS_SMP
     bool                         smp_enabled;
   #endif
-
-  #ifdef RTEMS_SMP
-    uint32_t                     maximum_processors;
-  #endif
 } rtems_configuration_table;
 
 /**
@@ -204,13 +201,8 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
  *
  * @return The configured maximum count of processors.
  */
-#ifdef RTEMS_SMP
-  #define rtems_configuration_get_maximum_processors() \
-        (Configuration.maximum_processors)
-#else
-  #define rtems_configuration_get_maximum_processors() \
-        1
-#endif
+#define rtems_configuration_get_maximum_processors() \
+        (_SMP_Processor_configured_maximum)
 
 #ifdef __cplusplus
 }
diff --git a/cpukit/include/rtems/score/smp.h b/cpukit/include/rtems/score/smp.h
index 4d6b24a..2722fbd 100644
--- a/cpukit/include/rtems/score/smp.h
+++ b/cpukit/include/rtems/score/smp.h
@@ -36,6 +36,19 @@ extern "C" {
  * @{
  */
 
+/**
+ * @brief The configured processor maximum.
+ *
+ * In SMP configurations, this constant is defined by the application
+ * configuration via <rtems/confdefs.h>, otherwise it is a compile-time
+ * constant with the value one.
+ */
+#if defined(RTEMS_SMP)
+  extern const uint32_t _SMP_Processor_configured_maximum;
+#else
+  #define _SMP_Processor_configured_maximum 1
+#endif
+
 #if defined( RTEMS_SMP )
   extern uint32_t _SMP_Processor_maximum;
 



More information about the vc mailing list