source: rtems/testsuites/fstests/support/ramdisk_support.c @ d957805

4.115
Last change on this file since d957805 was d957805, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/07/11 at 07:42:12

2011-09-07 Ralf Corsépius <ralf.corsepius@…>

  • fserror/test.c, fslink/test.c, fspatheval/test.c, fspermission/test.c, fsrdwr/init.c, fssymlink/test.c, fstime/test.c, support/fstest_support.c, support/ramdisk_support.c: Add config-header support.
  • Property mode set to 100644
File size: 1.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 *  $Id$
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems/ramdisk.h>
17#include <rtems/blkdev.h>
18#include <rtems/libio.h>
19
20#include "ramdisk_support.h"
21#include "fstest.h"
22/*
23 * Ramdisk information
24 */
25
26dev_t dev = 0;
27
28void
29init_ramdisk (void)
30{
31
32  int rc = 0;
33  rc = rtems_disk_io_initialize ();
34  rtems_test_assert (rc == 0);
35  rc = ramdisk_register (RAMDISK_BLOCK_SIZE, RAMDISK_BLOCK_COUNT,
36                         false, RAMDISK_PATH, &dev);
37  rtems_test_assert (rc == 0);
38
39}
40
41void
42del_ramdisk (void)
43{
44
45  int rc = 0;
46  rtems_device_major_number major = 0;
47  rtems_device_minor_number minor = 0;
48
49  rc = rtems_disk_delete (dev);
50  rtems_test_assert (rc == 0);
51
52  rtems_filesystem_split_dev_t (dev, major, minor);
53
54  rtems_test_assert (major >= 0);
55  rtems_test_assert (minor >= 0);
56
57  rc = rtems_io_unregister_driver (major);
58  rtems_test_assert (rc == 0);
59  rc = rtems_disk_io_done ();
60  rtems_test_assert (rc == 0);
61
62}
Note: See TracBrowser for help on using the repository browser.