Changeset 16f3f10 in rtems for testsuites


Ignore:
Timestamp:
Jul 31, 2018, 1:54:29 PM (16 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
0fe7133
Parents:
24b94c4
git-author:
Sebastian Huber <sebastian.huber@…> (07/31/18 13:54:29)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/07/18 05:17:16)
Message:

nvdisk: Use rtems_blkdev_create()

Update #3358.

Location:
testsuites/samples/fileio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/samples/fileio/init.c

    r24b94c4 r16f3f10  
    7575 */
    7676uint32_t rtems_nvdisk_configuration_size = 1;
    77 
    78 /**
    79  * Create the NV Disk Driver entry.
    80  */
    81 rtems_driver_address_table rtems_nvdisk_io_ops = {
    82   initialization_entry: rtems_nvdisk_initialize,
    83   open_entry:           rtems_blkdev_generic_open,
    84   close_entry:          rtems_blkdev_generic_close,
    85   read_entry:           rtems_blkdev_generic_read,
    86   write_entry:          rtems_blkdev_generic_write,
    87   control_entry:        rtems_blkdev_generic_ioctl
    88 };
    89 
    90 #if 0
    91 int
    92 setup_nvdisk (const char* mntpath)
    93 {
    94   rtems_device_major_number major;
    95   rtems_status_code         sc;
    96 
    97   /*
    98    * For our test we do not have any static RAM or EEPROM devices so
    99    * we allocate the memory from the heap.
    100    */
    101   rtems_nv_heap_device_descriptor[0].base =
    102     malloc (rtems_nv_heap_device_descriptor[0].size);
    103 
    104   if (!rtems_nv_heap_device_descriptor[0].base)
    105   {
    106     printf ("error: no memory for NV disk\n");
    107     return 1;
    108   }
    109  
    110   /*
    111    * Register the NV Disk driver.
    112    */
    113   printf ("Register NV Disk Driver: ");
    114   sc = rtems_io_register_driver (RTEMS_DRIVER_AUTO_MAJOR,
    115                                  &rtems_nvdisk_io_ops,
    116                                  &major);
    117   if (sc != RTEMS_SUCCESSFUL)
    118   {
    119     printf ("error: nvdisk driver not initialised: %s\n",
    120             rtems_status_text (sc));
    121     return 1;
    122   }
    123  
    124   printf ("successful\n");
    125 
    126   return 0;
    127 }
    128 #endif
    12977
    13078/*
     
    474422create_nvdisk (int argc, char *argv[])
    475423{
    476   rtems_device_major_number major;
    477424  rtems_status_code         sc;
    478425  int                       arg;
     
    486433    if (argv[arg][0] == '-')
    487434    {
    488       switch (argv[arg][0])
     435      switch (argv[arg][1])
    489436      {
    490437        case 's':
     
    546493          rtems_nv_heap_device_descriptor[0].size,
    547494          rtems_nvdisk_configuration[0].block_size);
    548  
    549   sc = rtems_io_register_driver (RTEMS_DRIVER_AUTO_MAJOR,
    550                                  &rtems_nvdisk_io_ops,
    551                                  &major);
     495
     496  sc = rtems_nvdisk_initialize (0, 0, NULL);
    552497  if (sc != RTEMS_SUCCESSFUL)
    553498  {
  • testsuites/samples/fileio/system.h

    r24b94c4 r16f3f10  
    3636#endif
    3737
    38 #define CONFIGURE_MAXIMUM_DRIVERS           4
    3938#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
    4039#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
Note: See TracChangeset for help on using the changeset viewer.