Use linker set for root file system initialization

Update #2408.
This commit is contained in:
Sebastian Huber
2016-01-25 21:18:41 +01:00
parent 529b08a705
commit 3d36164fe5
5 changed files with 31 additions and 12 deletions

View File

@@ -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);

View File

@@ -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)();
}

View File

@@ -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

View File

@@ -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

View File

@@ -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 */