source: rtems/testsuites/fstests/mrfs_support/fs_support.c @ 24b94c4

Last change on this file since 24b94c4 was 24b94c4, checked in by Sebastian Huber <sebastian.huber@…>, on Jul 30, 2018 at 4:39:09 AM

ramdisk: Use rtems_blkdev_create()

Update #3358.

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[7336d4af]1/*
[858e013f]2 *  COPYRIGHT (c) 1989-2011.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
[c499856]7 *  http://www.rtems.org/license/LICENSE.
[7336d4af]8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13#include "pmacros.h"
14
15#include <sys/stat.h>
16#include <sys/types.h>
17
18#include <rtems/libio.h>
19#include <rtems/rtems-rfs-format.h>
[858e013f]20
[7336d4af]21#include "ramdisk_support.h"
22
[858e013f]23#include "fstest.h"
[28860ec0]24#include "fstest_support.h"
[858e013f]25
[7336d4af]26#define BLOCK_SIZE (512)
27
[4ec8180]28rtems_rfs_format_config rfs_config = {
[7336d4af]29block_size:BLOCK_SIZE
30};
31
32
[858e013f]33void
34test_initialize_filesystem (void)
[7336d4af]35{
[858e013f]36  int rc = 0;
37  rc = mkdir (BASE_FOR_TEST,S_IRWXU|S_IRWXG|S_IRWXO);
38  rtems_test_assert (rc == 0);
[7336d4af]39
[858e013f]40  init_ramdisk ();
[7336d4af]41
[4ec8180]42  rc = rtems_rfs_format (RAMDISK_PATH, &rfs_config);
[858e013f]43  rtems_test_assert (rc == 0);
[7336d4af]44
[858e013f]45  rc = mount (RAMDISK_PATH,
46              BASE_FOR_TEST, "rfs", RTEMS_FILESYSTEM_READ_WRITE, NULL);
47  rtems_test_assert (rc == 0);
[7336d4af]48}
49
50
[858e013f]51void
52test_shutdown_filesystem (void)
[7336d4af]53{
[858e013f]54  int rc = 0;
55  rc = unmount (BASE_FOR_TEST);
56  rtems_test_assert (rc == 0);
57  del_ramdisk ();
[7336d4af]58}
59
60/* configuration information */
61#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
[c4b8b147]62#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
[7336d4af]63
[bc75887]64#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
65
[7336d4af]66#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
67
[858e013f]68#define CONFIGURE_MAXIMUM_TASKS                     10
69#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS    40
[3b7c123]70#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024)
[07e1780]71#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
[5c0c0cf]72#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS     1
[858e013f]73
[7336d4af]74#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
75
76#define CONFIGURE_FILESYSTEM_RFS
77
78#define CONFIGURE_INIT
79#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.