diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-01-25 21:18:41 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-02-03 10:00:57 +0100 |
commit | 3d36164fe5a366cf206ed3d2e8dc5b4d9e366c14 (patch) | |
tree | c39bf4f7e14cf897019d496e60cd6fa0445a4d60 | |
parent | posix: Delete empty _POSIX_API_Initialize() (diff) | |
download | rtems-3d36164fe5a366cf206ed3d2e8dc5b4d9e366c14.tar.bz2 |
Use linker set for root file system initialization
Update #2408.
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio.h | 2 | ||||
-rw-r--r-- | cpukit/libcsupport/src/libio_init.c | 5 | ||||
-rw-r--r-- | cpukit/sapi/include/confdefs.h | 11 | ||||
-rw-r--r-- | cpukit/score/include/rtems/sysinit.h | 1 | ||||
-rw-r--r-- | testsuites/sptests/spsysinit01/init.c | 24 |
5 files changed, 31 insertions, 12 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index 7a49978de0..28b4627c3e 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -1489,8 +1489,6 @@ extern const rtems_libio_helper rtems_libio_post_driver_helper; extern const rtems_libio_helper rtems_libio_exit_helper; -extern const rtems_libio_helper rtems_fs_init_helper; - void rtems_libio_helper_null(void); void rtems_libio_post_driver(void); diff --git a/cpukit/libcsupport/src/libio_init.c b/cpukit/libcsupport/src/libio_init.c index a14fe866f0..88f5d8cef3 100644 --- a/cpukit/libcsupport/src/libio_init.c +++ b/cpukit/libcsupport/src/libio_init.c @@ -80,9 +80,4 @@ void rtems_libio_init( void ) ); if ( rc != RTEMS_SUCCESSFUL ) rtems_fatal_error_occurred( rc ); - - /* - * Initialize the base file system infrastructure. - */ - (* rtems_fs_init_helper)(); } diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 8f5906d067..2c108ba78c 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -136,11 +136,12 @@ const rtems_libio_helper rtems_libio_exit_helper = rtems_libio_exit; #endif -const rtems_libio_helper rtems_fs_init_helper = - #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM - rtems_libio_helper_null; - #else - rtems_filesystem_initialize; + #ifndef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM + RTEMS_SYSINIT_ITEM( + rtems_filesystem_initialize, + RTEMS_SYSINIT_ROOT_FILESYSTEM, + RTEMS_SYSINIT_ORDER_MIDDLE + ); #endif #endif #endif diff --git a/cpukit/score/include/rtems/sysinit.h b/cpukit/score/include/rtems/sysinit.h index 72b21e8e1d..033ba871ed 100644 --- a/cpukit/score/include/rtems/sysinit.h +++ b/cpukit/score/include/rtems/sysinit.h @@ -57,6 +57,7 @@ extern "C" { #define RTEMS_SYSINIT_POSIX_KEYS 00036b #define RTEMS_SYSINIT_IDLE_THREADS 000380 #define RTEMS_SYSINIT_BSP_LIBC 000400 +#define RTEMS_SYSINIT_ROOT_FILESYSTEM 000401 #define RTEMS_SYSINIT_BEFORE_DRIVERS 000500 #define RTEMS_SYSINIT_BSP_PRE_DRIVERS 000600 #define RTEMS_SYSINIT_DEVICE_DRIVERS 000700 diff --git a/testsuites/sptests/spsysinit01/init.c b/testsuites/sptests/spsysinit01/init.c index d72cefea7d..645156e3d0 100644 --- a/testsuites/sptests/spsysinit01/init.c +++ b/testsuites/sptests/spsysinit01/init.c @@ -16,6 +16,8 @@ #include "config.h" #endif +#include <sys/stat.h> + #include <assert.h> #include <pthread.h> #include <string.h> @@ -122,6 +124,8 @@ typedef enum { IDLE_THREADS_POST, BSP_LIBC_PRE, BSP_LIBC_POST, + ROOT_FILESYSTEM_PRE, + ROOT_FILESYSTEM_POST, BEFORE_DRIVERS_PRE, BEFORE_DRIVERS_POST, BSP_PRE_DRIVERS_PRE, @@ -554,6 +558,26 @@ LAST(RTEMS_SYSINIT_BSP_LIBC) next_step(BSP_LIBC_POST); } +FIRST(RTEMS_SYSINIT_ROOT_FILESYSTEM) +{ + struct stat st; + int rv; + + rv = stat("/", &st); + assert(rv == -1); + next_step(ROOT_FILESYSTEM_PRE); +} + +LAST(RTEMS_SYSINIT_ROOT_FILESYSTEM) +{ + struct stat st; + int rv; + + rv = stat("/", &st); + assert(rv == 0); + next_step(ROOT_FILESYSTEM_POST); +} + FIRST(RTEMS_SYSINIT_BEFORE_DRIVERS) { /* Omit test of build configuration specific pre and post conditions */ |