[rtems commit] rtems: Avoid copy and paste in confdefs.h

Sebastian Huber sebh at rtems.org
Mon Jun 2 14:48:39 UTC 2014


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

Author:    Ralf Kirchner <ralf.kirchner at embedded-brains.de>
Date:      Mon Jun  2 14:42:18 2014 +0200

rtems: Avoid copy and paste in confdefs.h

Add and use CONFIGURE_POSIX_MUTEXES.
Add and use CONFIGURE_POSIX_CONDITION_VARIABLES.

---

 cpukit/sapi/include/confdefs.h |   80 ++++++++++++++++++++++++----------------
 1 files changed, 48 insertions(+), 32 deletions(-)

diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index 6978277..3b49ac5 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -2109,31 +2109,9 @@ const rtems_libio_helper rtems_fs_init_helper =
 
   #endif
 
-  #define CONFIGURE_MEMORY_FOR_POSIX \
-    ( CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES + \
-          CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES) + \
-      CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
-          CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + \
-          CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_CONDITION_VARIABLES) + \
-      CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
-          CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \
-      CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
-          CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \
-      CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS( \
-          CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS ) + \
-      CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
-          CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \
-      CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \
-      CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \
-          CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \
-      CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \
-          CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \
-      CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) \
-     )
 #else
 
   #define CONFIGURE_MAXIMUM_POSIX_THREADS         0
-  #define CONFIGURE_MEMORY_FOR_POSIX              0
 
 #endif    /* RTEMS_POSIX_API */
 
@@ -2225,6 +2203,50 @@ const rtems_libio_helper rtems_fs_init_helper =
      CONFIGURE_MAXIMUM_ADA_TASKS + \
      CONFIGURE_MAXIMUM_GOROUTINES)
 
+#ifdef RTEMS_POSIX_API
+  /**
+   * This macro provides summation of the POSIX Mutexes.
+   */
+  #define CONFIGURE_POSIX_MUTEXES \
+    (CONFIGURE_MAXIMUM_POSIX_MUTEXES + \
+      CONFIGURE_GNAT_MUTEXES + \
+      CONFIGURE_MAXIMUM_ADA_TASKS + \
+      CONFIGURE_MAXIMUM_FAKE_ADA_TASKS + \
+      CONFIGURE_GO_INIT_MUTEXES + \
+      CONFIGURE_MAXIMUM_GO_CHANNELS)
+
+  /**
+   * This macro provides summation of the POSIX Condition Variables.
+   */
+  #define CONFIGURE_POSIX_CONDITION_VARIABLES \
+    (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + \
+      CONFIGURE_MAXIMUM_ADA_TASKS + \
+      CONFIGURE_MAXIMUM_FAKE_ADA_TASKS + \
+      CONFIGURE_GO_INIT_CONDITION_VARIABLES + \
+      CONFIGURE_MAXIMUM_GO_CHANNELS)
+
+  #define CONFIGURE_MEMORY_FOR_POSIX \
+    (CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(CONFIGURE_POSIX_MUTEXES) + \
+      CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
+        CONFIGURE_POSIX_CONDITION_VARIABLES) + \
+      CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
+        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) + \
+      CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
+        CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + \
+      CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS( \
+        CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS) + \
+      CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
+        CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) + \
+      CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \
+      CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \
+        CONFIGURE_MAXIMUM_POSIX_SPINLOCKS) + \
+      CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \
+        CONFIGURE_MAXIMUM_POSIX_RWLOCKS) + \
+      CONFIGURE_MEMORY_FOR_POSIX_TIMERS(CONFIGURE_MAXIMUM_POSIX_TIMERS))
+#else
+  #define CONFIGURE_MEMORY_FOR_POSIX 0
+#endif
+
 /*
  *  Calculate the RAM size based on the maximum number of objects configured.
  */
@@ -2582,12 +2604,8 @@ const rtems_libio_helper rtems_fs_init_helper =
      */
     posix_api_configuration_table Configuration_POSIX_API = {
       CONFIGURE_POSIX_THREADS,
-      CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES +
-        CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS +
-        CONFIGURE_GO_INIT_MUTEXES + CONFIGURE_MAXIMUM_GO_CHANNELS,
-      CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
-        CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS +
-        CONFIGURE_GO_INIT_CONDITION_VARIABLES + CONFIGURE_MAXIMUM_GO_CHANNELS,
+      CONFIGURE_POSIX_MUTEXES,
+      CONFIGURE_POSIX_CONDITION_VARIABLES,
       CONFIGURE_MAXIMUM_POSIX_TIMERS,
       CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
       CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES,
@@ -2822,11 +2840,9 @@ const rtems_libio_helper rtems_fs_init_helper =
 
 #ifdef RTEMS_POSIX_API
     /* POSIX API Pieces */
-    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES +
-      CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES),
+    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_POSIX_MUTEXES ),
     CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(
-      CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
-      CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_CONDITION_VARIABLES),
+      CONFIGURE_POSIX_CONDITION_VARIABLES ),
     CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(
       CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ),
     CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(




More information about the vc mailing list