Changeset e308b3a7 in rtems


Ignore:
Timestamp:
May 31, 2012, 9:06:50 AM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Children:
6b24b88
Parents:
486f8b84 (diff), f164ae75 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'upstream'

Files:
1 added
27 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/startup/linkcmds

    r486f8b84 re308b3a7  
    8080    *(set_domain_*);
    8181    *(set_pseudo_*);
     82    _bsd__start_set_modmetadata_set = .;
     83    *(_bsd_set_modmetadata_set);
     84    _bsd__stop_set_modmetadata_set = .;
     85    _bsd__start_set_sysctl_set = .;
     86    *(_bsd_set_sysctl_set);
     87    _bsd__stop_set_sysctl_set = .;
     88    _bsd__start_set_sysinit_set = .;
     89    *(_bsd_set_sysinit_*);
     90    _bsd__stop_set_sysinit_set = .;
     91
     92    bsp_section_rodata_end = .;
    8293
    8394  } =0x90909090
  • cpukit/libblock/Makefile.am

    r486f8b84 re308b3a7  
    99    src/blkdev-ops.c \
    1010    src/diskdevs.c \
     11    src/diskdevs-init.c \
    1112    src/flashdisk.c \
    1213    src/ramdisk-driver.c \
  • cpukit/libblock/include/rtems/bdbuf.h

    r486f8b84 re308b3a7  
    142142 * to another requester until released back to the cache.  The same goes to a
    143143 * buffer in the transfer state.  The transfer state means being read or
    144  * written.  If the file system has modifed the block and releases it as
     144 * written.  If the file system has modified the block and releases it as
    145145 * modified it placed on the cache's modified list and a hold timer
    146146 * initialised.  The buffer is held for the hold time before being written to
     
    364364  rtems_task_priority swapout_priority;        /**< Priority of the swap out
    365365                                                * task. */
    366   uint32_t            swapout_period;          /**< Period swapout checks buf
     366  uint32_t            swapout_period;          /**< Period swap-out checks buf
    367367                                                * timers. */
    368368  uint32_t            swap_block_hold;         /**< Period a buffer is held. */
    369369  size_t              swapout_workers;         /**< The number of worker
    370                                                 * threads for the swapout
     370                                                * threads for the swap-out
    371371                                                * task. */
    372372  rtems_task_priority swapout_worker_priority; /**< Priority of the swap out
    373373                                                * task. */
     374  size_t              task_stack_size;         /**< Task stack size for swap-out
     375                                                * task and worker threads. */
    374376  size_t              size;                    /**< Size of memory in the
    375377                                                * cache */
     
    419421
    420422/**
    421  * Default swap-out worker task priority. The same as the swapout task.
     423 * Default swap-out worker task priority. The same as the swap-out task.
    422424 */
    423425#define RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT \
    424426                             RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT
     427
     428/**
     429 * Default task stack size for swap-out and worker tasks.
     430 */
     431#define RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT RTEMS_MINIMUM_STACK_SIZE
    425432
    426433/**
     
    456463/**
    457464 * Get block buffer for data to be written into. The buffers is set to the
    458  * access or modifed access state. If the buffer is in the cache and modified
     465 * access or modified access state. If the buffer is in the cache and modified
    459466 * the state is access modified else the state is access. This buffer contents
    460467 * are not initialised if the buffer is not already in the cache. If the block
     
    484491rtems_status_code
    485492rtems_bdbuf_get (
    486   const rtems_disk_device *dd,
     493  rtems_disk_device *dd,
    487494  rtems_blkdev_bnum block,
    488495  rtems_bdbuf_buffer** bd
     
    492499 * Get the block buffer and if not already in the cache read from the disk. If
    493500 * specified block already cached return. The buffer is set to the access or
    494  * modifed access state. If the buffer is in the cache and modified the state
     501 * modified access state. If the buffer is in the cache and modified the state
    495502 * is access modified else the state is access. If block is already being read
    496503 * from disk for being written to disk this call blocks. If the buffer is
     
    518525rtems_status_code
    519526rtems_bdbuf_read (
    520   const rtems_disk_device *dd,
     527  rtems_disk_device *dd,
    521528  rtems_blkdev_bnum block,
    522529  rtems_bdbuf_buffer** bd
     
    595602 * Synchronize all modified buffers for this device with the disk and wait
    596603 * until the transfers have completed. The sync mutex for the cache is locked
    597  * stopping the addition of any further modifed buffers. It is only the
     604 * stopping the addition of any further modified buffers. It is only the
    598605 * currently modified buffers that are written.
    599606 *
     
    610617 */
    611618rtems_status_code
    612 rtems_bdbuf_syncdev (const rtems_disk_device *dd);
     619rtems_bdbuf_syncdev (rtems_disk_device *dd);
    613620
    614621/**
     
    624631 */
    625632void
    626 rtems_bdbuf_purge_dev (const rtems_disk_device *dd);
     633rtems_bdbuf_purge_dev (rtems_disk_device *dd);
    627634
    628635/**
    629636 * @brief Sets the block size of a disk device.
    630637 *
    631  * This will also change the block_to_media_block_shift and bds_per_group
    632  * fields of the disk device.
     638 * This will set the block size derived fields of the disk device.
    633639 *
    634640 * Before you can use this function, the rtems_bdbuf_init() routine must be
  • cpukit/libblock/include/rtems/bdpart.h

    r486f8b84 re308b3a7  
    401401  const char *disk_name,
    402402  int *fd_ptr,
    403   const rtems_disk_device **dd_ptr,
     403  rtems_disk_device **dd_ptr,
    404404  rtems_blkdev_bnum *disk_end
    405405);
  • cpukit/libblock/include/rtems/blkdev.h

    r486f8b84 re308b3a7  
    193193static inline int rtems_disk_fd_get_disk_device(
    194194  int fd,
    195   const rtems_disk_device **dd_ptr
     195  rtems_disk_device **dd_ptr
    196196)
    197197{
  • cpukit/libblock/include/rtems/diskdevs.h

    r486f8b84 re308b3a7  
    9393
    9494  /**
    95    * @brief Start block number.
    96    *
    97    * Equals zero for physical devices.  It is a block offset to the related
    98    * physical device for logical device.
     95   * @brief Start media block number.
     96   *
     97   * Equals zero for physical devices.  It is a media block offset to the
     98   * related physical device for logical device.
    9999   */
    100100  rtems_blkdev_bnum start;
    101101
    102102  /**
    103    * @brief Size of the physical or logical disk in blocks.
     103   * @brief Size of the physical or logical disk in media blocks.
    104104   */
    105105  rtems_blkdev_bnum size;
    106106
    107107  /**
    108    * @brief Device block size in bytes.
    109    *
    110    * This is the minimum transfer unit.  It must be positive.
     108   * @brief Media block size in bytes.
     109   *
     110   * This is the media transfer unit the hardware defaults to.
     111   */
     112  uint32_t media_block_size;
     113
     114  /**
     115   * @brief Block size in bytes.
     116   *
     117   * This is the minimum transfer unit.  It may be a multiple of the media
     118   * block size. It must be positive.
    111119   *
    112120   * @see rtems_bdbuf_set_block_size().
     
    115123
    116124  /**
    117    * @brief Device media block size in bytes.
    118    *
    119    * This is the media transfer unit the hardware defaults to.
    120    */
    121   uint32_t media_block_size;
     125   * @brief Block count.
     126   *
     127   * @see rtems_bdbuf_set_block_size().
     128   */
     129  rtems_blkdev_bnum block_count;
     130
     131  /**
     132   * @brief Media blocks per device blocks.
     133   *
     134   * @see rtems_bdbuf_set_block_size().
     135   */
     136  uint32_t media_blocks_per_block;
    122137
    123138  /**
     
    260275 * A logical disk manages a subset of consecutive blocks contained in the
    261276 * physical disk with identifier @a phys.  The start block index of the logical
    262  * disk device is @a begin_block.  The block count of the logcal disk will be
     277 * disk device is @a block_begin.  The block count of the logcal disk will be
    263278 * @a block_count.  The blocks must be within the range of blocks managed by
    264279 * the associated physical disk device.  A device node will be registered in
     
    279294  dev_t dev,
    280295  dev_t phys,
    281   rtems_blkdev_bnum begin_block,
     296  rtems_blkdev_bnum block_begin,
    282297  rtems_blkdev_bnum block_count,
    283298  const char *name
     
    374389rtems_disk_device *rtems_disk_next(dev_t dev);
    375390
     391/* Internal function, do not use */
     392rtems_status_code rtems_disk_init_phys(
     393  rtems_disk_device *dd,
     394  uint32_t block_size,
     395  rtems_blkdev_bnum block_count,
     396  rtems_block_device_ioctl handler,
     397  void *driver_data
     398);
     399
     400/* Internal function, do not use */
     401rtems_status_code rtems_disk_init_log(
     402  rtems_disk_device *dd,
     403  rtems_disk_device *phys_dd,
     404  rtems_blkdev_bnum block_begin,
     405  rtems_blkdev_bnum block_count
     406);
     407
    376408#ifdef __cplusplus
    377409}
  • cpukit/libblock/src/bdbuf.c

    r486f8b84 re308b3a7  
    174174#define RTEMS_BLKDEV_FATAL_BDBUF_SO_NOMEM      RTEMS_BLKDEV_FATAL_ERROR(21)
    175175#define RTEMS_BLKDEV_FATAL_BDBUF_SO_WK_CREATE  RTEMS_BLKDEV_FATAL_ERROR(22)
    176 #define RTEMS_BLKDEV_FATAL_BDBUF_SO_WK_START   RTEMS_BLKDEV_FATAL_ERROR(23)
    177176#define BLKDEV_FATAL_BDBUF_SWAPOUT_RE          RTEMS_BLKDEV_FATAL_ERROR(24)
    178177#define BLKDEV_FATAL_BDBUF_SWAPOUT_TS          RTEMS_BLKDEV_FATAL_ERROR(25)
     
    189188#define RTEMS_BDBUF_TRANSFER_SYNC  RTEMS_EVENT_1
    190189#define RTEMS_BDBUF_SWAPOUT_SYNC   RTEMS_EVENT_2
    191 
    192 /**
    193  * The swap out task size. Should be more than enough for most drivers with
    194  * tracing turned on.
    195  */
    196 #define SWAPOUT_TASK_STACK_SIZE (8 * 1024)
    197190
    198191/**
     
    12441237static rtems_bdbuf_buffer *
    12451238rtems_bdbuf_get_buffer_from_lru_list (const rtems_disk_device *dd,
    1246                                       rtems_blkdev_bnum block,
    1247                                       size_t            bds_per_group)
     1239                                      rtems_blkdev_bnum block)
    12481240{
    12491241  rtems_chain_node *node = rtems_chain_first (&bdbuf_cache.lru);
     
    12581250              bd - bdbuf_cache.bds,
    12591251              bd->group - bdbuf_cache.groups, bd->group->users,
    1260               bd->group->bds_per_group, bds_per_group);
     1252              bd->group->bds_per_group, dd->bds_per_group);
    12611253
    12621254    /*
     
    12651257    if (bd->waiters == 0)
    12661258    {
    1267       if (bd->group->bds_per_group == bds_per_group)
     1259      if (bd->group->bds_per_group == dd->bds_per_group)
    12681260      {
    12691261        rtems_bdbuf_remove_from_tree_and_lru_list (bd);
     
    12721264      }
    12731265      else if (bd->group->users == 0)
    1274         empty_bd = rtems_bdbuf_group_realloc (bd->group, bds_per_group);
     1266        empty_bd = rtems_bdbuf_group_realloc (bd->group, dd->bds_per_group);
    12751267    }
    12761268
     
    12861278
    12871279  return NULL;
     1280}
     1281
     1282static rtems_status_code
     1283rtems_bdbuf_create_task(
     1284  rtems_name name,
     1285  rtems_task_priority priority,
     1286  rtems_task_priority default_priority,
     1287  rtems_task_entry entry,
     1288  rtems_task_argument arg,
     1289  rtems_id *id
     1290)
     1291{
     1292  rtems_status_code sc;
     1293  size_t stack_size = bdbuf_config.task_stack_size ?
     1294    bdbuf_config.task_stack_size : RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT;
     1295
     1296  priority = priority != 0 ? priority : default_priority;
     1297
     1298  sc = rtems_task_create (name,
     1299                          priority,
     1300                          stack_size,
     1301                          RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR,
     1302                          RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT,
     1303                          id);
     1304
     1305  if (sc == RTEMS_SUCCESSFUL)
     1306    sc = rtems_task_start (*id, entry, arg);
     1307
     1308  return sc;
    12881309}
    12891310
     
    14571478  bdbuf_cache.swapout_enabled = true;
    14581479
    1459   sc = rtems_task_create (rtems_build_name('B', 'S', 'W', 'P'),
    1460                           bdbuf_config.swapout_priority ?
    1461                             bdbuf_config.swapout_priority :
    1462                             RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT,
    1463                           SWAPOUT_TASK_STACK_SIZE,
    1464                           RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR,
    1465                           RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT,
    1466                           &bdbuf_cache.swapout);
    1467   if (sc != RTEMS_SUCCESSFUL)
    1468     goto error;
    1469 
    1470   sc = rtems_task_start (bdbuf_cache.swapout,
    1471                          rtems_bdbuf_swapout_task,
    1472                          (rtems_task_argument) &bdbuf_cache);
     1480  sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'),
     1481                                bdbuf_config.swapout_priority,
     1482                                RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT,
     1483                                rtems_bdbuf_swapout_task,
     1484                                0,
     1485                                &bdbuf_cache.swapout);
    14731486  if (sc != RTEMS_SUCCESSFUL)
    14741487    goto error;
     
    16751688static rtems_bdbuf_buffer *
    16761689rtems_bdbuf_get_buffer_for_read_ahead (const rtems_disk_device *dd,
    1677                                        rtems_blkdev_bnum block,
    1678                                        size_t            bds_per_group)
     1690                                       rtems_blkdev_bnum block)
    16791691{
    16801692  rtems_bdbuf_buffer *bd = NULL;
     
    16841696  if (bd == NULL)
    16851697  {
    1686     bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block, bds_per_group);
     1698    bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block);
    16871699
    16881700    if (bd != NULL)
     
    17011713static rtems_bdbuf_buffer *
    17021714rtems_bdbuf_get_buffer_for_access (const rtems_disk_device *dd,
    1703                                    rtems_blkdev_bnum block,
    1704                                    size_t            bds_per_group)
     1715                                   rtems_blkdev_bnum block)
    17051716{
    17061717  rtems_bdbuf_buffer *bd = NULL;
     
    17121723    if (bd != NULL)
    17131724    {
    1714       if (bd->group->bds_per_group != bds_per_group)
     1725      if (bd->group->bds_per_group != dd->bds_per_group)
    17151726      {
    17161727        if (rtems_bdbuf_wait_for_recycle (bd))
     
    17251736    else
    17261737    {
    1727       bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block, bds_per_group);
     1738      bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block);
    17281739
    17291740      if (bd == NULL)
     
    17441755                             rtems_blkdev_bnum       *media_block_ptr)
    17451756{
    1746   /*
    1747    * Compute the media block number. Drivers work with media block number not
    1748    * the block number a BD may have as this depends on the block size set by
    1749    * the user.
    1750    */
    1751   rtems_blkdev_bnum mb = rtems_bdbuf_media_block (dd, block);
    1752   if (mb >= dd->size)
    1753   {
    1754     return RTEMS_INVALID_ID;
    1755   }
    1756 
    1757   *media_block_ptr = mb + dd->start;
    1758 
    1759   return RTEMS_SUCCESSFUL;
     1757  rtems_status_code sc = RTEMS_SUCCESSFUL;
     1758
     1759  if (block < dd->block_count)
     1760  {
     1761    /*
     1762     * Compute the media block number. Drivers work with media block number not
     1763     * the block number a BD may have as this depends on the block size set by
     1764     * the user.
     1765     */
     1766    *media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
     1767  }
     1768  else
     1769  {
     1770    sc = RTEMS_INVALID_ID;
     1771  }
     1772
     1773  return sc;
    17601774}
    17611775
    17621776rtems_status_code
    1763 rtems_bdbuf_get (const rtems_disk_device *dd,
     1777rtems_bdbuf_get (rtems_disk_device  *dd,
    17641778                 rtems_blkdev_bnum    block,
    17651779                 rtems_bdbuf_buffer **bd_ptr)
     
    17671781  rtems_status_code   sc = RTEMS_SUCCESSFUL;
    17681782  rtems_bdbuf_buffer *bd = NULL;
    1769   rtems_blkdev_bnum   media_block = 0;
     1783  rtems_blkdev_bnum   media_block;
     1784
     1785  rtems_bdbuf_lock_cache ();
    17701786
    17711787  sc = rtems_bdbuf_get_media_block (dd, block, &media_block);
    1772   if (sc != RTEMS_SUCCESSFUL)
    1773     return sc;
    1774 
    1775   rtems_bdbuf_lock_cache ();
    1776 
    1777   /*
    1778    * Print the block index relative to the physical disk.
    1779    */
    1780   if (rtems_bdbuf_tracer)
    1781     printf ("bdbuf:get: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n",
    1782             media_block, block, (unsigned) dd->dev);
    1783 
    1784   bd = rtems_bdbuf_get_buffer_for_access (dd, media_block, dd->bds_per_group);
    1785 
    1786   switch (bd->state)
    1787   {
    1788     case RTEMS_BDBUF_STATE_CACHED:
    1789       rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED);
    1790       break;
    1791     case RTEMS_BDBUF_STATE_EMPTY:
    1792       rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_EMPTY);
    1793       break;
    1794     case RTEMS_BDBUF_STATE_MODIFIED:
    1795       /*
    1796        * To get a modified buffer could be considered a bug in the caller
    1797        * because you should not be getting an already modified buffer but user
    1798        * may have modified a byte in a block then decided to seek the start and
    1799        * write the whole block and the file system will have no record of this
    1800        * so just gets the block to fill.
    1801        */
    1802       rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED);
    1803       break;
    1804     default:
    1805       rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_2);
    1806       break;
    1807   }
    1808 
    1809   if (rtems_bdbuf_tracer)
    1810   {
    1811     rtems_bdbuf_show_users ("get", bd);
    1812     rtems_bdbuf_show_usage ();
     1788  if (sc == RTEMS_SUCCESSFUL)
     1789  {
     1790    /*
     1791     * Print the block index relative to the physical disk.
     1792     */
     1793    if (rtems_bdbuf_tracer)
     1794      printf ("bdbuf:get: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n",
     1795              media_block, block, (unsigned) dd->dev);
     1796
     1797    bd = rtems_bdbuf_get_buffer_for_access (dd, media_block);
     1798
     1799    switch (bd->state)
     1800    {
     1801      case RTEMS_BDBUF_STATE_CACHED:
     1802        rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED);
     1803        break;
     1804      case RTEMS_BDBUF_STATE_EMPTY:
     1805        rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_EMPTY);
     1806        break;
     1807      case RTEMS_BDBUF_STATE_MODIFIED:
     1808        /*
     1809         * To get a modified buffer could be considered a bug in the caller
     1810         * because you should not be getting an already modified buffer but
     1811         * user may have modified a byte in a block then decided to seek the
     1812         * start and write the whole block and the file system will have no
     1813         * record of this so just gets the block to fill.
     1814         */
     1815        rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED);
     1816        break;
     1817      default:
     1818        rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_2);
     1819        break;
     1820    }
     1821
     1822    if (rtems_bdbuf_tracer)
     1823    {
     1824      rtems_bdbuf_show_users ("get", bd);
     1825      rtems_bdbuf_show_usage ();
     1826    }
    18131827  }
    18141828
     
    18171831  *bd_ptr = bd;
    18181832
    1819   return RTEMS_SUCCESSFUL;
     1833  return sc;
    18201834}
    18211835
     
    18421856rtems_bdbuf_create_read_request (const rtems_disk_device *dd,
    18431857                                 rtems_blkdev_bnum        media_block,
    1844                                  size_t                   bds_per_group,
    18451858                                 rtems_blkdev_request    *req,
    18461859                                 rtems_bdbuf_buffer     **bd_ptr)
     
    18651878  req->bufnum = 0;
    18661879
    1867   bd = rtems_bdbuf_get_buffer_for_access (dd, media_block, bds_per_group);
     1880  bd = rtems_bdbuf_get_buffer_for_access (dd, media_block);
    18681881
    18691882  *bd_ptr = bd;
     
    18941907    media_block += media_block_count;
    18951908
    1896     bd = rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block,
    1897                                                 bds_per_group);
     1909    bd = rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block);
    18981910
    18991911    if (bd == NULL)
     
    19791991
    19801992rtems_status_code
    1981 rtems_bdbuf_read (const rtems_disk_device *dd,
     1993rtems_bdbuf_read (rtems_disk_device  *dd,
    19821994                  rtems_blkdev_bnum    block,
    19831995                  rtems_bdbuf_buffer **bd_ptr)
     
    19861998  rtems_blkdev_request *req = NULL;
    19871999  rtems_bdbuf_buffer   *bd = NULL;
    1988   rtems_blkdev_bnum     media_block = 0;
    1989 
    1990   sc = rtems_bdbuf_get_media_block (dd, block, &media_block);
    1991   if (sc != RTEMS_SUCCESSFUL)
    1992     return sc;
     2000  rtems_blkdev_bnum     media_block;
    19932001
    19942002  /*
     
    20012009                      (bdbuf_config.max_read_ahead_blocks + 1));
    20022010
    2003   if (rtems_bdbuf_tracer)
    2004     printf ("bdbuf:read: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n",
    2005             media_block + dd->start, block, (unsigned) dd->dev);
    2006 
    20072011  rtems_bdbuf_lock_cache ();
    2008   rtems_bdbuf_create_read_request (dd, media_block, dd->bds_per_group, req, &bd);
    2009 
    2010   if (req->bufnum > 0)
    2011   {
    2012     sc = rtems_bdbuf_execute_transfer_request (dd, req, true);
     2012
     2013  sc = rtems_bdbuf_get_media_block (dd, block, &media_block);
     2014  if (sc == RTEMS_SUCCESSFUL)
     2015  {
     2016    if (rtems_bdbuf_tracer)
     2017      printf ("bdbuf:read: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n",
     2018              media_block + dd->start, block, (unsigned) dd->dev);
     2019
     2020    rtems_bdbuf_create_read_request (dd, media_block, req, &bd);
     2021
     2022    if (req->bufnum > 0)
     2023    {
     2024      sc = rtems_bdbuf_execute_transfer_request (dd, req, true);
     2025      if (sc == RTEMS_SUCCESSFUL)
     2026      {
     2027        rtems_chain_extract_unprotected (&bd->link);
     2028        rtems_bdbuf_group_obtain (bd);
     2029      }
     2030    }
     2031
    20132032    if (sc == RTEMS_SUCCESSFUL)
    20142033    {
    2015       rtems_chain_extract_unprotected (&bd->link);
    2016       rtems_bdbuf_group_obtain (bd);
    2017     }
    2018   }
    2019 
    2020   if (sc == RTEMS_SUCCESSFUL)
    2021   {
    2022     switch (bd->state)
    2023     {
    2024       case RTEMS_BDBUF_STATE_CACHED:
    2025         rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED);
    2026         break;
    2027       case RTEMS_BDBUF_STATE_MODIFIED:
    2028         rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED);
    2029         break;
    2030       default:
    2031         rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_4);
    2032         break;
    2033     }
    2034 
    2035     if (rtems_bdbuf_tracer)
    2036     {
    2037       rtems_bdbuf_show_users ("read", bd);
    2038       rtems_bdbuf_show_usage ();
    2039     }
    2040 
    2041     *bd_ptr = bd;
    2042   }
    2043   else
    2044     *bd_ptr = NULL;
     2034      switch (bd->state)
     2035      {
     2036        case RTEMS_BDBUF_STATE_CACHED:
     2037          rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED);
     2038          break;
     2039        case RTEMS_BDBUF_STATE_MODIFIED:
     2040          rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED);
     2041          break;
     2042        default:
     2043          rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_4);
     2044          break;
     2045      }
     2046
     2047      if (rtems_bdbuf_tracer)
     2048      {
     2049        rtems_bdbuf_show_users ("read", bd);
     2050        rtems_bdbuf_show_usage ();
     2051      }
     2052    }
     2053    else
     2054    {
     2055      bd = NULL;
     2056    }
     2057  }
    20452058
    20462059  rtems_bdbuf_unlock_cache ();
     2060
     2061  *bd_ptr = bd;
    20472062
    20482063  return sc;
     
    21632178
    21642179rtems_status_code
    2165 rtems_bdbuf_syncdev (const rtems_disk_device *dd)
     2180rtems_bdbuf_syncdev (rtems_disk_device *dd)
    21662181{
    21672182  if (rtems_bdbuf_tracer)
     
    26402655    worker->transfer.dd = BDBUF_INVALID_DEV;
    26412656
    2642     sc = rtems_task_create (rtems_build_name('B', 'D', 'o', 'a' + w),
    2643                             (bdbuf_config.swapout_priority ?
    2644                              bdbuf_config.swapout_priority :
    2645                              RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT),
    2646                             SWAPOUT_TASK_STACK_SIZE,
    2647                             RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR,
    2648                             RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT,
    2649                             &worker->id);
     2657    sc = rtems_bdbuf_create_task (rtems_build_name('B', 'D', 'o', 'a' + w),
     2658                                  bdbuf_config.swapout_worker_priority,
     2659                                  RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT,
     2660                                  rtems_bdbuf_swapout_worker_task,
     2661                                  (rtems_task_argument) worker,
     2662                                  &worker->id);
    26502663    if (sc != RTEMS_SUCCESSFUL)
    26512664      rtems_fatal_error_occurred (RTEMS_BLKDEV_FATAL_BDBUF_SO_WK_CREATE);
    2652 
    2653     sc = rtems_task_start (worker->id,
    2654                            rtems_bdbuf_swapout_worker_task,
    2655                            (rtems_task_argument) worker);
    2656     if (sc != RTEMS_SUCCESSFUL)
    2657       rtems_fatal_error_occurred (RTEMS_BLKDEV_FATAL_BDBUF_SO_WK_START);
    26582665  }
    26592666
     
    28722879
    28732880void
    2874 rtems_bdbuf_purge_dev (const rtems_disk_device *dd)
     2881rtems_bdbuf_purge_dev (rtems_disk_device *dd)
    28752882{
    28762883  rtems_chain_control purge_list;
     
    29092916
    29102917      dd->block_size = block_size;
     2918      dd->block_count = dd->size / media_blocks_per_block;
     2919      dd->media_blocks_per_block = media_blocks_per_block;
    29112920      dd->block_to_media_block_shift = block_to_media_block_shift;
    29122921      dd->bds_per_group = bds_per_group;
  • cpukit/libblock/src/bdpart-read.c

    r486f8b84 re308b3a7  
    6969  const char *disk_name,
    7070  int *fd_ptr,
    71   const rtems_disk_device **dd_ptr,
     71  rtems_disk_device **dd_ptr,
    7272  rtems_blkdev_bnum *disk_end
    7373)
     
    7676  int rv = 0;
    7777  int fd = -1;
    78   const rtems_disk_device *dd = NULL;
     78  rtems_disk_device *dd = NULL;
    7979  rtems_blkdev_bnum disk_begin = 0;
    8080  rtems_blkdev_bnum block_size = 0;
     
    186186
    187187static rtems_status_code rtems_bdpart_read_record(
    188   const rtems_disk_device *dd,
     188  rtems_disk_device *dd,
    189189  rtems_blkdev_bnum index,
    190190  rtems_bdbuf_buffer **block
     
    238238  const uint8_t *data = NULL;
    239239  int fd = -1;
    240   const rtems_disk_device *dd = NULL;
     240  rtems_disk_device *dd = NULL;
    241241
    242242  /* Check parameter */
  • cpukit/libblock/src/bdpart-register.c

    r486f8b84 re308b3a7  
    4949  size_t i = 0;
    5050  int fd = -1;
    51   const rtems_disk_device *dd = NULL;
     51  rtems_disk_device *dd = NULL;
    5252
    5353  /* Get disk data */
     
    140140  size_t i = 0;
    141141  int fd = -1;
    142   const rtems_disk_device *dd = NULL;
     142  rtems_disk_device *dd = NULL;
    143143
    144144  /* Get disk data */
  • cpukit/libblock/src/bdpart-write.c

    r486f8b84 re308b3a7  
    4646
    4747static rtems_status_code rtems_bdpart_new_record(
    48   const rtems_disk_device *dd,
     48  rtems_disk_device *dd,
    4949  rtems_blkdev_bnum index,
    5050  rtems_bdbuf_buffer **block
     
    104104  uint8_t *data = NULL;
    105105  int fd = -1;
    106   const rtems_disk_device *dd = NULL;
     106  rtems_disk_device *dd = NULL;
    107107
    108108  /* Check if we have something to do */
  • cpukit/libblock/src/blkdev-imfs.c

    r486f8b84 re308b3a7  
    3939{
    4040  int rv;
    41   const rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
    42   const rtems_disk_device *dd = &ctx->dd;
     41  rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
     42  rtems_disk_device *dd = &ctx->dd;
    4343  ssize_t remaining = (ssize_t) count;
    4444  off_t offset = iop->offset;
     
    9393{
    9494  int rv;
    95   const rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
    96   const rtems_disk_device *dd = &ctx->dd;
     95  rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
     96  rtems_disk_device *dd = &ctx->dd;
    9797  ssize_t remaining = (ssize_t) count;
    9898  off_t offset = iop->offset;
     
    175175)
    176176{
    177   const rtems_blkdev_imfs_context *ctx =
     177  rtems_blkdev_imfs_context *ctx =
    178178    IMFS_generic_get_context_by_location(loc);
    179   const rtems_disk_device *dd = &ctx->dd;
     179  rtems_disk_device *dd = &ctx->dd;
    180180
    181181  buf->st_rdev = rtems_disk_get_device_identifier(dd);
     
    191191{
    192192  int rv = 0;
    193   const rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
    194   const rtems_disk_device *dd = &ctx->dd;
     193  rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
     194  rtems_disk_device *dd = &ctx->dd;
    195195  rtems_status_code sc = rtems_bdbuf_syncdev(dd);
    196196
     
    270270{
    271271  rtems_status_code sc = RTEMS_SUCCESSFUL;
    272 
    273   if (block_count > 0) {
    274     rtems_blkdev_imfs_context *ctx = calloc(1, sizeof(*ctx));
    275 
    276     if (ctx != NULL) {
    277       rtems_disk_device *dd = &ctx->dd;
    278 
    279       ctx->fd = -1;
    280 
    281       dd->phys_dev = dd;
    282       dd->size = block_count;
    283       dd->media_block_size = block_size;
    284       dd->ioctl = handler;
    285       dd->driver_data = driver_data;
    286 
    287       if ((*handler)(dd, RTEMS_BLKIO_CAPABILITIES, &dd->capabilities) != 0) {
    288         dd->capabilities = 0;
    289       }
    290 
    291       sc = rtems_bdbuf_set_block_size(dd, block_size);
    292       if (sc == RTEMS_SUCCESSFUL) {
    293         int rv = IMFS_make_generic_node(
    294           device,
    295           S_IFBLK | S_IRWXU | S_IRWXG | S_IRWXO,
    296           &rtems_blkdev_imfs_control,
    297           ctx
    298         );
    299 
    300         if (rv != 0) {
    301           free(ctx);
    302           sc = RTEMS_UNSATISFIED;
    303         }
    304       } else {
     272  rtems_blkdev_imfs_context *ctx = malloc(sizeof(*ctx));
     273
     274  if (ctx != NULL) {
     275    sc = rtems_disk_init_phys(
     276      &ctx->dd,
     277      block_size,
     278      block_count,
     279      handler,
     280      driver_data
     281    );
     282
     283    ctx->fd = -1;
     284
     285    if (sc == RTEMS_SUCCESSFUL) {
     286      int rv = IMFS_make_generic_node(
     287        device,
     288        S_IFBLK | S_IRWXU | S_IRWXG | S_IRWXO,
     289        &rtems_blkdev_imfs_control,
     290        ctx
     291      );
     292
     293      if (rv != 0) {
    305294        free(ctx);
    306       }
    307     } else {
    308       sc = RTEMS_NO_MEMORY;
    309     }
    310   } else {
    311     sc = RTEMS_INVALID_NUMBER;
     295        sc = RTEMS_UNSATISFIED;
     296      }
     297    } else {
     298      free(ctx);
     299    }
     300  } else {
     301    sc = RTEMS_NO_MEMORY;
    312302  }
    313303
     
    331321    rv = fstat(fd, &st);
    332322    if (rv == 0 && S_ISBLK(st.st_mode)) {
    333       rtems_disk_device *dd;
    334 
    335       rv = ioctl(fd, RTEMS_BLKIO_GETDISKDEV, &dd);
     323      rtems_disk_device *phys_dd;
     324
     325      rv = rtems_disk_fd_get_disk_device(fd, &phys_dd);
    336326      if (rv == 0) {
    337         rtems_blkdev_bnum device_block_count = rtems_disk_get_block_count(dd);
    338 
    339         if (
    340           block_begin < device_block_count
    341             && block_count > 0
    342             && block_count <= device_block_count - block_begin
    343         ) {
    344           rtems_blkdev_imfs_context *ctx = malloc(sizeof(*ctx));
    345 
    346           if (ctx != NULL) {
    347             memcpy(&ctx->dd, dd, sizeof(ctx->dd));
    348 
    349             ctx->dd.start = block_begin;
    350             ctx->dd.size = block_count;
     327        rtems_blkdev_imfs_context *ctx = malloc(sizeof(*ctx));
     328
     329        if (ctx != NULL) {
     330          sc = rtems_disk_init_log(
     331            &ctx->dd,
     332            phys_dd,
     333            block_begin,
     334            block_count
     335          );
     336
     337          if (sc == RTEMS_SUCCESSFUL) {
    351338            ctx->fd = fd;
    352339
     
    363350            }
    364351          } else {
    365             sc = RTEMS_NO_MEMORY;
     352            free(ctx);
    366353          }
    367354        } else {
    368           sc = RTEMS_INVALID_NUMBER;
     355          sc = RTEMS_NO_MEMORY;
    369356        }
    370357      } else {
  • cpukit/libblock/src/diskdevs.c

    r486f8b84 re308b3a7  
    1111 * Author: Victor V. Vengerov <vvv@oktet.ru>
    1212 *
    13  * Copyright (c) 2009 embedded brains GmbH.
     13 * Copyright (c) 2009-2012 embedded brains GmbH.
    1414 */
    1515
     
    171171
    172172static rtems_status_code
    173 create_disk(dev_t dev, const char *name, rtems_disk_device **dd_ptr)
     173create_disk(
     174  dev_t dev,
     175  const char *name,
     176  rtems_disk_device **dd_ptr,
     177  char **alloc_name_ptr
     178)
    174179{
    175180  rtems_disk_device **dd_entry = create_disk_table_entry(dev);
     
    208213  }
    209214
    210   dd->dev = dev;
    211   dd->name = alloc_name;
    212   dd->uses = 0;
    213   dd->deleted = false;
    214 
    215215  *dd_entry = dd;
    216216  *dd_ptr = dd;
     217  *alloc_name_ptr = alloc_name;
    217218
    218219  return RTEMS_SUCCESSFUL;
     
    239240  rtems_disk_device *dd = NULL;
    240241  rtems_status_code sc = RTEMS_SUCCESSFUL;
     242  char *alloc_name = NULL;
    241243
    242244  if (handler == NULL) {
     
    249251  }
    250252
    251   sc = create_disk(dev, name, &dd);
     253  sc = create_disk(dev, name, &dd, &alloc_name);
    252254  if (sc != RTEMS_SUCCESSFUL) {
    253255    disk_unlock();
     
    256258  }
    257259
    258   dd->phys_dev = dd;
    259   dd->start = 0;
    260   dd->size = block_count;
    261   dd->media_block_size = block_size;
    262   dd->ioctl = handler;
    263   dd->driver_data = driver_data;
    264 
    265   if ((*handler)(dd, RTEMS_BLKIO_CAPABILITIES, &dd->capabilities) < 0) {
    266     dd->capabilities = 0;
    267   }
    268 
    269   sc = rtems_bdbuf_set_block_size(dd, block_size);
     260  sc = rtems_disk_init_phys(
     261    dd,
     262    block_size,
     263    block_count,
     264    handler,
     265    driver_data
     266  );
     267
     268  dd->dev = dev;
     269  dd->name = alloc_name;
     270
    270271  if (sc != RTEMS_SUCCESSFUL) {
    271272    dd->ioctl = null_handler;
     
    290291  dev_t dev,
    291292  dev_t phys,
    292   rtems_blkdev_bnum begin_block,
     293  rtems_blkdev_bnum block_begin,
    293294  rtems_blkdev_bnum block_count,
    294295  const char *name
     
    296297{
    297298  rtems_status_code sc = RTEMS_SUCCESSFUL;
    298   rtems_disk_device *physical_disk = NULL;
     299  rtems_disk_device *phys_dd = NULL;
    299300  rtems_disk_device *dd = NULL;
    300   rtems_blkdev_bnum end_block = begin_block + block_count;
     301  char *alloc_name = NULL;
    301302
    302303  sc = disk_lock();
     
    305306  }
    306307
    307   physical_disk = get_disk_entry(phys, true);
    308   if (physical_disk == NULL || !is_physical_disk(physical_disk)) {
     308  phys_dd = get_disk_entry(phys, true);
     309  if (phys_dd == NULL) {
    309310    disk_unlock();
    310311
     
    312313  }
    313314
    314   if (
    315     begin_block >= physical_disk->size
    316       || end_block <= begin_block
    317       || end_block > physical_disk->size
    318   ) {
     315  sc = create_disk(dev, name, &dd, &alloc_name);
     316  if (sc != RTEMS_SUCCESSFUL) {
    319317    disk_unlock();
    320318
    321     return RTEMS_INVALID_NUMBER;
    322   }
    323 
    324   sc = create_disk(dev, name, &dd);
    325   if (sc != RTEMS_SUCCESSFUL) {
     319    return sc;
     320  }
     321
     322  sc = rtems_disk_init_log(
     323    dd,
     324    phys_dd,
     325    block_begin,
     326    block_count
     327  );
     328
     329  dd->dev = dev;
     330  dd->name = alloc_name;
     331
     332  ++phys_dd->uses;
     333
     334  if (sc != RTEMS_SUCCESSFUL) {
     335    dd->ioctl = null_handler;
     336    rtems_disk_delete(dev);
    326337    disk_unlock();
    327338
    328339    return sc;
    329340  }
    330 
    331   dd->phys_dev = physical_disk;
    332   dd->start = begin_block;
    333   dd->size = block_count;
    334   dd->block_size = physical_disk->block_size;
    335   dd->media_block_size = physical_disk->media_block_size;
    336   dd->block_to_media_block_shift = physical_disk->block_to_media_block_shift;
    337   dd->bds_per_group = physical_disk->bds_per_group;
    338   dd->ioctl = physical_disk->ioctl;
    339   dd->driver_data = physical_disk->driver_data;
    340 
    341   ++physical_disk->uses;
    342341
    343342  disk_unlock();
  • cpukit/sapi/include/confdefs.h

    r486f8b84 re308b3a7  
    12261226                              RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT
    12271227  #endif
     1228  #ifndef CONFIGURE_BDBUF_TASK_STACK_SIZE
     1229    #define CONFIGURE_BDBUF_TASK_STACK_SIZE \
     1230                              RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT
     1231  #endif
    12281232  #ifndef CONFIGURE_BDBUF_CACHE_MEMORY_SIZE
    12291233    #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE \
     
    12471251      CONFIGURE_SWAPOUT_WORKER_TASKS,
    12481252      CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY,
     1253      CONFIGURE_BDBUF_TASK_STACK_SIZE,
    12491254      CONFIGURE_BDBUF_CACHE_MEMORY_SIZE,
    12501255      CONFIGURE_BDBUF_BUFFER_MIN_SIZE,
     
    12521257    };
    12531258  #endif
     1259
     1260  #define CONFIGURE_LIBBLOCK_TASKS (1 + CONFIGURE_SWAPOUT_WORKER_TASKS)
     1261
     1262  #define CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS \
     1263    (CONFIGURE_LIBBLOCK_TASKS * \
     1264    (CONFIGURE_BDBUF_TASK_STACK_SIZE <= CONFIGURE_MINIMUM_TASK_STACK_SIZE ? \
     1265    0 : CONFIGURE_BDBUF_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE))
    12541266
    12551267  /*
     
    12701282  #endif
    12711283#else
     1284  #define CONFIGURE_LIBBLOCK_TASKS 0
     1285  #define CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS 0
    12721286  #define CONFIGURE_LIBBLOCK_SEMAPHORES 0
    12731287#endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */
     
    14561470    #define CONFIGURE_MAXIMUM_TASKS               0
    14571471  #endif
     1472
     1473  #define CONFIGURE_TASKS \
     1474    (CONFIGURE_MAXIMUM_TASKS + CONFIGURE_LIBBLOCK_TASKS)
    14581475
    14591476  #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS
     
    20742091 */
    20752092#define CONFIGURE_TOTAL_TASKS_AND_THREADS \
    2076    (CONFIGURE_MAXIMUM_TASKS + \
     2093   (CONFIGURE_TASKS + \
    20772094    CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \
    20782095    CONFIGURE_MAXIMUM_GOROUTINES)
     
    21772194
    21782195#define CONFIGURE_TASKS_STACK \
    2179   (_Configure_Max_Objects( CONFIGURE_MAXIMUM_TASKS ) * \
     2196  (_Configure_Max_Objects( CONFIGURE_TASKS ) * \
    21802197    _Configure_From_stackspace( CONFIGURE_MINIMUM_TASK_STACK_SIZE ) )
    21812198
     
    22202237    CONFIGURE_ADA_TASKS_STACK + \
    22212238    CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK + \
     2239    CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS + \
    22222240    CONFIGURE_EXTRA_TASK_STACKS \
    22232241  )
     
    22282246   */
    22292247  rtems_api_configuration_table Configuration_RTEMS_API = {
    2230     CONFIGURE_MAXIMUM_TASKS,
     2248    CONFIGURE_TASKS,
    22312249    CONFIGURE_NOTEPADS_ENABLED,
    22322250    CONFIGURE_MAXIMUM_TIMERS + CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER,
  • testsuites/fstests/fsbdpart01/init.c

    r486f8b84 re308b3a7  
    8181
    8282    if (exists) {
    83       const rtems_disk_device *dd = NULL;
     83      rtems_disk_device *dd = NULL;
    8484      int rv = 0;
    8585
  • testsuites/libtests/block01/init.c

    r486f8b84 re308b3a7  
    4949  rtems_status_code sc = RTEMS_SUCCESSFUL;
    5050  rtems_disk_device *dd = NULL;
    51   const rtems_disk_device *fd_dd = NULL;
     51  rtems_disk_device *fd_dd = NULL;
    5252  int fd = -1;
    5353  int rv = -1;
     
    184184  ASSERT_SC_EQ(sc, RTEMS_RESOURCE_IN_USE);
    185185
    186   sc = rtems_disk_create_log(logical_2_dev, logical_dev, 0, 1, "/dev/rda1");
     186  sc = rtems_disk_create_log(logical_2_dev, logical_dev, 0, 1, "/dev/rda2");
    187187  ASSERT_SC_EQ(sc, RTEMS_INVALID_ID);
    188188
     
    254254#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
    255255
    256 #define CONFIGURE_MAXIMUM_TASKS 2
     256#define CONFIGURE_MAXIMUM_TASKS 1
    257257#define CONFIGURE_MAXIMUM_DRIVERS 2
    258 #define CONFIGURE_EXTRA_TASK_STACKS (8 * 1024)
    259258
    260259#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
  • testsuites/libtests/block02/init.c

    r486f8b84 re308b3a7  
    5353#define BLOCK_COUNT_B 1
    5454
    55 static const rtems_disk_device *dd_a;
    56 
    57 static const rtems_disk_device *dd_b;
     55static rtems_disk_device *dd_a;
     56
     57static rtems_disk_device *dd_b;
    5858
    5959static volatile bool sync_done = false;
     
    200200#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
    201201
    202 #define CONFIGURE_MAXIMUM_TASKS 5
     202#define CONFIGURE_MAXIMUM_TASKS 3
    203203#define CONFIGURE_MAXIMUM_DRIVERS 3
    204204
  • testsuites/libtests/block03/init.c

    r486f8b84 re308b3a7  
    4949#define BLOCK_COUNT 2
    5050
    51 static const rtems_disk_device *dd;
     51static rtems_disk_device *dd;
    5252
    5353static volatile bool sync_done = false;
     
    187187#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
    188188
    189 #define CONFIGURE_MAXIMUM_TASKS 5
     189#define CONFIGURE_MAXIMUM_TASKS 3
    190190#define CONFIGURE_MAXIMUM_DRIVERS 2
    191191
  • testsuites/libtests/block04/init.c

    r486f8b84 re308b3a7  
    4949#define BLOCK_COUNT 1
    5050
    51 static const rtems_disk_device *dd;
     51static rtems_disk_device *dd;
    5252
    5353static rtems_id task_id_low;
     
    159159#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
    160160
    161 #define CONFIGURE_MAXIMUM_TASKS 5
     161#define CONFIGURE_MAXIMUM_TASKS 3
    162162#define CONFIGURE_MAXIMUM_DRIVERS 2
    163163
  • testsuites/libtests/block05/init.c

    r486f8b84 re308b3a7  
    6161static unsigned output_level = 0;
    6262
    63 static const rtems_disk_device *dd_a;
    64 
    65 static const rtems_disk_device *dd_b;
     63static rtems_disk_device *dd_a;
     64
     65static rtems_disk_device *dd_b;
    6666
    6767static rtems_id task_id_init;
     
    394394  uint32_t block_size,
    395395  rtems_blkdev_bnum block_count,
    396   const rtems_disk_device **dd_ptr
     396  rtems_disk_device **dd_ptr
    397397)
    398398{
     
    517517#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
    518518
    519 #define CONFIGURE_MAXIMUM_TASKS 6
     519#define CONFIGURE_MAXIMUM_TASKS 4
    520520#define CONFIGURE_MAXIMUM_DRIVERS 4
    521521
  • testsuites/libtests/block06/init.c

    r486f8b84 re308b3a7  
    109109  rtems_device_minor_number minor;
    110110  bool                      passed;
    111   const rtems_disk_device  *dd;
     111  rtems_disk_device        *dd;
    112112} bdbuf_task_control;
    113113
    114114#define BDBUF_TEST_TASKS (3)
     115
     116#define BDBUF_TEST_STACK_SIZE (2 * RTEMS_MINIMUM_STACK_SIZE)
    115117
    116118/**
     
    344346                         rtems_id                  master,
    345347                         rtems_device_major_number major,
    346                          const rtems_disk_device  *dd)
     348                         rtems_disk_device        *dd)
    347349{
    348350  char name[6];
     
    613615
    614616static bool
    615 bdbuf_tests_setup_disk (rtems_device_major_number* major,
    616                         const rtems_disk_device **dd_ptr)
     617bdbuf_tests_setup_disk (rtems_device_major_number *major,
     618                        rtems_disk_device        **dd_ptr)
    617619{
    618620  rtems_status_code sc;
     
    650652                                            tc->name[2], tc->name[3]),
    651653                          priority,
    652                           8 * 1024,
     654                          BDBUF_TEST_STACK_SIZE,
    653655                          RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
    654656                          RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR,
     
    17641766  int                       t;
    17651767  bool                      passed = true;
    1766   const rtems_disk_device *dd;
     1768  rtems_disk_device        *dd;
    17671769
    17681770  /*
     
    18431845#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
    18441846
    1845 #define CONFIGURE_MAXIMUM_TASKS 8
     1847#define CONFIGURE_MAXIMUM_TASKS (1 + BDBUF_TEST_TASKS)
    18461848#define CONFIGURE_MAXIMUM_DRIVERS 3
    18471849#define CONFIGURE_MAXIMUM_SEMAPHORES 2
    18481850
    1849 #define CONFIGURE_INIT_TASK_STACK_SIZE (2 * RTEMS_MINIMUM_STACK_SIZE)
    1850 
     1851#define CONFIGURE_EXTRA_TASK_STACKS \
     1852  (BDBUF_TEST_TASKS * BDBUF_TEST_STACK_SIZE)
     1853
     1854#define CONFIGURE_INIT_TASK_STACK_SIZE BDBUF_TEST_STACK_SIZE
    18511855#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    18521856
  • testsuites/libtests/block07/init.c

    r486f8b84 re308b3a7  
    263263#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
    264264
    265 #define CONFIGURE_MAXIMUM_TASKS 6
     265#define CONFIGURE_MAXIMUM_TASKS 4
    266266#define CONFIGURE_MAXIMUM_DRIVERS 2
    267267
  • testsuites/libtests/block08/bdbuf_tests.c

    r486f8b84 re308b3a7  
    4848
    4949/** Device ID used for testing */
    50 const rtems_disk_device *test_dd = NULL;
     50rtems_disk_device *test_dd = NULL;
    5151
    5252/** Test result variable */
  • testsuites/libtests/block08/bdbuf_tests.h

    r486f8b84 re308b3a7  
    151151
    152152/** Device ID used for testing */
    153 extern const rtems_disk_device *test_dd;
     153extern rtems_disk_device *test_dd;
    154154
    155155/**
  • testsuites/libtests/block09/init.c

    r486f8b84 re308b3a7  
    144144
    145145static void check_read(
    146   const rtems_disk_device *dd,
     146  rtems_disk_device *dd,
    147147  rtems_blkdev_bnum block,
    148148  rtems_status_code expected_sc
     
    229229#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
    230230
    231 #define CONFIGURE_MAXIMUM_TASKS 3
     231#define CONFIGURE_MAXIMUM_TASKS 1
    232232#define CONFIGURE_MAXIMUM_DRIVERS 4
    233233
  • testsuites/libtests/block10/init.c

    r486f8b84 re308b3a7  
    5656typedef void (*release_func)(char task, rtems_bdbuf_buffer *bd);
    5757
    58 static const rtems_disk_device *dd;
     58static rtems_disk_device *dd;
    5959
    6060static rtems_id task_id_init;
     
    474474#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
    475475
    476 #define CONFIGURE_MAXIMUM_TASKS 5
     476#define CONFIGURE_MAXIMUM_TASKS 3
    477477#define CONFIGURE_MAXIMUM_DRIVERS 4
    478478
  • testsuites/libtests/block11/init.c

    r486f8b84 re308b3a7  
    158158  ramdisk *rd;
    159159  int fd;
    160   const rtems_disk_device *dd;
     160  rtems_disk_device *dd;
    161161  struct stat st;
    162162
     
    397397#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5
    398398
    399 #define CONFIGURE_MAXIMUM_TASKS 2
     399#define CONFIGURE_MAXIMUM_TASKS 1
    400400#define CONFIGURE_MAXIMUM_DRIVERS 2
    401 #define CONFIGURE_EXTRA_TASK_STACKS (8 * 1024)
    402401
    403402#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
  • testsuites/libtests/block12/init.c

    r486f8b84 re308b3a7  
    143143#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
    144144
    145 #define CONFIGURE_MAXIMUM_TASKS 2
    146 
    147 #define CONFIGURE_EXTRA_TASK_STACKS (8 * 1024)
     145#define CONFIGURE_MAXIMUM_TASKS 1
    148146
    149147#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
Note: See TracChangeset for help on using the changeset viewer.