Changeset e1b96b8 in rtems


Ignore:
Timestamp:
Feb 3, 2014, 12:43:21 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
3a638ce
Parents:
e5d706c
git-author:
Sebastian Huber <sebastian.huber@…> (02/03/14 12:43:21)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/03/14 12:44:36)
Message:

libtests/block11: Use custom device driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/block11/init.c

    re5d706c re1b96b8  
    5555static const char rda1 [] = "/dev/rda1";
    5656
     57static const char dev_invalid [] = "/dev/invalid";
     58
    5759static const char not_exist [] = "not_exist";
    5860
     
    6466
    6567static long area_b [AREA_SIZE / sizeof(long)];
     68
     69static rtems_status_code invalid_initialize(
     70  rtems_device_major_number major,
     71  rtems_device_minor_number minor,
     72  void *arg
     73)
     74{
     75  rtems_status_code sc;
     76
     77  sc = rtems_io_register_name(&dev_invalid[0], major, 0);
     78  ASSERT_SC(sc);
     79
     80  return sc;
     81}
     82
     83static rtems_status_code invalid_control(
     84  rtems_device_major_number major,
     85  rtems_device_minor_number minor,
     86  void *arg
     87)
     88{
     89  return RTEMS_INVALID_NUMBER;
     90}
    6691
    6792static void area_init(long *area)
     
    236261  ramdisk *rd;
    237262  void *opaque;
     263  struct stat st;
    238264
    239265  rd = ramdisk_allocate(NULL, BLOCK_SIZE, BLOCK_COUNT, false);
     
    299325  rtems_test_assert(sc == RTEMS_INVALID_ID);
    300326
    301   rv = mknod(not_blkdev, S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO, 0);
     327  rv = lstat(&dev_invalid[0], &st);
     328  rtems_test_assert(rv == 0);
     329
     330  rv = mknod(not_blkdev, S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO, st.st_rdev);
    302331  rtems_test_assert(rv == 0);
    303332
     
    310339  rtems_test_assert(sc == RTEMS_INVALID_NODE);
    311340
    312   rv = mknod(invalid_blkdev, S_IFBLK | S_IRWXU | S_IRWXG | S_IRWXO, 0);
     341  rv = mknod(invalid_blkdev, S_IFBLK | S_IRWXU | S_IRWXG | S_IRWXO, st.st_rdev);
    313342  rtems_test_assert(rv == 0);
    314343
     
    392421#define CONFIGURE_INIT
    393422
    394 #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
     423#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    395424#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
    396425#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
    397426
     427#define CONFIGURE_APPLICATION_EXTRA_DRIVERS \
     428  { .initialization_entry = invalid_initialize, \
     429    .control_entry = invalid_control }
     430
    398431#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
    399432#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5
Note: See TracChangeset for help on using the changeset viewer.