[rtems commit] config: Add _SMP_Is_enabled
Sebastian Huber
sebh at rtems.org
Tue Feb 25 11:32:18 UTC 2020
Module: rtems
Branch: master
Commit: ba46b9368eaf57e8c2361c215ceb0d6335ce80fe
Changeset: http://git.rtems.org/rtems/commit/?id=ba46b9368eaf57e8c2361c215ceb0d6335ce80fe
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Feb 14 14:04:21 2020 +0100
config: Add _SMP_Is_enabled
Move the is SMP enabled configuration constant out of the
configuration table.
Since this was the last configuration constant in
rtems_configuration_table, remove this type.
Update #3875.
---
cpukit/include/rtems/confdefs.h | 14 ++++----------
cpukit/include/rtems/config.h | 31 ++-----------------------------
cpukit/include/rtems/score/smp.h | 13 +++++++++++++
cpukit/libmisc/monitor/mon-mpci.c | 2 +-
4 files changed, 20 insertions(+), 40 deletions(-)
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index f8a4eb2..3741c9a 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -2633,20 +2633,14 @@ struct _reent *__getreent(void)
#error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined"
#endif
- /**
- * This is the primary Configuration Table for this application.
- */
- const rtems_configuration_table Configuration = {
- #ifdef RTEMS_SMP
+ #ifdef RTEMS_SMP
+ const bool _SMP_Is_enabled =
#ifdef _CONFIGURE_SMP_APPLICATION
- true
+ true;
#else
- false
+ false;
#endif
- #endif
- };
- #ifdef RTEMS_SMP
const uint32_t _SMP_Processor_configured_maximum =
_CONFIGURE_MAXIMUM_PROCESSORS;
#endif
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 5550397..4811d0e 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -73,28 +73,6 @@ typedef Stack_Allocator_allocate rtems_stack_allocate_hook;
typedef Stack_Allocator_free rtems_stack_free_hook;
/*
- * The following records define the Configuration Table. The
- * information contained in this table is required in all
- * RTEMS systems, whether single or multiprocessor. This
- * table primarily defines the following:
- *
- * + location and size of the RTEMS Workspace
- * + microseconds per clock tick
- * + clock ticks per task timeslice
- * + required number of each object type for each API configured
- */
-typedef struct {
- #ifdef RTEMS_SMP
- bool smp_enabled;
- #endif
-} rtems_configuration_table;
-
-/**
- * This is the configuration table generated by confdefs.h.
- */
-extern const rtems_configuration_table Configuration;
-
-/*
* Some handy macros to avoid dependencies on either the BSP
* or the exact format of the configuration table.
*/
@@ -182,13 +160,8 @@ uint32_t rtems_configuration_get_maximum_extensions( void );
* @retval true SMP mode of operation is enabled.
* @retval false Otherwise.
*/
-#ifdef RTEMS_SMP
- #define rtems_configuration_is_smp_enabled() \
- (Configuration.smp_enabled)
-#else
- #define rtems_configuration_is_smp_enabled() \
- false
-#endif
+#define rtems_configuration_is_smp_enabled() \
+ (_SMP_Is_enabled)
/**
* @brief Returns the configured maximum count of processors.
diff --git a/cpukit/include/rtems/score/smp.h b/cpukit/include/rtems/score/smp.h
index 2722fbd..36cfd98 100644
--- a/cpukit/include/rtems/score/smp.h
+++ b/cpukit/include/rtems/score/smp.h
@@ -37,6 +37,19 @@ extern "C" {
*/
/**
+ * @brief Indicates if SMP is enabled.
+ *
+ * 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 false.
+ */
+#if defined(RTEMS_SMP)
+ extern const bool _SMP_Is_enabled;
+#else
+ #define _SMP_Is_enabled false
+#endif
+
+/**
* @brief The configured processor maximum.
*
* In SMP configurations, this constant is defined by the application
diff --git a/cpukit/libmisc/monitor/mon-mpci.c b/cpukit/libmisc/monitor/mon-mpci.c
index 9616518..f6914aa 100644
--- a/cpukit/libmisc/monitor/mon-mpci.c
+++ b/cpukit/libmisc/monitor/mon-mpci.c
@@ -75,7 +75,7 @@ rtems_monitor_mpci_next(
_Objects_Allocator_lock();
*next_id += 1;
- return &Configuration;
+ return (const void *) (uintptr_t) 1;
failed:
*next_id = RTEMS_OBJECT_ID_FINAL;
More information about the vc
mailing list