[rtems commit] Filesystem: Simplify FIFO and pipe configuration

Sebastian Huber sebh at rtems.org
Mon Feb 9 18:10:11 UTC 2015


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Feb  9 19:09:23 2015 +0100

Filesystem: Simplify FIFO and pipe configuration

---

 cpukit/sapi/include/confdefs.h       | 53 ++++++++++++++++--------------------
 testsuites/psxtests/psximfs02/init.c |  1 -
 testsuites/psxtests/psxpipe01/init.c |  1 -
 testsuites/sptests/spfifo02/init.c   |  1 -
 testsuites/sptests/spfifo03/init.c   |  1 -
 testsuites/sptests/spfifo04/init.c   |  3 --
 testsuites/sptests/spfifo05/init.c   |  1 -
 7 files changed, 23 insertions(+), 38 deletions(-)

diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index 65d07fa..211c6bc 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -220,6 +220,28 @@ const rtems_libio_helper rtems_fs_init_helper =
 #endif
 
 /*
+ * This sets up the resources for the FIFOs/pipes.
+ */
+
+#if !defined(CONFIGURE_MAXIMUM_FIFOS)
+  #define CONFIGURE_MAXIMUM_FIFOS 0
+#endif
+
+#if !defined(CONFIGURE_MAXIMUM_PIPES)
+  #define CONFIGURE_MAXIMUM_PIPES 0
+#endif
+
+#if CONFIGURE_MAXIMUM_FIFOS > 0 || CONFIGURE_MAXIMUM_PIPES > 0
+  #define CONFIGURE_BARRIERS_FOR_FIFOS \
+    (2 * (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES))
+  #define CONFIGURE_SEMAPHORES_FOR_FIFOS \
+    (1 + (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES))
+#else
+  #define CONFIGURE_BARRIERS_FOR_FIFOS   0
+  #define CONFIGURE_SEMAPHORES_FOR_FIFOS 0
+#endif
+
+/*
  *  Filesystems and Mount Table Configuration.
  *
  *  Defines to control the file system:
@@ -342,20 +364,13 @@ const rtems_libio_helper rtems_fs_init_helper =
 #endif
 #endif
 
-/**
- * Internall it is called FIFOs not pipes
- */
-#if defined(CONFIGURE_PIPES_ENABLED)
-  #define CONFIGURE_FIFOS_ENABLED
-#endif
-
 #ifndef RTEMS_SCHEDSIM
 /**
  * This defines the IMFS file system table entry.
  */
 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \
     defined(CONFIGURE_FILESYSTEM_IMFS)
-  #if defined(CONFIGURE_FIFOS_ENABLED)
+  #if CONFIGURE_MAXIMUM_FIFOS > 0 || CONFIGURE_MAXIMUM_PIPES > 0
     #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \
       { RTEMS_FILESYSTEM_TYPE_IMFS, fifoIMFS_initialize }
   #else
@@ -366,28 +381,6 @@ const rtems_libio_helper rtems_fs_init_helper =
 #endif
 
 /**
- * This sets up the resources for the PIPES/FIFOs
- */
-#if defined(CONFIGURE_FIFOS_ENABLED)
-  #if !defined(CONFIGURE_MAXIMUM_FIFOS) && !defined(CONFIGURE_MAXIMUM_PIPES)
-     #error "No FIFOs or PIPES configured"
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_FIFOS)
-    #define CONFIGURE_MAXIMUM_FIFOS 0
-  #endif
-  #if !defined(CONFIGURE_MAXIMUM_PIPES)
-    #define CONFIGURE_MAXIMUM_PIPES 0
-  #endif
-  #define CONFIGURE_BARRIERS_FOR_FIFOS \
-    (2 * (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES))
-  #define CONFIGURE_SEMAPHORES_FOR_FIFOS \
-    (1 + (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES))
-#else
-  #define CONFIGURE_BARRIERS_FOR_FIFOS   0
-  #define CONFIGURE_SEMAPHORES_FOR_FIFOS 0
-#endif
-
-/**
  * DEVFS
  */
 #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \
diff --git a/testsuites/psxtests/psximfs02/init.c b/testsuites/psxtests/psximfs02/init.c
index c7e2d3c..00a171f 100644
--- a/testsuites/psxtests/psximfs02/init.c
+++ b/testsuites/psxtests/psximfs02/init.c
@@ -217,7 +217,6 @@ rtems_task Init(
 
 #define CONFIGURE_INIT
 
-#define CONFIGURE_FIFOS_ENABLED
 #define CONFIGURE_MAXIMUM_FIFOS 1
 
 #include <rtems/confdefs.h>
diff --git a/testsuites/psxtests/psxpipe01/init.c b/testsuites/psxtests/psxpipe01/init.c
index 59dfe5b..5dc4909 100644
--- a/testsuites/psxtests/psxpipe01/init.c
+++ b/testsuites/psxtests/psxpipe01/init.c
@@ -109,7 +109,6 @@ rtems_task Init(
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
-#define CONFIGURE_PIPES_ENABLED
 #define CONFIGURE_MAXIMUM_PIPES 2
 
 #define CONFIGURE_INIT
diff --git a/testsuites/sptests/spfifo02/init.c b/testsuites/sptests/spfifo02/init.c
index 3cb6062..6472401 100644
--- a/testsuites/sptests/spfifo02/init.c
+++ b/testsuites/sptests/spfifo02/init.c
@@ -214,7 +214,6 @@ rtems_task Init(
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5
-#define CONFIGURE_FIFOS_ENABLED
 #define CONFIGURE_MAXIMUM_FIFOS 1
 
 #define CONFIGURE_INIT
diff --git a/testsuites/sptests/spfifo03/init.c b/testsuites/sptests/spfifo03/init.c
index 198ba54..0fb024a 100644
--- a/testsuites/sptests/spfifo03/init.c
+++ b/testsuites/sptests/spfifo03/init.c
@@ -216,7 +216,6 @@ rtems_task Init(
 #define CONFIGURE_MAXIMUM_BARRIERS 1
 
 #define CONFIGURE_INIT
-#define CONFIGURE_FIFOS_ENABLED
 #define CONFIGURE_MAXIMUM_FIFOS 1
 
 
diff --git a/testsuites/sptests/spfifo04/init.c b/testsuites/sptests/spfifo04/init.c
index aeb4f06..5e2d1c1 100644
--- a/testsuites/sptests/spfifo04/init.c
+++ b/testsuites/sptests/spfifo04/init.c
@@ -102,15 +102,12 @@ rtems_task Init(
 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 6
 
 #define CONFIGURE_MAXIMUM_TASKS 3
-#define CONFIGURE_MAXIMUM_BARRIERS 1
 #define CONFIGURE_MAXIMUM_FIFOS 1
 
 #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
 
 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
-#define CONFIGURE_FIFOS_ENABLED
-
 #define CONFIGURE_INIT
 #include <rtems/confdefs.h>
 /* end of file */
diff --git a/testsuites/sptests/spfifo05/init.c b/testsuites/sptests/spfifo05/init.c
index 8537154..1ccdd49 100644
--- a/testsuites/sptests/spfifo05/init.c
+++ b/testsuites/sptests/spfifo05/init.c
@@ -271,7 +271,6 @@ rtems_task Init(
 #define CONFIGURE_MAXIMUM_BARRIERS 2
 
 #define CONFIGURE_INIT
-#define CONFIGURE_FIFOS_ENABLED
 #define CONFIGURE_MAXIMUM_FIFOS 1
 
 



More information about the vc mailing list