diff options
-rw-r--r-- | c/src/lib/libbsp/shared/bsplibc.c | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/shared/bsppost.c | 7 | ||||
-rw-r--r-- | cpukit/libcsupport/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio.h | 15 | ||||
-rw-r--r-- | cpukit/libcsupport/src/libio_helper_null.c | 30 | ||||
-rw-r--r-- | cpukit/libcsupport/src/libio_init.c | 4 | ||||
-rw-r--r-- | cpukit/sapi/include/confdefs.h | 30 |
7 files changed, 57 insertions, 34 deletions
diff --git a/c/src/lib/libbsp/shared/bsplibc.c b/c/src/lib/libbsp/shared/bsplibc.c index 181dcff303..58fcf65210 100644 --- a/c/src/lib/libbsp/shared/bsplibc.c +++ b/c/src/lib/libbsp/shared/bsplibc.c @@ -3,7 +3,6 @@ * On-Line Applications Research Corporation (OAR). */ -#include <rtems.h> #include <rtems/libio.h> #include <rtems/libcsupport.h> @@ -16,8 +15,7 @@ void bsp_libc_init(void) * calls for use by newlib (ie: provide open, close, etc) * Uses malloc() to get area for the iops, so must be after malloc init */ - if (rtems_libio_init_helper) - (*rtems_libio_init_helper)(); + (*rtems_libio_init_helper)(); /* * Set up for the libc handling. diff --git a/c/src/lib/libbsp/shared/bsppost.c b/c/src/lib/libbsp/shared/bsppost.c index ec5e57ddf3..351e4d789c 100644 --- a/c/src/lib/libbsp/shared/bsppost.c +++ b/c/src/lib/libbsp/shared/bsppost.c @@ -12,16 +12,11 @@ * http://www.rtems.com/license/LICENSE. */ -#include <fcntl.h> - -#include <rtems.h> #include <rtems/libio.h> -#include <rtems/libcsupport.h> #include <bsp/bootcard.h> void bsp_postdriver_hook(void) { - if (rtems_libio_supp_helper) - (*rtems_libio_supp_helper)(); + (*rtems_libio_supp_helper)(); } diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am index 76147c9873..42de63cf1d 100644 --- a/cpukit/libcsupport/Makefile.am +++ b/cpukit/libcsupport/Makefile.am @@ -55,6 +55,7 @@ ASSOCIATION_C_FILES = src/assoclocalbyname.c \ BASE_FS_C_FILES = src/base_fs.c src/mount.c src/unmount.c src/libio.c \ src/mount-mgr.c src/mount-mktgt.c src/libio_init.c \ src/privateenv.c \ + src/libio_helper_null.c \ src/open_dev_console.c src/__usrenv.c src/rtems_mkdir.c TERMIOS_C_FILES = src/cfgetispeed.c src/cfgetospeed.c src/cfsetispeed.c \ diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index 51e25c98c7..02db6bb4e6 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -1386,16 +1386,17 @@ static inline rtems_device_minor_number rtems_filesystem_dev_minor_t( */ void rtems_filesystem_initialize( void ); -typedef void (*rtems_libio_init_functions_t)(void); -extern rtems_libio_init_functions_t rtems_libio_init_helper; +typedef void (*rtems_libio_helper)(void); -void open_dev_console(void); +extern const rtems_libio_helper rtems_libio_init_helper; -typedef void (*rtems_libio_supp_functions_t)(void); -extern rtems_libio_supp_functions_t rtems_libio_supp_helper; +extern const rtems_libio_helper rtems_libio_supp_helper; -typedef void (*rtems_fs_init_functions_t)(void); -extern rtems_fs_init_functions_t rtems_fs_init_helper; +extern const rtems_libio_helper rtems_fs_init_helper; + +void rtems_libio_helper_null(void); + +void open_dev_console(void); /** * @brief Creates a directory and all its parent directories according to diff --git a/cpukit/libcsupport/src/libio_helper_null.c b/cpukit/libcsupport/src/libio_helper_null.c new file mode 100644 index 0000000000..17bdb7a557 --- /dev/null +++ b/cpukit/libcsupport/src/libio_helper_null.c @@ -0,0 +1,30 @@ +/** + * @file + * + * @ingroup LibIO + */ + +/* + * Copyright (c) 2013 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Obere Lagerstr. 30 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#if HAVE_CONFIG_H + #include "config.h" +#endif + +#include <rtems/libio.h> + +void rtems_libio_helper_null(void) +{ + /* Do nothing */ +} diff --git a/cpukit/libcsupport/src/libio_init.c b/cpukit/libcsupport/src/libio_init.c index 3496b59b5e..655c2e353f 100644 --- a/cpukit/libcsupport/src/libio_init.c +++ b/cpukit/libcsupport/src/libio_init.c @@ -78,7 +78,5 @@ void rtems_libio_init( void ) /* * Initialize the base file system infrastructure. */ - - if (rtems_fs_init_helper) - (* rtems_fs_init_helper)(); + (* rtems_fs_init_helper)(); } diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 1e1e3bb39e..04d8ae2a12 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -92,26 +92,26 @@ extern rtems_driver_address_table Device_drivers[]; #include <rtems/libio.h> #ifdef CONFIGURE_INIT -rtems_libio_init_functions_t rtems_libio_init_helper = - #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM - NULL; - #else +const rtems_libio_helper rtems_libio_init_helper = + #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM + rtems_libio_helper_null; + #else rtems_libio_init; - #endif + #endif -rtems_libio_supp_functions_t rtems_libio_supp_helper = - #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM - NULL; - #else +const rtems_libio_helper rtems_libio_supp_helper = + #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM + rtems_libio_helper_null; + #else open_dev_console; - #endif + #endif -rtems_fs_init_functions_t rtems_fs_init_helper = - #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM - NULL; - #else +const rtems_libio_helper rtems_fs_init_helper = + #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM + rtems_libio_helper_null; + #else rtems_filesystem_initialize; - #endif + #endif #endif #endif |