[rtems commit] config: CONFIGURE_DISABLE_BSP_SETTINGS

Sebastian Huber sebh at rtems.org
Wed Nov 17 08:11:50 UTC 2021


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Nov 15 19:15:27 2021 +0100

config: CONFIGURE_DISABLE_BSP_SETTINGS

Evaluate CONFIGURE_DISABLE_BSP_SETTINGS for each affected application
configuration option.  This makes the code easier to review since the influence
of CONFIGURE_DISABLE_BSP_SETTINGS is locally visible in the code.

Update #3875.

---

 cpukit/include/rtems/confdefs/bsp.h        | 15 ++-------------
 cpukit/include/rtems/confdefs/extensions.h |  3 ++-
 cpukit/include/rtems/confdefs/iodrivers.h  |  3 ++-
 cpukit/include/rtems/confdefs/malloc.h     | 10 +++++++---
 cpukit/include/rtems/confdefs/percpu.h     |  9 ++++++---
 5 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/cpukit/include/rtems/confdefs/bsp.h b/cpukit/include/rtems/confdefs/bsp.h
index 03ad9bf..bc96713 100644
--- a/cpukit/include/rtems/confdefs/bsp.h
+++ b/cpukit/include/rtems/confdefs/bsp.h
@@ -41,19 +41,8 @@
 #error "Do not include this file directly, use <rtems/confdefs.h> instead"
 #endif
 
-#ifdef CONFIGURE_INIT
-
-#ifdef CONFIGURE_DISABLE_BSP_SETTINGS
-  #undef BSP_IDLE_TASK_BODY
-  #undef BSP_IDLE_TASK_STACK_SIZE
-  #undef BSP_INITIAL_EXTENSION
-  #undef BSP_INTERRUPT_STACK_SIZE
-  #undef CONFIGURE_BSP_PREREQUISITE_DRIVERS
-  #undef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
-#else
-  #include <bsp.h>
+#if defined(CONFIGURE_INIT) && !defined(CONFIGURE_DISABLE_BSP_SETTINGS)
+#include <bsp.h>
 #endif
 
-#endif /* CONFIGURE_INIT */
-
 #endif /* _RTEMS_CONFDEFS_BSP_H */
diff --git a/cpukit/include/rtems/confdefs/extensions.h b/cpukit/include/rtems/confdefs/extensions.h
index 6492407..118ad29 100644
--- a/cpukit/include/rtems/confdefs/extensions.h
+++ b/cpukit/include/rtems/confdefs/extensions.h
@@ -146,7 +146,8 @@ extern "C" {
     #ifdef CONFIGURE_INITIAL_EXTENSIONS
       CONFIGURE_INITIAL_EXTENSIONS,
     #endif
-    #ifdef BSP_INITIAL_EXTENSION
+    #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
+      defined(BSP_INITIAL_EXTENSION)
       BSP_INITIAL_EXTENSION
     #endif
   };
diff --git a/cpukit/include/rtems/confdefs/iodrivers.h b/cpukit/include/rtems/confdefs/iodrivers.h
index a7de77a..8c10219 100644
--- a/cpukit/include/rtems/confdefs/iodrivers.h
+++ b/cpukit/include/rtems/confdefs/iodrivers.h
@@ -110,7 +110,8 @@ extern "C" {
 
 rtems_driver_address_table
 _IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = {
-  #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS
+  #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
+    defined(CONFIGURE_BSP_PREREQUISITE_DRIVERS)
     CONFIGURE_BSP_PREREQUISITE_DRIVERS,
   #endif
   #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS
diff --git a/cpukit/include/rtems/confdefs/malloc.h b/cpukit/include/rtems/confdefs/malloc.h
index d864a98..a8dae6e 100644
--- a/cpukit/include/rtems/confdefs/malloc.h
+++ b/cpukit/include/rtems/confdefs/malloc.h
@@ -45,8 +45,12 @@
 
 #include <rtems/confdefs/bsp.h>
 
-#if defined(CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK) \
-  || defined(CONFIGURE_MALLOC_DIRTY)
+#if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
+  defined(CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK)
+#define _CONFIGURE_HEAP_EXTEND_VIA_SBRK
+#endif
+
+#if defined(_CONFIGURE_HEAP_EXTEND_VIA_SBRK) || defined(CONFIGURE_MALLOC_DIRTY)
 #include <rtems/malloc.h>
 #endif
 
@@ -54,7 +58,7 @@
 extern "C" {
 #endif
 
-#ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
+#ifdef _CONFIGURE_HEAP_EXTEND_VIA_SBRK
 const rtems_heap_extend_handler rtems_malloc_extend_handler =
   rtems_heap_extend_via_sbrk;
 #endif
diff --git a/cpukit/include/rtems/confdefs/percpu.h b/cpukit/include/rtems/confdefs/percpu.h
index 3bea834..b91590b 100644
--- a/cpukit/include/rtems/confdefs/percpu.h
+++ b/cpukit/include/rtems/confdefs/percpu.h
@@ -78,7 +78,8 @@ extern "C" {
 /* Interrupt stack configuration */
 
 #ifndef CONFIGURE_INTERRUPT_STACK_SIZE
-  #ifdef BSP_INTERRUPT_STACK_SIZE
+  #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
+    defined(BSP_INTERRUPT_STACK_SIZE)
     #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE
   #else
     #define CONFIGURE_INTERRUPT_STACK_SIZE CPU_STACK_MINIMUM_SIZE
@@ -121,7 +122,8 @@ RTEMS_DEFINE_GLOBAL_SYMBOL(
 /* Idle thread configuration */
 
 #ifndef CONFIGURE_IDLE_TASK_STACK_SIZE
-  #ifdef BSP_IDLE_TASK_STACK_SIZE
+  #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
+    defined(BSP_IDLE_TASK_STACK_SIZE)
     #define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE
   #else
     #define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
@@ -153,7 +155,8 @@ const size_t _Thread_Idle_stack_size = CONFIGURE_IDLE_TASK_STACK_SIZE;
   #error "If you define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION, then you must define CONFIGURE_IDLE_TASK_BODY as well"
 #endif
 
-#if !defined(CONFIGURE_IDLE_TASK_BODY) && defined(BSP_IDLE_TASK_BODY)
+#if !defined(CONFIGURE_IDLE_TASK_BODY) && \
+  !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && defined(BSP_IDLE_TASK_BODY)
   #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY
 #endif
 



More information about the vc mailing list