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

4.115
Last change on this file since 32448524 was 32448524, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/30/11 at 03:07:21

2011-09-30 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: Explicitly include "pmacros.h".
  • support/fstest.h: Don't include "pmacros.h".
  • 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#include "pmacros.h"
23
24/*
25 * Ramdisk information
26 */
27
28dev_t dev = 0;
29
30void
31init_ramdisk (void)
32{
33
34  int rc = 0;
35  rc = rtems_disk_io_initialize ();
36  rtems_test_assert (rc == 0);
37  rc = ramdisk_register (RAMDISK_BLOCK_SIZE, RAMDISK_BLOCK_COUNT,
38                         false, RAMDISK_PATH, &dev);
39  rtems_test_assert (rc == 0);
40
41}
42
43void
44del_ramdisk (void)
45{
46
47  int rc = 0;
48  rtems_device_major_number major = 0;
49  rtems_device_minor_number minor = 0;
50
51  rc = rtems_disk_delete (dev);
52  rtems_test_assert (rc == 0);
53
54  rtems_filesystem_split_dev_t (dev, major, minor);
55
56  rtems_test_assert (major >= 0);
57  rtems_test_assert (minor >= 0);
58
59  rc = rtems_io_unregister_driver (major);
60  rtems_test_assert (rc == 0);
61  rc = rtems_disk_io_done ();
62  rtems_test_assert (rc == 0);
63
64}
Note: See TracBrowser for help on using the repository browser.