source: rtems/testsuites/fstests/mdosfs_support/fs_support.c @ e67025e

4.115
Last change on this file since e67025e was e67025e, checked in by Ralf Kirchner <ralf.kirchner@…>, on 05/22/13 at 10:10:33

dosfs: Add RTEMS_DOSFS_SEMAPHORES_PER_INSTANCE

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
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
7 *  http://www.rtems.com/license/LICENSE.
8 */
9#ifdef HAVE_CONFIG_H
10#include "config.h"
11#endif
12#include "pmacros.h"
13
14#include "fs_config.h"
15
16#include <sys/stat.h>
17#include <sys/types.h>
18
19#include <rtems/libio.h>
20#include <rtems/dosfs.h>
21#include <rtems/libcsupport.h>
22
23#include "ramdisk_support.h"
24#include "fstest.h"
25#include "fstest_support.h"
26
27#define BLOCK_SIZE 512
28
29static const msdos_format_request_param_t rqdata = {
30  .OEMName             = "RTEMS",
31  .VolLabel            = "RTEMSDisk",
32  .sectors_per_cluster = 2,
33  .fat_num             = 0,
34  .files_per_root_dir  = 0,
35  .media               = 0,
36  .quick_format        = true,
37  .skip_alignment      = 0,
38  .info_level          = 0
39};
40
41static rtems_resource_snapshot before_mount;
42
43void test_initialize_filesystem(void)
44{
45  int rc=0;
46  rc = mkdir (BASE_FOR_TEST,S_IRWXU|S_IRWXG|S_IRWXO);
47  rtems_test_assert(rc==0);
48
49  init_ramdisk();
50
51  rc=msdos_format(RAMDISK_PATH,&rqdata);
52  rtems_test_assert(rc==0);
53
54  rtems_resource_snapshot_take(&before_mount);
55
56  rc=mount(RAMDISK_PATH,
57      BASE_FOR_TEST,
58      "dosfs",
59      RTEMS_FILESYSTEM_READ_WRITE,
60      NULL);
61  rtems_test_assert(rc==0);
62}
63
64
65void test_shutdown_filesystem(void)
66{
67  int rc=0;
68  rc=unmount(BASE_FOR_TEST) ;
69  rtems_test_assert(rc==0);
70  rtems_test_assert(rtems_resource_snapshot_check(&before_mount));
71  del_ramdisk();
72}
73
74/* configuration information */
75
76/* drivers */
77#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
78#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
79
80/**
81 * Configure base RTEMS resources.
82 */
83#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
84
85#define CONFIGURE_MAXIMUM_SEMAPHORES RTEMS_DOSFS_SEMAPHORES_PER_INSTANCE
86#define CONFIGURE_MAXIMUM_TASKS                     10
87#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
88#define CONFIGURE_MAXIMUM_DRIVERS                   10
89#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS    40
90#define CONFIGURE_INIT_TASK_STACK_SIZE (16 * 1024)
91
92#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
93
94#define CONFIGURE_FILESYSTEM_DOSFS
95
96#define CONFIGURE_INIT
97#include <rtems/confdefs.h>
98
Note: See TracBrowser for help on using the repository browser.