Changes in / [7afcb26:abe87b9] in rtems


Ignore:
Files:
43 added
28 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/erc32/make/custom/erc32.cfg

    r7afcb26 rabe87b9  
    1616
    1717# optimize flag: typically -O2
    18 CFLAGS_OPTIMIZE_V = -O2 -g
     18CFLAGS_OPTIMIZE_V = -O0 -g
  • c/src/make/Makefile.am

    r7afcb26 rabe87b9  
    2323
    2424rtems_bsp_makedir = $(rtems_bspdir)/make
    25 rtems_bsp_make_DATA = bsp.cfg target.cfg
     25rtems_bsp_make_DATA = bsp.cfg target.cfg bsp.mk
    2626
    2727bsp.cfg: bsp.cfg.in Makefile
  • c/src/make/configure.ac

    r7afcb26 rabe87b9  
    8181# Explicitly list all Makefiles here
    8282AC_CONFIG_FILES([Makefile
     83bsp.mk
    8384])
    8485AC_OUTPUT
  • cpukit/Makefile.am

    r7afcb26 rabe87b9  
    2525SUBDIRS += pppd
    2626SUBDIRS += mghttpd
     27SUBDIRS += gtest
    2728
    2829noinst_DATA = preinstall-stamp
  • cpukit/configure.ac

    r7afcb26 rabe87b9  
    1313AM_MAINTAINER_MODE
    1414
     15RTEMS_ENABLE_CXX
    1516RTEMS_ENABLE_MULTILIB
    1617RTEMS_ENABLE_MULTIPROCESSING
     
    1819RTEMS_ENABLE_RTEMS_DEBUG
    1920RTEMS_ENABLE_NETWORKING
     21
     22AM_CONDITIONAL(HAS_CXX,test "$RTEMS_HAS_CPLUSPLUS" = "yes")
    2023
    2124RTEMS_ENV_RTEMSCPU
     
    3134
    3235RTEMS_PROG_CC_FOR_TARGET
     36RTEMS_PROG_CXX_FOR_TARGET
    3337RTEMS_PROG_CCAS
    3438RTEMS_CANONICALIZE_TOOLS
     
    386390pppd/Makefile
    387391mghttpd/Makefile
     392gtest/Makefile
    388393wrapup/Makefile])
    389394
  • cpukit/libblock/include/rtems/bdbuf.h

    r7afcb26 rabe87b9  
    476476 *
    477477 * @retval RTEMS_SUCCESSFUL Successful operation.
    478  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    479  * @retval RTEMS_INVALID_ID No such device.
    480478 * @retval RTEMS_INVALID_NUMBER Invalid block size.
    481479 */
     
    507505 *
    508506 * @retval RTEMS_SUCCESSFUL Successful operation.
    509  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    510  * @retval RTEMS_INVALID_ID No such device.
    511507 * @retval RTEMS_INVALID_NUMBER Invalid block size.
    512508 * @retval RTEMS_IO_ERROR IO error.
     
    530526 *
    531527 * @retval RTEMS_SUCCESSFUL Successful operation.
    532  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    533528 * @retval RTEMS_INVALID_ADDRESS The reference is NULL.
    534529 */
     
    549544 *
    550545 * @retval RTEMS_SUCCESSFUL Successful operation.
    551  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    552546 * @retval RTEMS_INVALID_ADDRESS The reference is NULL.
    553547 */
     
    567561 *
    568562 * @retval RTEMS_SUCCESSFUL Successful operation.
    569  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    570563 * @retval RTEMS_INVALID_ADDRESS The reference is NULL.
    571564 */
     
    585578 *
    586579 * @retval RTEMS_SUCCESSFUL Successful operation.
    587  * @retval RTEMS_NOT_CONFIGURED Not initialized.
    588  * @retval RTEMS_INVALID_ID No such device.
    589580 */
    590581rtems_status_code
     
    598589void
    599590rtems_bdbuf_purge_dev (const rtems_disk_device *dd);
     591
     592/**
     593 * @brief Sets the block size of a disk device.
     594 *
     595 * This will also change the block_to_media_block_shift and bds_per_group
     596 * fields of the disk device.
     597 *
     598 * @param dd [in, out] The disk device.
     599 * @param dd [in] The new block size.
     600 *
     601 * @retval RTEMS_SUCCESSFUL Successful operation.
     602 * @retval RTEMS_INVALID_NUMBER Invalid block size.
     603 */
     604rtems_status_code
     605rtems_bdbuf_set_block_size (rtems_disk_device *dd, uint32_t block_size);
    600606
    601607/** @} */
  • cpukit/libblock/include/rtems/diskdevs.h

    r7afcb26 rabe87b9  
    110110   * @brief Device block size in bytes.
    111111   *
    112    * This is the minimum transfer unit. It can be any size.
     112   * This is the minimum transfer unit.  It must be positive.
     113   *
     114   * @see rtems_bdbuf_set_block_size().
    113115   */
    114116  uint32_t block_size;
     
    120122   */
    121123  uint32_t media_block_size;
     124
     125  /**
     126   * @brief Block to media block shift.
     127   *
     128   * In case this value is non-negative the media block of a block can be
     129   * calculated as media block = block << block_to_media_block_shift, otherwise
     130   * a 64-bit operation will be used.
     131   *
     132   * @see rtems_bdbuf_set_block_size().
     133   */
     134  int block_to_media_block_shift;
     135
     136  /**
     137   * @brief Buffer descriptors per group count.
     138   *
     139   * @see rtems_bdbuf_set_block_size().
     140   */
     141  size_t bds_per_group;
    122142
    123143  /**
     
    223243 * @retval RTEMS_NOT_CONFIGURED Cannot lock disk device operation mutex.
    224244 * @retval RTEMS_INVALID_ADDRESS IO control handler is @c NULL.
    225  * @retval RTEMS_INVALID_NUMBER Block size is zero.
     245 * @retval RTEMS_INVALID_NUMBER Block size is invalid.
    226246 * @retval RTEMS_NO_MEMORY Not enough memory.
    227247 * @retval RTEMS_RESOURCE_IN_USE Disk device descriptor is already in use.
  • cpukit/libblock/src/bdbuf.c

    r7afcb26 rabe87b9  
    816816}
    817817
    818 /**
    819  * Change the block number for the block size to the block number for the media
    820  * block size. We have to use 64bit maths. There is no short cut here.
    821  *
    822  * @param block The logical block number in the block size terms.
    823  * @param block_size The block size.
    824  * @param media_block_size The block size of the media.
    825  * @return rtems_blkdev_bnum The media block number.
    826  */
    827818static rtems_blkdev_bnum
    828 rtems_bdbuf_media_block (rtems_blkdev_bnum block,
    829                          size_t            block_size,
    830                          size_t            media_block_size)
    831 {
    832   return (rtems_blkdev_bnum)
    833     ((((uint64_t) block) * block_size) / media_block_size);
     819rtems_bdbuf_media_block (const rtems_disk_device *dd, rtems_blkdev_bnum block)
     820{
     821  if (dd->block_to_media_block_shift >= 0)
     822    return block << dd->block_to_media_block_shift;
     823  else
     824    /*
     825     * Change the block number for the block size to the block number for the media
     826     * block size. We have to use 64bit maths. There is no short cut here.
     827     */
     828    return (rtems_blkdev_bnum)
     829      ((((uint64_t) block) * dd->block_size) / dd->media_block_size);
    834830}
    835831
     
    10571053  }
    10581054
    1059   rtems_chain_extract (&bd->link);
     1055  rtems_chain_extract_unprotected (&bd->link);
    10601056}
    10611057
     
    10641060{
    10651061  rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_FREE);
    1066   rtems_chain_prepend (&bdbuf_cache.lru, &bd->link);
     1062  rtems_chain_prepend_unprotected (&bdbuf_cache.lru, &bd->link);
    10671063}
    10681064
     
    10771073{
    10781074  rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_CACHED);
    1079   rtems_chain_append (&bdbuf_cache.lru, &bd->link);
     1075  rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
    10801076}
    10811077
     
    11241120
    11251121  rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_MODIFIED);
    1126   rtems_chain_append (&bdbuf_cache.modified, &bd->link);
     1122  rtems_chain_append_unprotected (&bdbuf_cache.modified, &bd->link);
    11271123
    11281124  if (bd->waiters)
     
    14291425    bd->buffer = buffer;
    14301426
    1431     rtems_chain_append (&bdbuf_cache.lru, &bd->link);
     1427    rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
    14321428
    14331429    if ((b % bdbuf_cache.max_bds_per_group) ==
     
    15261522        /* Fall through */
    15271523      case RTEMS_BDBUF_STATE_CACHED:
    1528         rtems_chain_extract (&bd->link);
     1524        rtems_chain_extract_unprotected (&bd->link);
    15291525        /* Fall through */
    15301526      case RTEMS_BDBUF_STATE_EMPTY:
     
    15511547{
    15521548  rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_SYNC);
    1553   rtems_chain_extract (&bd->link);
    1554   rtems_chain_append (&bdbuf_cache.sync, &bd->link);
     1549  rtems_chain_extract_unprotected (&bd->link);
     1550  rtems_chain_append_unprotected (&bdbuf_cache.sync, &bd->link);
    15551551  rtems_bdbuf_wake_swapper ();
    15561552}
     
    16461642  rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_SYNC);
    16471643
    1648   rtems_chain_append (&bdbuf_cache.sync, &bd->link);
     1644  rtems_chain_append_unprotected (&bdbuf_cache.sync, &bd->link);
    16491645
    16501646  if (bd->waiters)
     
    17371733
    17381734static rtems_status_code
    1739 rtems_bdbuf_obtain_disk (const rtems_disk_device *dd,
    1740                          rtems_blkdev_bnum   block,
    1741                          rtems_blkdev_bnum  *media_block_ptr,
    1742                          size_t             *bds_per_group_ptr)
    1743 {
    1744   if (!bdbuf_cache.initialised)
    1745     return RTEMS_NOT_CONFIGURED;
    1746 
    1747   if (media_block_ptr != NULL)
    1748   {
    1749     /*
    1750      * Compute the media block number. Drivers work with media block number not
    1751      * the block number a BD may have as this depends on the block size set by
    1752      * the user.
    1753      */
    1754     rtems_blkdev_bnum mb = rtems_bdbuf_media_block (block,
    1755                                                     dd->block_size,
    1756                                                     dd->media_block_size);
    1757     if (mb >= dd->size)
    1758     {
    1759       return RTEMS_INVALID_NUMBER;
    1760     }
    1761 
    1762     *media_block_ptr = mb + dd->start;
    1763   }
    1764 
    1765   if (bds_per_group_ptr != NULL)
    1766   {
    1767     size_t bds_per_group = rtems_bdbuf_bds_per_group (dd->block_size);
    1768 
    1769     if (bds_per_group == 0)
    1770     {
    1771       return RTEMS_INVALID_NUMBER;
    1772     }
    1773 
    1774     *bds_per_group_ptr = bds_per_group;
    1775   }
     1735rtems_bdbuf_get_media_block (const rtems_disk_device *dd,
     1736                             rtems_blkdev_bnum        block,
     1737                             rtems_blkdev_bnum       *media_block_ptr)
     1738{
     1739  /*
     1740   * Compute the media block number. Drivers work with media block number not
     1741   * the block number a BD may have as this depends on the block size set by
     1742   * the user.
     1743   */
     1744  rtems_blkdev_bnum mb = rtems_bdbuf_media_block (dd, block);
     1745  if (mb >= dd->size)
     1746  {
     1747    return RTEMS_INVALID_NUMBER;
     1748  }
     1749
     1750  *media_block_ptr = mb + dd->start;
    17761751
    17771752  return RTEMS_SUCCESSFUL;
     
    17861761  rtems_bdbuf_buffer *bd = NULL;
    17871762  rtems_blkdev_bnum   media_block = 0;
    1788   size_t              bds_per_group = 0;
    1789 
    1790   sc = rtems_bdbuf_obtain_disk (dd, block, &media_block, &bds_per_group);
     1763
     1764  sc = rtems_bdbuf_get_media_block (dd, block, &media_block);
    17911765  if (sc != RTEMS_SUCCESSFUL)
    17921766    return sc;
     
    18011775            media_block, block, (unsigned) dd->dev);
    18021776
    1803   bd = rtems_bdbuf_get_buffer_for_access (dd, media_block, bds_per_group);
     1777  bd = rtems_bdbuf_get_buffer_for_access (dd, media_block, dd->bds_per_group);
    18041778
    18051779  switch (bd->state)
     
    18671841  rtems_bdbuf_buffer *bd = NULL;
    18681842  rtems_blkdev_bnum   media_block_end = dd->start + dd->size;
    1869   rtems_blkdev_bnum   media_block_count = dd->block_size / dd->media_block_size;
     1843  rtems_blkdev_bnum   media_block_count = dd->block_to_media_block_shift >= 0 ?
     1844    dd->block_size >> dd->block_to_media_block_shift
     1845      : dd->block_size / dd->media_block_size;
    18701846  uint32_t            block_size = dd->block_size;
    18711847  uint32_t            transfer_index = 1;
     
    20041980  rtems_bdbuf_buffer   *bd = NULL;
    20051981  rtems_blkdev_bnum     media_block = 0;
    2006   size_t                bds_per_group = 0;
    2007 
    2008   sc = rtems_bdbuf_obtain_disk (dd, block, &media_block, &bds_per_group);
     1982
     1983  sc = rtems_bdbuf_get_media_block (dd, block, &media_block);
    20091984  if (sc != RTEMS_SUCCESSFUL)
    20101985    return sc;
     
    20241999
    20252000  rtems_bdbuf_lock_cache ();
    2026   rtems_bdbuf_create_read_request (dd, media_block, bds_per_group, req, &bd);
     2001  rtems_bdbuf_create_read_request (dd, media_block, dd->bds_per_group, req, &bd);
    20272002
    20282003  if (req->bufnum > 0)
     
    20312006    if (sc == RTEMS_SUCCESSFUL)
    20322007    {
    2033       rtems_chain_extract (&bd->link);
     2008      rtems_chain_extract_unprotected (&bd->link);
    20342009      rtems_bdbuf_group_obtain (bd);
    20352010    }
     
    20702045rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
    20712046{
    2072   if (!bdbuf_cache.initialised)
    2073     return RTEMS_NOT_CONFIGURED;
    20742047  if (bd == NULL)
    20752048    return RTEMS_INVALID_ADDRESS;
     
    21852158rtems_bdbuf_syncdev (const rtems_disk_device *dd)
    21862159{
    2187   rtems_status_code  sc = RTEMS_SUCCESSFUL;
    2188 
    21892160  if (rtems_bdbuf_tracer)
    21902161    printf ("bdbuf:syncdev: %08x\n", (unsigned) dd->dev);
    2191 
    2192   sc = rtems_bdbuf_obtain_disk (dd, 0, NULL, NULL);
    2193   if (sc != RTEMS_SUCCESSFUL)
    2194     return sc;
    21952162
    21962163  /*
     
    22702237    transfer->write_req->bufnum = 0;
    22712238
    2272     while ((node = rtems_chain_get(&transfer->bds)) != NULL)
     2239    while ((node = rtems_chain_get_unprotected(&transfer->bds)) != NULL)
    22732240    {
    22742241      rtems_bdbuf_buffer* bd = (rtems_bdbuf_buffer*) node;
     
    22922259          (bd->block != (last_block + bufs_per_bd)))
    22932260      {
    2294         rtems_chain_prepend (&transfer->bds, &bd->link);
     2261        rtems_chain_prepend_unprotected (&transfer->bds, &bd->link);
    22952262        write = true;
    22962263      }
     
    24292396        rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER);
    24302397
    2431         rtems_chain_extract (node);
     2398        rtems_chain_extract_unprotected (node);
    24322399
    24332400        tnode = tnode->previous;
     
    24392406          if (bd->block > tbd->block)
    24402407          {
    2441             rtems_chain_insert (tnode, node);
     2408            rtems_chain_insert_unprotected (tnode, node);
    24422409            node = NULL;
    24432410          }
     
    24472414
    24482415        if (node)
    2449           rtems_chain_prepend (transfer, node);
     2416          rtems_chain_prepend_unprotected (transfer, node);
    24502417
    24512418        node = next_node;
     
    24992466  {
    25002467    worker = (rtems_bdbuf_swapout_worker*)
    2501       rtems_chain_get (&bdbuf_cache.swapout_workers);
     2468      rtems_chain_get_unprotected (&bdbuf_cache.swapout_workers);
    25022469    if (worker)
    25032470      transfer = &worker->transfer;
     
    26292596    worker->transfer.dd = BDBUF_INVALID_DEV;
    26302597
    2631     rtems_chain_append (&bdbuf_cache.swapout_workers, &worker->link);
     2598    rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
    26322599
    26332600    rtems_bdbuf_unlock_cache ();
     
    26592626      rtems_fatal_error_occurred (RTEMS_BLKDEV_FATAL_BDBUF_SO_NOMEM);
    26602627
    2661     rtems_chain_append (&bdbuf_cache.swapout_workers, &worker->link);
     2628    rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
    26622629    worker->enabled = true;
    26632630    worker->transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
     
    28062773  rtems_chain_node *node = NULL;
    28072774
    2808   while ((node = rtems_chain_get (purge_list)) != NULL)
     2775  while ((node = rtems_chain_get_unprotected (purge_list)) != NULL)
    28092776  {
    28102777    rtems_bdbuf_buffer *bd = (rtems_bdbuf_buffer *) node;
     
    28482815          /* Fall through */
    28492816        case RTEMS_BDBUF_STATE_CACHED:
    2850           rtems_chain_extract (&cur->link);
    2851           rtems_chain_append (purge_list, &cur->link);
     2817          rtems_chain_extract_unprotected (&cur->link);
     2818          rtems_chain_append_unprotected (purge_list, &cur->link);
    28522819          break;
    28532820        case RTEMS_BDBUF_STATE_TRANSFER:
     
    29072874  rtems_bdbuf_unlock_cache ();
    29082875}
     2876
     2877rtems_status_code
     2878rtems_bdbuf_set_block_size (rtems_disk_device *dd, uint32_t block_size)
     2879{
     2880  rtems_status_code sc = RTEMS_SUCCESSFUL;
     2881
     2882  rtems_bdbuf_lock_cache ();
     2883
     2884  if (block_size > 0)
     2885  {
     2886    size_t bds_per_group = rtems_bdbuf_bds_per_group (block_size);
     2887
     2888    if (bds_per_group != 0)
     2889    {
     2890      int block_to_media_block_shift = 0;
     2891      uint32_t media_blocks_per_block = block_size / dd->media_block_size;
     2892      uint32_t one = 1;
     2893
     2894      while ((one << block_to_media_block_shift) < media_blocks_per_block)
     2895      {
     2896        ++block_to_media_block_shift;
     2897      }
     2898
     2899      if ((dd->media_block_size << block_to_media_block_shift) != block_size)
     2900        block_to_media_block_shift = -1;
     2901
     2902      dd->block_size = block_size;
     2903      dd->block_to_media_block_shift = block_to_media_block_shift;
     2904      dd->bds_per_group = bds_per_group;
     2905    }
     2906    else
     2907    {
     2908      sc = RTEMS_INVALID_NUMBER;
     2909    }
     2910  }
     2911  else
     2912  {
     2913    sc = RTEMS_INVALID_NUMBER;
     2914  }
     2915
     2916  rtems_bdbuf_unlock_cache ();
     2917
     2918  return sc;
     2919}
  • cpukit/libblock/src/blkdev-imfs.c

    r7afcb26 rabe87b9  
    269269  rtems_status_code sc = RTEMS_SUCCESSFUL;
    270270
    271   if (block_size > 0 && block_count > 0) {
     271  if (block_count > 0) {
    272272    rtems_blkdev_imfs_context *ctx = calloc(1, sizeof(*ctx));
    273273
    274274    if (ctx != NULL) {
    275275      rtems_disk_device *dd = &ctx->dd;
    276       int rv;
    277276
    278277      ctx->fd = -1;
     
    281280      dd->size = block_count;
    282281      dd->media_block_size = block_size;
    283       dd->block_size = block_size;
    284282      dd->ioctl = handler;
    285283      dd->driver_data = driver_data;
     
    289287      }
    290288
    291       rv = IMFS_make_generic_node(
    292         device,
    293         S_IFBLK | S_IRWXU | S_IRWXG | S_IRWXO,
    294         &rtems_blkdev_imfs_control,
    295         ctx
    296       );
    297 
    298       if (rv != 0) {
     289      sc = rtems_bdbuf_set_block_size(dd, block_size);
     290      if (sc == RTEMS_SUCCESSFUL) {
     291        int rv = IMFS_make_generic_node(
     292          device,
     293          S_IFBLK | S_IRWXU | S_IRWXG | S_IRWXO,
     294          &rtems_blkdev_imfs_control,
     295          ctx
     296        );
     297
     298        if (rv != 0) {
     299          free(ctx);
     300          sc = RTEMS_UNSATISFIED;
     301        }
     302      } else {
    299303        free(ctx);
    300         sc = RTEMS_UNSATISFIED;
    301304      }
    302305    } else {
  • cpukit/libblock/src/blkdev-ioctl.c

    r7afcb26 rabe87b9  
    2424rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
    2525{
    26     size_t            *arg_size = argp;
     26    rtems_status_code  sc;
    2727    int                rc = 0;
    2828
     
    3030    {
    3131        case RTEMS_BLKIO_GETMEDIABLKSIZE:
    32             *arg_size = dd->media_block_size;
     32            *(uint32_t *) argp = dd->media_block_size;
    3333            break;
    3434
    3535        case RTEMS_BLKIO_GETBLKSIZE:
    36             *arg_size = dd->block_size;
     36            *(uint32_t *) argp = dd->block_size;
    3737            break;
    3838
    3939        case RTEMS_BLKIO_SETBLKSIZE:
    40             dd->block_size = *arg_size;
    41             break;
    42 
    43         case RTEMS_BLKIO_GETSIZE:
    44             *arg_size = dd->size;
    45             break;
    46 
    47         case RTEMS_BLKIO_SYNCDEV:
    48         {
    49             rtems_status_code sc = rtems_bdbuf_syncdev(dd);
     40            sc = rtems_bdbuf_set_block_size(dd, *(uint32_t *) argp);
    5041            if (sc != RTEMS_SUCCESSFUL) {
    5142                errno = EIO;
     
    5344            }
    5445            break;
    55         }
     46
     47        case RTEMS_BLKIO_GETSIZE:
     48            *(rtems_blkdev_bnum *) argp = dd->size;
     49            break;
     50
     51        case RTEMS_BLKIO_SYNCDEV:
     52            sc = rtems_bdbuf_syncdev(dd);
     53            if (sc != RTEMS_SUCCESSFUL) {
     54                errno = EIO;
     55                rc = -1;
     56            }
     57            break;
    5658
    5759        case RTEMS_BLKIO_GETDISKDEV:
    58         {
    59             rtems_disk_device **dd_ptr = argp;
    60             *dd_ptr = dd;
     60            *(rtems_disk_device **) argp = dd;
    6161            break;
    62         }
    6362
    6463        default:
  • cpukit/libblock/src/diskdevs.c

    r7afcb26 rabe87b9  
    221221}
    222222
     223static int null_handler(
     224  rtems_disk_device *dd,
     225  uint32_t req,
     226  void *argp
     227)
     228{
     229  return -1;
     230}
     231
    223232rtems_status_code rtems_disk_create_phys(
    224233  dev_t dev,
     
    237246  }
    238247
    239   if (block_size == 0) {
    240     return RTEMS_INVALID_NUMBER;
    241   }
    242 
    243248  sc = disk_lock();
    244249  if (sc != RTEMS_SUCCESSFUL) {
     
    256261  dd->start = 0;
    257262  dd->size = block_count;
    258   dd->block_size = dd->media_block_size = block_size;
     263  dd->media_block_size = block_size;
    259264  dd->ioctl = handler;
    260265  dd->driver_data = driver_data;
     
    262267  if ((*handler)(dd, RTEMS_BLKIO_CAPABILITIES, &dd->capabilities) < 0) {
    263268    dd->capabilities = 0;
     269  }
     270
     271  sc = rtems_bdbuf_set_block_size(dd, block_size);
     272  if (sc != RTEMS_SUCCESSFUL) {
     273    dd->ioctl = null_handler;
     274    rtems_disk_delete(dev);
     275    disk_unlock();
     276
     277    return sc;
    264278  }
    265279
     
    320334  dd->start = begin_block;
    321335  dd->size = block_count;
    322   dd->block_size = dd->media_block_size = physical_disk->block_size;
     336  dd->block_size = physical_disk->block_size;
     337  dd->media_block_size = physical_disk->media_block_size;
     338  dd->block_to_media_block_shift = physical_disk->block_to_media_block_shift;
     339  dd->bds_per_group = physical_disk->bds_per_group;
    323340  dd->ioctl = physical_disk->ioctl;
    324341  dd->driver_data = physical_disk->driver_data;
  • cpukit/libblock/src/flashdisk.c

    r7afcb26 rabe87b9  
    178178  uint32_t block_count;                    /**< The number of avail. blocks. */
    179179  uint32_t unavail_blocks;                 /**< The number of unavail blocks. */
     180  uint32_t starvation_threshold;           /**< Erased blocks starvation threshold. */
    180181  uint32_t erased_blocks;                  /**< The number of erased blocks. */
    181182
     
    281282rtems_fdisk_is_erased_blocks_starvation (rtems_flashdisk* fd)
    282283{
    283   bool starvation = fd->erased_blocks < fd->unavail_blocks;
     284  bool starvation = fd->erased_blocks < fd->starvation_threshold;
    284285
    285286  if (starvation)
     
    12611262  for (spage = 0; spage < ssc->pages; spage++)
    12621263  {
    1263     uint32_t               dst_pages;
    12641264    rtems_fdisk_page_desc* spd = &ssc->page_descriptors[spage];
     1265
     1266    if (!dsc && ssc->pages_active > 0)
     1267    {
     1268      rtems_fdisk_error ("recycle: no available dst segment");
     1269      return EIO;
     1270    }
    12651271
    12661272    if (rtems_fdisk_page_desc_flags_set (spd, RTEMS_FDISK_PAGE_ACTIVE) &&
    12671273        !rtems_fdisk_page_desc_flags_set (spd, RTEMS_FDISK_PAGE_USED))
    12681274    {
     1275      uint32_t               dst_pages;
    12691276      rtems_fdisk_page_desc* dpd;
    12701277      uint32_t               dpage;
     
    13521359      dst_pages = rtems_fdisk_seg_pages_available (dsc);
    13531360      if (dst_pages == 0)
    1354       {
    13551361        dsc = rtems_fdisk_seg_most_available (&fd->available);
    1356         if (!dsc)
    1357         {
    1358           rtems_fdisk_error ("recycle: no available dst segment");
    1359           return EIO;
    1360         }
    1361       }
    13621362
    13631363      (*pages)--;
     
    14061406  if (rtems_fdisk_is_erased_blocks_starvation (fd))
    14071407  {
     1408#if RTEMS_FDISK_TRACE
     1409    rtems_fdisk_printf (fd, " resolve starvation");
     1410#endif
     1411
    14081412    ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
    14091413    if (!ssc)
     
    14831487
    14841488    if (!ssc || (pages == 0) || ((compacted_segs + segments) == 1))
     1489    {
     1490#if RTEMS_FDISK_TRACE
     1491      rtems_fdisk_printf (fd, " nothing to compact");
     1492#endif
    14851493      break;
     1494    }
    14861495
    14871496#if RTEMS_FDISK_TRACE
     
    15401549   */
    15411550  fd->erased_blocks = 0;
     1551  fd->starvation_threshold = 0;
    15421552  for (device = 0; device < fd->device_count; device++)
    15431553  {
     
    15581568      sc->pages =
    15591569        rtems_fdisk_pages_in_segment (sd, fd->block_size) - sc->pages_desc;
     1570      if (sc->pages > fd->starvation_threshold)
     1571        fd->starvation_threshold = sc->pages;
    15601572
    15611573      sc->pages_active = 0;
     
    22262238  rtems_fdisk_printf (fd, "Block count\t%d", fd->block_count);
    22272239  rtems_fdisk_printf (fd, "Unavail blocks\t%d", fd->unavail_blocks);
     2240  rtems_fdisk_printf (fd, "Starvation threshold\t%d", fd->starvation_threshold);
    22282241  rtems_fdisk_printf (fd, "Starvations\t%d", fd->starvations);
    22292242  count = rtems_fdisk_segment_count_queue (&fd->available);
  • cpukit/libcsupport/include/sys/ioccom.h

    r7afcb26 rabe87b9  
    3737#define _SYS_IOCCOM_H_
    3838
    39 #include <sys/types.h>
     39#include <rtems.h>
    4040
    4141/*
     
    7777#define       RTEMS_IO_SNDWAKEUP      5
    7878
     79typedef enum {
     80  RTEMS_IOCTL_SELECT_OTHER,
     81  RTEMS_IOCTL_SELECT_READ,
     82  RTEMS_IOCTL_SELECT_WRITE
     83} rtems_ioctl_select_kind;
     84
     85/**
     86 * @brief IO control request for select() support.
     87 *
     88 * The driver shall return
     89 *   - 1, when the request can be fullfilled immediately,
     90 *   - 0, when the request task must wait, and
     91 *   - -1, in case of an error.
     92 */
     93typedef struct {
     94  rtems_ioctl_select_kind kind;
     95  rtems_id request_task_id;
     96} rtems_ioctl_select_request;
     97
     98#define RTEMS_IOCTL_SELECT _IOW('R', 0, rtems_ioctl_select_request)
     99
     100#define RTEMS_IOCTL_SELECT_EVENT RTEMS_EVENT_24
     101
    79102/* copied from libnetworking/sys/filio.h and commented out there */
    80103/* Generic file-descriptor ioctl's. */
  • cpukit/libcsupport/src/termios.c

    r7afcb26 rabe87b9  
    510510}
    511511
     512static bool
     513rtems_termios_can_read (const struct rtems_termios_tty *tty)
     514{
     515  if (tty->cindex == tty->ccount) {
     516    if (tty->device.outputUsesInterrupts == TERMIOS_IRQ_DRIVEN) {
     517      return tty->rawInBuf.Head != tty->rawInBuf.Tail;
     518    } else {
     519      return true;
     520    }
     521  } else {
     522    return tty->cindex < tty->ccount;
     523  }
     524}
     525
     526static bool
     527rtems_termios_can_write (const struct rtems_termios_tty *tty)
     528{
     529  /*
     530   * Termios has no non-blocking writes.  In case the raw output buffer is
     531   * full, we wait for the interrupt or poll.
     532   */
     533  return true;
     534}
     535
     536static void
     537rtems_termios_select_wakeup (struct termios *tty, void *arg)
     538{
     539  rtems_id task_id = (rtems_id) arg;
     540  rtems_status_code sc = rtems_event_send (task_id, RTEMS_IOCTL_SELECT_EVENT);
     541  if (sc != RTEMS_SUCCESSFUL)
     542    rtems_fatal_error_occurred (sc);
     543}
     544
     545static int
     546rtems_termios_select (struct rtems_termios_tty *tty,
     547                      const rtems_ioctl_select_request *request)
     548{
     549  int rv = 0;
     550
     551  rtems_interrupt_level level;
     552  rtems_interrupt_disable(level);
     553  switch (request->kind) {
     554    case RTEMS_IOCTL_SELECT_READ:
     555      if (rtems_termios_can_read (tty)) {
     556        rv = 1;
     557      } else {
     558        tty->tty_rcvwakeup = 0;
     559        tty->tty_rcv.sw_pfn = rtems_termios_select_wakeup;
     560        tty->tty_rcv.sw_arg = (void *) request->request_task_id;
     561      }
     562      break;
     563    case RTEMS_IOCTL_SELECT_WRITE:
     564      if (rtems_termios_can_write (tty)) {
     565        rv = 1;
     566      } else {
     567        tty->tty_snd.sw_pfn = rtems_termios_select_wakeup;
     568        tty->tty_snd.sw_arg = (void *) request->request_task_id;
     569      }
     570      break;
     571    default:
     572      break;
     573  }
     574  rtems_interrupt_enable(level);
     575
     576  return rv;
     577}
     578
    512579rtems_status_code
    513580rtems_termios_ioctl (void *arg)
     
    531598      sc = RTEMS_INVALID_NUMBER;
    532599    }
     600    break;
     601
     602  case RTEMS_IOCTL_SELECT:
     603    args->ioctl_return = rtems_termios_select (tty, args->buffer);
    533604    break;
    534605
  • cpukit/libnetworking/rtems/rtems_select.c

    r7afcb26 rabe87b9  
    3030#include <net/if.h>
    3131#include <net/route.h>
     32
     33RTEMS_STATIC_ASSERT(RTEMS_IOCTL_SELECT_OTHER == 0, other);
     34RTEMS_STATIC_ASSERT(RTEMS_IOCTL_SELECT_READ == FREAD, fread);
     35RTEMS_STATIC_ASSERT(RTEMS_IOCTL_SELECT_WRITE == FWRITE, fwrite);
     36RTEMS_STATIC_ASSERT(RTEMS_IOCTL_SELECT_EVENT == SBWAIT_EVENT, sbwait_event);
    3237
    3338/*
     
    8994        int n = 0;
    9095        static int flag[3] = { FREAD, FWRITE, 0 };
     96        int update_obits;
     97        int rv;
     98        rtems_ioctl_select_request select_request;
     99
     100        select_request.request_task_id = tid;
    91101
    92102        for (msk = 0; msk < 3; msk++) {
     
    99109                                        continue;
    100110                                bits &= ~bit;
     111                                update_obits = 0;
    101112                                so = rtems_bsdnet_fdToSocket (fd);
    102                                 if (so == NULL)
    103                                         return (EBADF);
    104                                 if (socket_select (so, flag[msk], tid)) {
     113                                if (so != NULL) {
     114                                        if (socket_select (so, flag[msk], tid)) {
     115                                                update_obits = 1;
     116                                        }
     117                                } else {
     118                                        select_request.kind = flag[msk];
     119
     120                                        rtems_bsdnet_semaphore_release();
     121                                        rv = ioctl (fd, RTEMS_IOCTL_SELECT, &select_request);
     122                                        rtems_bsdnet_semaphore_obtain();
     123                                        if (rv == 1) {
     124                                                update_obits = 1;
     125                                        } else if (rv != 0) {
     126                                                return (EBADF);
     127                                        }
     128                                }
     129
     130                                if (update_obits) {
    105131                                        obits[msk][fd/NFDBITS] |=
    106132                                                        (1 << (fd % NFDBITS));
  • cpukit/sapi/Makefile.am

    r7afcb26 rabe87b9  
    1717include_rtems_HEADERS += include/rtems/mptables.h
    1818include_rtems_HEADERS += include/rtems/cbs.h
     19include_rtems_HEADERS += include/rtems/rbheap.h
    1920include_rtems_HEADERS += include/rtems/rbtree.h
    2021include_rtems_HEADERS += include/rtems/sptables.h
     
    3940    src/rtemsapi.c src/extensiondata.c src/getversionstring.c \
    4041    src/chainappendnotify.c src/chaingetnotify.c src/chaingetwait.c \
    41     src/chainprependnotify.c
     42    src/chainprependnotify.c src/rbheap.c
    4243libsapi_a_CPPFLAGS = $(AM_CPPFLAGS)
    4344
  • cpukit/sapi/inline/rtems/rbtree.inl

    r7afcb26 rabe87b9  
    272272}
    273273
    274 /** @brief Find the node's in-order predecessor
    275  *
    276  * This function returns a pointer to the in-order predecessor
    277  * of @a the_node if it exists, and NULL if not.
     274/**
     275 * @copydoc _RBTree_Predecessor_unprotected()
     276 */
     277RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_predecessor_unprotected(
     278  const rtems_rbtree_control *rbtree,
     279  const rtems_rbtree_node *node
     280)
     281{
     282  return _RBTree_Predecessor_unprotected( rbtree, node );
     283}
     284
     285/**
     286 * @copydoc _RBTree_Predecessor()
    278287 */
    279288RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_predecessor(
    280   rtems_rbtree_node *the_node
    281 )
    282 {
    283   return _RBTree_Predecessor( the_node );
    284 }
    285 
    286 /** @brief Find the node's in-order successor
    287  *
    288  *  This function returns a pointer to the in-order successor 
    289  *  of @a the_node if it exists, and NULL if not.
     289  const rtems_rbtree_control *rbtree,
     290  const rtems_rbtree_node *node
     291)
     292{
     293  return _RBTree_Predecessor( rbtree, node );
     294}
     295
     296/**
     297 * @copydoc _RBTree_Successor_unprotected()
     298 */
     299RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_successor_unprotected(
     300  const rtems_rbtree_control *rbtree,
     301  const rtems_rbtree_node *node
     302)
     303{
     304  return _RBTree_Successor_unprotected( rbtree, node );
     305}
     306
     307/**
     308 * @copydoc _RBTree_Successor()
    290309 */
    291310RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_successor(
    292   rtems_rbtree_node *the_node
    293 )
    294 {
    295   return _RBTree_Successor( the_node );
     311  const rtems_rbtree_control *rbtree,
     312  const rtems_rbtree_node *node
     313)
     314{
     315  return _RBTree_Successor( rbtree, node );
    296316}
    297317
  • cpukit/sapi/preinstall.am

    r7afcb26 rabe87b9  
    6565PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/cbs.h
    6666
     67$(PROJECT_INCLUDE)/rtems/rbheap.h: include/rtems/rbheap.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     68        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rbheap.h
     69PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rbheap.h
     70
    6771$(PROJECT_INCLUDE)/rtems/rbtree.h: include/rtems/rbtree.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    6872        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rbtree.h
  • cpukit/score/Makefile.am

    r7afcb26 rabe87b9  
    266266libscore_a_SOURCES += src/rbtree.c \
    267267    src/rbtreeextract.c src/rbtreefind.c src/rbtreefindheader.c \
    268     src/rbtreeget.c src/rbtreeinsert.c src/rbtreepeek.c
     268    src/rbtreeget.c src/rbtreeinsert.c src/rbtreepeek.c src/rbtreenext.c \
     269    src/rbtreeiterate.c
    269270
    270271## THREAD_C_FILES
  • cpukit/score/cpu/nios2/nios2-mpu-add-region.c

    r7afcb26 rabe87b9  
    8181  uint32_t mpuacc = 0;
    8282
    83   if ( _Nios2_MPU_Is_valid_index( config, data, index ) ) {
     83  if ( _Nios2_MPU_Is_valid_index( config, index, data ) ) {
    8484    if ( !force ) {
    8585      _Nios2_MPU_Get_region_registers( index, data, &mpubase, &mpuacc );
  • cpukit/score/cpu/nios2/nios2-mpu-descriptor.c

    r7afcb26 rabe87b9  
    8989  );
    9090  bool ok = is_valid_base_and_end
    91     && _Nios2_MPU_Is_valid_index( config, desc->data, desc->index )
     91    && _Nios2_MPU_Is_valid_index( config, desc->index, desc->data )
    9292    && _Nios2_Is_valid_permission( desc->data, desc->perm )
    9393    && !(!desc->data && desc->cacheable)
     
    107107  return ok;
    108108}
     109
     110bool _Nios2_MPU_Get_region_descriptor(
     111  const Nios2_MPU_Configuration *config,
     112  int index,
     113  bool data,
     114  Nios2_MPU_Region_descriptor *desc
     115)
     116{
     117  bool ok = _Nios2_MPU_Is_valid_index( config, index, data );
     118
     119  if ( ok ) {
     120    uint32_t mpubase;
     121    uint32_t mpuacc;
     122
     123    _Nios2_MPU_Get_region_registers( index, data, &mpubase, &mpuacc );
     124
     125    desc->index = index;
     126    desc->base = (void *) (mpubase & NIOS2_MPUBASE_BASE_MASK);
     127    if ( config->region_uses_limit ) {
     128      desc->end = (void *) (mpuacc & NIOS2_MPUACC_LIMIT_MASK);
     129    } else {
     130      desc->end = (void *) ((mpuacc & NIOS2_MPUACC_MASK_MASK) + 1);
     131    }
     132    desc->perm = (mpuacc & NIOS2_MPUACC_PERM_MASK) >> NIOS2_MPUACC_PERM_OFFSET;
     133    desc->data = data;
     134    desc->cacheable = (mpuacc & NIOS2_MPUACC_C) != 0;
     135    desc->read = (mpuacc & NIOS2_MPUACC_RD) != 0;
     136    desc->write = (mpuacc & NIOS2_MPUACC_WR) != 0;
     137  }
     138
     139  return ok;
     140}
  • cpukit/score/cpu/nios2/rtems/score/nios2-utility.h

    r7afcb26 rabe87b9  
    387387static inline bool _Nios2_MPU_Is_valid_index(
    388388  const Nios2_MPU_Configuration *config,
    389   bool data,
    390   int index
     389  int index,
     390  bool data
    391391)
    392392{
     
    400400  uint32_t *mpubase,
    401401  uint32_t *mpuacc
     402);
     403
     404bool _Nios2_MPU_Get_region_descriptor(
     405  const Nios2_MPU_Configuration *config,
     406  int index,
     407  bool data,
     408  Nios2_MPU_Region_descriptor *desc
    402409);
    403410
     
    452459}
    453460
     461static inline void _Nios2_MPU_Set_region_registers(
     462  uint32_t mpubase,
     463  uint32_t mpuacc
     464)
     465{
     466  _Nios2_Set_ctlreg_mpubase( mpubase );
     467  _Nios2_Set_ctlreg_mpuacc( mpuacc );
     468  _Nios2_Flush_pipeline();
     469}
     470
    454471static inline void _Nios2_MPU_Enable( void )
    455472{
  • cpukit/score/include/rtems/score/rbtree.h

    r7afcb26 rabe87b9  
    322322);
    323323
     324/**
     325 * @brief Returns the in-order next node of a node.
     326 *
     327 * @param[in] rbtree The red-black tree.
     328 * @param[in] node The node.
     329 * @param[in] dir The direction.
     330 *
     331 * @retval NULL The in-order next node does not exist.
     332 * @retval otherwise The next node.
     333 */
     334RBTree_Node *_RBTree_Next_unprotected(
     335  const RBTree_Control *rbtree,
     336  const RBTree_Node *node,
     337  RBTree_Direction dir
     338);
     339
     340/**
     341 * @copydoc _RBTree_Next_unprotected()
     342 *
     343 * The function disables the interrupts protect the operation.
     344 */
     345RBTree_Node *_RBTree_Next(
     346  const RBTree_Control *rbtree,
     347  const RBTree_Node *node,
     348  RBTree_Direction dir
     349);
     350
     351/**
     352 * @brief Red-black tree visitor.
     353 *
     354 * @param[in] node The node.
     355 * @param[in] dir The direction.
     356 * @param[in] visitor_arg The visitor argument.
     357 *
     358 * @retval true Stop the iteration.
     359 * @retval false Continue the iteration.
     360 *
     361 * @see _RBTree_Iterate_unprotected().
     362 */
     363typedef bool (*RBTree_Visitor)(
     364  const RBTree_Node *node,
     365  RBTree_Direction dir,
     366  void *visitor_arg
     367);
     368
     369/**
     370 * @brief Red-black tree iteration.
     371 *
     372 * @param[in] rbtree The red-black tree.
     373 * @param[in] dir The direction.
     374 * @param[in] visitor The visitor.
     375 * @param[in] visitor_arg The visitor argument.
     376 */
     377void _RBTree_Iterate_unprotected(
     378  const RBTree_Control *rbtree,
     379  RBTree_Direction dir,
     380  RBTree_Visitor visitor,
     381  void *visitor_arg
     382);
     383
    324384#ifndef __RTEMS_APPLICATION__
    325385#include <rtems/score/rbtree.inl>
  • cpukit/score/inline/rtems/score/rbtree.inl

    r7afcb26 rabe87b9  
    377377}
    378378
    379 /** @brief Find the nodes in-order predecessor
    380  *
    381  *  This function returns a pointer to the in-order predecessor
    382  *  of @a the_node if it exists, and NULL if not.
     379/**
     380 * @brief Returns the predecessor of a node.
     381 *
     382 * @param[in] rbtree The red-black tree.
     383 * @param[in] node The node.
     384 *
     385 * @retval NULL The predecessor does not exist.
     386 * @retval otherwise The predecessor node.
     387 */
     388RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected(
     389  const RBTree_Control *rbtree,
     390  const RBTree_Node *node
     391)
     392{
     393  return _RBTree_Next_unprotected( rbtree, node, RBT_LEFT );
     394}
     395
     396/**
     397 * @copydoc _RBTree_Predecessor_unprotected()
     398 *
     399 * The function disables the interrupts protect the operation.
    383400 */
    384401RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor(
    385     RBTree_Node *the_node
    386     )
    387 {
    388   RBTree_Node* iter_node;
    389   if (!the_node) return NULL;
    390   iter_node = the_node->child[RBT_LEFT];
    391   if (!iter_node) return NULL;
    392   while (iter_node->child[RBT_RIGHT]) {
    393     iter_node = iter_node->child[RBT_RIGHT];
    394   }
    395   return iter_node;
    396 }
    397 
    398 /** @brief Find the nodes in-order successor
    399  *
    400  *  This function returns a pointer to the in-order successor 
    401  *  of @a the_node if it exists, and NULL if not.
     402  const RBTree_Control *rbtree,
     403  const RBTree_Node *node
     404)
     405{
     406  return _RBTree_Next( rbtree, node, RBT_LEFT );
     407}
     408
     409/**
     410 * @brief Returns the successor of a node.
     411 *
     412 * @param[in] rbtree The red-black tree.
     413 * @param[in] node The node.
     414 *
     415 * @retval NULL The successor does not exist.
     416 * @retval otherwise The successor node.
     417 */
     418RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected(
     419  const RBTree_Control *rbtree,
     420  const RBTree_Node *node
     421)
     422{
     423  return _RBTree_Next_unprotected( rbtree, node, RBT_RIGHT );
     424}
     425
     426/**
     427 * @copydoc _RBTree_Successor_unprotected()
     428 *
     429 * The function disables the interrupts protect the operation.
    402430 */
    403431RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor(
    404     RBTree_Node *the_node
    405     )
    406 {
    407   RBTree_Node* iter_node;
    408   if (!the_node) return NULL;
    409   iter_node = the_node->child[RBT_RIGHT];
    410   if (!iter_node) return NULL;
    411   while (iter_node->child[RBT_LEFT]) {
    412     iter_node = iter_node->child[RBT_LEFT];
    413   }
    414   return iter_node;
     432  const RBTree_Control *rbtree,
     433  const RBTree_Node *node
     434)
     435{
     436  return _RBTree_Next( rbtree, node, RBT_RIGHT );
    415437}
    416438
  • testsuites/libtests/Makefile.am

    r7afcb26 rabe87b9  
    66
    77SUBDIRS = POSIX
     8SUBDIRS += rbheap01
    89SUBDIRS += flashdisk01
    910
  • testsuites/libtests/configure.ac

    r7afcb26 rabe87b9  
    4444# Explicitly list all Makefiles here
    4545AC_CONFIG_FILES([Makefile
     46rbheap01/Makefile
    4647syscall01/Makefile
    4748flashdisk01/Makefile
  • testsuites/libtests/flashdisk01/test-file-system.c

    r7afcb26 rabe87b9  
    597597  if (pos != (off_t) -1) {
    598598    size_t buf_size = sizeof(fs->buf);
     599    size_t offset = HEADER_SIZE + 1;
    599600    long random = lrand48();
    600     size_t out = get_bucket_with_random(buf_size, random) + 1;
     601    size_t out = get_bucket_with_random(buf_size - offset, random) + offset;
    601602    ssize_t out_actual = 0;
    602603    uint8_t *buf = fs->buf;
     
    605606    size_t word_count = 0;
    606607    size_t w = 0;
    607 
    608     /* Must be big enough for the header */
    609     out = out >= HEADER_SIZE ? out : HEADER_SIZE;
    610608
    611609    /*
  • testsuites/sptests/sprbtree01/init.c

    r7afcb26 rabe87b9  
    441441
    442442  puts( "INIT - Verify rtems_rbtree_predecessor/successor");
    443   p = rtems_rbtree_predecessor(p);
     443  p = rtems_rbtree_predecessor(&rbtree1, p);
    444444  if(p && rtems_rbtree_container_of(p,test_node,Node)->id != 29) {
    445445    puts ("INIT - ERROR ON RBTREE ID MISMATCH");
     
    447447  }
    448448  p = rtems_rbtree_find(&rbtree1, &search_node.Node);
    449   p = rtems_rbtree_successor(p);
     449  p = rtems_rbtree_successor(&rbtree1, p);
    450450  if(p && rtems_rbtree_container_of(p,test_node,Node)->id != 31) {
    451451    puts ("INIT - ERROR ON RBTREE ID MISMATCH");
Note: See TracChangeset for help on using the changeset viewer.