Changeset 24b94c4 in rtems for testsuites/fstests


Ignore:
Timestamp:
Jul 30, 2018, 4:39:09 AM (19 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
16f3f10
Parents:
d56e68b
git-author:
Sebastian Huber <sebastian.huber@…> (07/30/18 04:39:09)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/07/18 05:17:16)
Message:

ramdisk: Use rtems_blkdev_create()

Update #3358.

Location:
testsuites/fstests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • testsuites/fstests/fsdosfsname01/init.c

    rd56e68b r24b94c4  
    6363
    6464#define BLOCK_SIZE 512
    65 
    66 #define BLOCK_COUNT ( sizeof( image_bin ) / BLOCK_SIZE )
    67 
    68 static ramdisk                            disk_image = {
    69   .block_size             = BLOCK_SIZE,
    70   .block_num              = BLOCK_COUNT,
    71   .area                   = &image_bin[0],
    72   .initialized            = true,
    73   .malloced               = false,
    74   .trace                  = false,
    75   .free_at_delete_request = false
    76 };
    7765
    7866static rtems_resource_snapshot            before_mount;
     
    987975{
    988976  int                       rc;
    989   rtems_status_code         sc;
    990   dev_t                     dev;
    991   char                      diskpath[] = "/dev/ramdisk1";
     977  char                      diskpath[] = "/dev/rdd";
    992978  rtems_dosfs_mount_options mount_opts;
    993   rtems_device_major_number major;
    994979  FILE                     *fp;
    995980  int                       buffer;
     
    1008993  rtems_test_assert( mount_opts.converter != NULL );
    1009994
    1010   sc = rtems_io_register_driver( 0, &ramdisk_ops, &major );
    1011   rtems_test_assert( sc == RTEMS_SUCCESSFUL );
    1012 
    1013   dev = rtems_filesystem_make_dev_t( major, 1 );
    1014 
    1015   sc  = rtems_disk_create_phys(
    1016     dev,
    1017     BLOCK_SIZE,
    1018     BLOCK_COUNT,
    1019     ramdisk_ioctl,
    1020     &disk_image,
    1021     diskpath );
    1022   rtems_test_assert( sc == RTEMS_SUCCESSFUL );
    1023 
    1024995  rc = mount_and_make_target_path(
    1025996    diskpath,
     
    14221393  { .block_size = BLOCK_SIZE, .block_num = BLOCK_NUM },
    14231394  { .block_size = BLOCK_SIZE, .block_num = BLOCK_NUM, .location = &IMAGE_BIN_LE_SINGLEBYTE[0] },
    1424   { .block_size = BLOCK_SIZE, .block_num = BLOCK_NUM, .location = &IMAGE_BIN_LE_MULTIBYTE[0] }
     1395  { .block_size = BLOCK_SIZE, .block_num = BLOCK_NUM, .location = &IMAGE_BIN_LE_MULTIBYTE[0] },
     1396  { .block_size = BLOCK_SIZE, .block_num = sizeof( image_bin ) / BLOCK_SIZE, .location = image_bin }
    14251397};
    14261398
     
    14301402#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
    14311403#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
    1432 #define CONFIGURE_MAXIMUM_DRIVERS 4
    14331404#define CONFIGURE_MAXIMUM_SEMAPHORES (2 * RTEMS_DOSFS_SEMAPHORES_PER_INSTANCE)
    14341405#define CONFIGURE_APPLICATION_EXTRA_DRIVERS RAMDISK_DRIVER_TABLE_ENTRY
  • testsuites/fstests/mdosfs_support/fs_support.c

    rd56e68b r24b94c4  
    8888#define CONFIGURE_MAXIMUM_SEMAPHORES RTEMS_DOSFS_SEMAPHORES_PER_INSTANCE
    8989#define CONFIGURE_MAXIMUM_TASKS                     10
    90 #define CONFIGURE_MAXIMUM_DRIVERS                   10
    9190#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS    40
    9291#define CONFIGURE_INIT_TASK_STACK_SIZE (16 * 1024)
  • testsuites/fstests/mrfs_support/fs_support.c

    rd56e68b r24b94c4  
    6767
    6868#define CONFIGURE_MAXIMUM_TASKS                     10
    69 #define CONFIGURE_MAXIMUM_DRIVERS                   10
    7069#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS    40
    7170#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024)
  • testsuites/fstests/support/ramdisk_support.c

    rd56e68b r24b94c4  
    1212#endif
    1313
    14 #include <sys/stat.h>
    15 #include <fcntl.h>
     14#include <unistd.h>
    1615
    1716#include <rtems/ramdisk.h>
    18 #include <rtems/blkdev.h>
    19 #include <rtems/libio.h>
    2017
    2118#include "ramdisk_support.h"
     
    2724 */
    2825
    29 dev_t dev = 0;
    30 
    3126void
    3227init_ramdisk (void)
     
    3429
    3530  int rc = 0;
    36   rc = rtems_disk_io_initialize ();
    37   rtems_test_assert (rc == 0);
     31
    3832  rc = ramdisk_register (RAMDISK_BLOCK_SIZE, RAMDISK_BLOCK_COUNT,
    39                          false, RAMDISK_PATH, &dev);
     33                         false, RAMDISK_PATH);
    4034  rtems_test_assert (rc == 0);
    4135}
     
    4640
    4741  int rc = 0;
    48   rtems_device_major_number major = 0;
    49   rtems_device_minor_number minor = 0;
    5042
    51   rc = rtems_disk_delete (dev);
     43  rc = unlink (RAMDISK_PATH);
    5244  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 
    6445}
Note: See TracChangeset for help on using the changeset viewer.