From 16939b1876d2c75534191f5d46ae1c606c3bf2ad Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 9 Feb 2015 19:09:23 +0100 Subject: Filesystem: Simplify FIFO and pipe configuration --- cpukit/sapi/include/confdefs.h | 53 ++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 30 deletions(-) (limited to 'cpukit/sapi') diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 65d07facf6..211c6bc77f 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -219,6 +219,28 @@ const rtems_libio_helper rtems_fs_init_helper = #endif #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. * @@ -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 @@ -365,28 +380,6 @@ const rtems_libio_helper rtems_fs_init_helper = #endif #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 */ -- cgit v1.2.3