Changeset 4ea97d24 in rtems


Ignore:
Timestamp:
Nov 19, 2013, 3:21:54 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
bb81e04
Parents:
833dd90
git-author:
Sebastian Huber <sebastian.huber@…> (11/19/13 15:21:54)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/21/13 11:58:46)
Message:

score/rbtree: Remove "unprotected" from API

Files:
19 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/keyfreememory.c

    r833dd90 r4ea97d24  
    3535  search_node.key = key_id;
    3636  search_node.thread_id = 0;
    37   iter = _RBTree_Find_unprotected( &_POSIX_Keys_Key_value_lookup_tree, &search_node.Key_value_lookup_node );
     37  iter = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree, &search_node.Key_value_lookup_node );
    3838  if ( !iter )
    3939    return;
     
    4141   * find the smallest thread_id node in the rbtree.
    4242   */
    43   next = _RBTree_Next_unprotected( iter, RBT_LEFT );
     43  next = _RBTree_Next( iter, RBT_LEFT );
    4444  p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node );
    4545  while ( next != NULL && p->key == key_id) {
    4646    iter = next;
    47     next = _RBTree_Next_unprotected( iter, RBT_LEFT );
     47    next = _RBTree_Next( iter, RBT_LEFT );
    4848    p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node );
    4949  }
     
    5454  p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node );
    5555  while ( iter != NULL && p->key == key_id ) {
    56     next = _RBTree_Next_unprotected( iter, RBT_RIGHT );
    57     _RBTree_Extract_unprotected( &_POSIX_Keys_Key_value_lookup_tree, iter );
     56    next = _RBTree_Next( iter, RBT_RIGHT );
     57    _RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter );
    5858    _Chain_Extract_unprotected( &p->Key_values_per_thread_node );
    5959    _POSIX_Keys_Key_value_pair_free( p );
  • cpukit/posix/src/keygetspecific.c

    r833dd90 r4ea97d24  
    5252      search_node.key = key;
    5353      search_node.thread_id = _Thread_Executing->Object.id;
    54       p = _RBTree_Find_unprotected( &_POSIX_Keys_Key_value_lookup_tree,
     54      p = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree,
    5555                                    &search_node.Key_value_lookup_node );
    5656      key_data = NULL;
  • cpukit/posix/src/keyrundestructors.c

    r833dd90 r4ea97d24  
    6161     * structure.
    6262     */
    63     _RBTree_Extract_unprotected(
     63    _RBTree_Extract(
    6464        &_POSIX_Keys_Key_value_lookup_tree,
    6565        &iter->Key_value_lookup_node
  • cpukit/posix/src/keysetspecific.c

    r833dd90 r4ea97d24  
    5555      value_pair_ptr->thread_id = _Thread_Executing->Object.id;
    5656      value_pair_ptr->value = value;
    57       if ( _RBTree_Insert_unprotected( &_POSIX_Keys_Key_value_lookup_tree,
     57      if ( _RBTree_Insert( &_POSIX_Keys_Key_value_lookup_tree,
    5858                                       &(value_pair_ptr->Key_value_lookup_node) ) ) {
    5959        _Freechain_Put( (Freechain_Control *)&_POSIX_Keys_Keypool,
  • cpukit/sapi/include/rtems/rbtree.h

    r833dd90 r4ea97d24  
    2828
    2929/**
     30 * @defgroup ClassicRBTrees Red-Black Trees
     31 *
     32 * @ingroup ClassicRTEMS
     33 *
     34 * @brief A Red-Black Tree container.
     35 *
     36 * The red-black tree container offers no internal protection against
     37 * concurrent access.  The user must ensure that at most one thread at once can
     38 * access a red-black tree instance.
     39 *
     40 * @{
     41 */
     42
     43/**
    3044 * @typedef rtems_rbtree_node
    3145 *
     
    300314
    301315/**
    302  * @copydoc _RBTree_Find_unprotected()
    303  */
    304 RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_find_unprotected(
     316 * @copydoc _RBTree_Find()
     317 */
     318RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_find(
    305319  const rtems_rbtree_control *the_rbtree,
    306320  const rtems_rbtree_node *the_node
    307321)
    308322{
    309   return _RBTree_Find_unprotected( the_rbtree, the_node );
    310 }
    311 
    312 /**
    313  * @copydoc _RBTree_Predecessor_unprotected()
    314  */
    315 RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_predecessor_unprotected(
     323  return _RBTree_Find( the_rbtree, the_node );
     324}
     325
     326/**
     327 * @copydoc _RBTree_Predecessor()
     328 */
     329RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_predecessor(
    316330  const rtems_rbtree_node *node
    317331)
    318332{
    319   return _RBTree_Predecessor_unprotected( node );
    320 }
    321 
    322 /**
    323  * @copydoc _RBTree_Successor_unprotected()
    324  */
    325 RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_successor_unprotected(
     333  return _RBTree_Predecessor( node );
     334}
     335
     336/**
     337 * @copydoc _RBTree_Successor()
     338 */
     339RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_successor(
    326340  const rtems_rbtree_node *node
    327341)
    328342{
    329   return _RBTree_Successor_unprotected( node );
    330 }
    331 
    332 /**
    333  * @copydoc _RBTree_Extract_unprotected()
    334  */
    335 RTEMS_INLINE_ROUTINE void rtems_rbtree_extract_unprotected(
     343  return _RBTree_Successor( node );
     344}
     345
     346/**
     347 * @copydoc _RBTree_Extract()
     348 */
     349RTEMS_INLINE_ROUTINE void rtems_rbtree_extract(
    336350  rtems_rbtree_control *the_rbtree,
    337351  rtems_rbtree_node *the_node
    338352)
    339353{
    340   _RBTree_Extract_unprotected( the_rbtree, the_node );
     354  _RBTree_Extract( the_rbtree, the_node );
    341355}
    342356
     
    348362 */
    349363
    350 RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_min_unprotected(
     364RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_min(
    351365  rtems_rbtree_control *the_rbtree
    352366)
    353367{
    354   return _RBTree_Get_unprotected( the_rbtree, RBT_LEFT );
     368  return _RBTree_Get( the_rbtree, RBT_LEFT );
    355369}
    356370
     
    362376 */
    363377
    364 RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_max_unprotected(
     378RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_max(
    365379  rtems_rbtree_control *the_rbtree
    366380)
    367381{
    368   return _RBTree_Get_unprotected( the_rbtree, RBT_RIGHT );
     382  return _RBTree_Get( the_rbtree, RBT_RIGHT );
    369383}
    370384
     
    398412
    399413/**
    400  * @copydoc _RBTree_Find_header_unprotected()
    401  */
    402 RTEMS_INLINE_ROUTINE rtems_rbtree_control *rtems_rbtree_find_header_unprotected(
     414 * @copydoc _RBTree_Find_header()
     415 */
     416RTEMS_INLINE_ROUTINE rtems_rbtree_control *rtems_rbtree_find_header(
    403417  rtems_rbtree_node *the_node
    404418)
    405419{
    406   return _RBTree_Find_header_unprotected( the_node );
    407 }
    408 
    409 /**
    410  * @copydoc _RBTree_Insert_unprotected()
    411  */
    412 RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_insert_unprotected(
     420  return _RBTree_Find_header( the_node );
     421}
     422
     423/**
     424 * @copydoc _RBTree_Insert()
     425 */
     426RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_insert(
    413427  rtems_rbtree_control *the_rbtree,
    414428  rtems_rbtree_node *the_node
    415429)
    416430{
    417   return _RBTree_Insert_unprotected( the_rbtree, the_node );
     431  return _RBTree_Insert( the_rbtree, the_node );
    418432}
    419433
     
    428442}
    429443
     444/** @} */
     445
    430446#ifdef __cplusplus
    431447}
  • cpukit/sapi/src/rbheap.c

    r833dd90 r4ea97d24  
    8181)
    8282{
    83   _RBTree_Insert_unprotected(tree, &chunk->tree_node);
     83  _RBTree_Insert(tree, &chunk->tree_node);
    8484}
    8585
     
    199199
    200200  return rtems_rbheap_chunk_of_node(
    201     _RBTree_Find_unprotected(chunk_tree, &chunk.tree_node)
     201    _RBTree_Find(chunk_tree, &chunk.tree_node)
    202202  );
    203203}
     
    209209{
    210210  return rtems_rbheap_chunk_of_node(
    211     _RBTree_Next_unprotected(&chunk->tree_node, dir)
     211    _RBTree_Next(&chunk->tree_node, dir)
    212212  );
    213213}
     
    231231    rtems_chain_extract_unprotected(&b->chain_node);
    232232    add_to_chain(free_chain, b);
    233     _RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
     233    _RBTree_Extract(chunk_tree, &b->tree_node);
    234234  }
    235235}
  • cpukit/score/include/rtems/score/rbtree.h

    r833dd90 r4ea97d24  
    217217 * @retval NULL No node exists in the tree for the key.
    218218 */
    219 RBTree_Node *_RBTree_Find_unprotected(
     219RBTree_Node *_RBTree_Find(
    220220  const RBTree_Control *the_rbtree,
    221221  const RBTree_Node *the_node
     
    223223
    224224/**
    225  *  @brief Insert @a the_node on the Red-Black Tree @a the_rbtree (unprotected).
     225 *  @brief Insert @a the_node on the Red-Black Tree @a the_rbtree.
    226226 *
    227227 *  This routine inserts @a the_node on the Red-Black Tree @a the_rbtree.
     
    232232 *          in an unique @a the_rbtree.
    233233 */
    234 RBTree_Node *_RBTree_Insert_unprotected(
     234RBTree_Node *_RBTree_Insert(
    235235  RBTree_Control *the_rbtree,
    236236  RBTree_Node *the_node
     
    238238
    239239/**
    240  *  @brief Extracts (removes) @a the_node from @a the_rbtree (unprotected).
     240 *  @brief Extracts (removes) @a the_node from @a the_rbtree.
    241241 *
    242242 *  This routine extracts (removes) @a the_node from @a the_rbtree.
    243243 */
    244 void _RBTree_Extract_unprotected(
     244void _RBTree_Extract(
    245245  RBTree_Control *the_rbtree,
    246246  RBTree_Node *the_node
     
    256256 * @retval otherwise The next node.
    257257 */
    258 RBTree_Node *_RBTree_Next_unprotected(
     258RBTree_Node *_RBTree_Next(
    259259  const RBTree_Node *node,
    260260  RBTree_Direction dir
     
    472472 * Tree containing @a the_node if it exists, and NULL if not.
    473473 */
    474 RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header_unprotected(
     474RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header(
    475475    RBTree_Node *the_node
    476476    )
     
    509509 *         the predecessor node.
    510510 */
    511 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected(
     511RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor(
    512512  const RBTree_Node *node
    513513)
    514514{
    515   return _RBTree_Next_unprotected( node, RBT_LEFT );
     515  return _RBTree_Next( node, RBT_LEFT );
    516516}
    517517
     
    523523 * @retval NULL The successor does not exist.  Otherwise the successor node.
    524524 */
    525 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected(
     525RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor(
    526526  const RBTree_Node *node
    527527)
    528528{
    529   return _RBTree_Next_unprotected( node, RBT_RIGHT );
    530 }
    531 
    532 /**
    533  * @brief Get the first node (unprotected).
     529  return _RBTree_Next( node, RBT_RIGHT );
     530}
     531
     532/**
     533 * @brief Get the first node.
    534534 *
    535535 * This function removes the minimum or maximum node from the_rbtree and
     
    543543 * @note This routine may return NULL if the RBTree is empty.
    544544 */
    545 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Get_unprotected(
     545RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Get(
    546546    RBTree_Control *the_rbtree,
    547547    RBTree_Direction dir
     
    549549{
    550550  RBTree_Node *the_node = the_rbtree->first[dir];
    551   _RBTree_Extract_unprotected(the_rbtree, the_node);
     551  _RBTree_Extract(the_rbtree, the_node);
    552552  return the_node;
    553553}
  • cpukit/score/include/rtems/score/rbtreeimpl.h

    r833dd90 r4ea97d24  
    4444 * @retval false Continue the iteration.
    4545 *
    46  * @see _RBTree_Iterate_unprotected().
     46 * @see _RBTree_Iterate().
    4747 */
    4848typedef bool (*RBTree_Visitor)(
     
    6060 * @param[in] visitor_arg The visitor argument.
    6161 */
    62 void _RBTree_Iterate_unprotected(
     62void _RBTree_Iterate(
    6363  const RBTree_Control *rbtree,
    6464  RBTree_Direction dir,
  • cpukit/score/src/rbtree.c

    r833dd90 r4ea97d24  
    4444  next  = starting_address;
    4545  while ( count-- ) {
    46     _RBTree_Insert_unprotected(the_rbtree, next);
     46    _RBTree_Insert(the_rbtree, next);
    4747    next           = (RBTree_Node *)
    4848                        _Addresses_Add_offset( (void *) next, node_size );
  • cpukit/score/src/rbtreeextract.c

    r833dd90 r4ea97d24  
    2222 *        of the extract operation.
    2323 */
    24 static void _RBTree_Extract_validate_unprotected(
     24static void _RBTree_Extract_validate(
    2525    RBTree_Node *the_node
    2626    )
     
    9292 *        of the extract operation.
    9393 */
    94 void _RBTree_Extract_unprotected(
     94void _RBTree_Extract(
    9595    RBTree_Control *the_rbtree,
    9696    RBTree_Node *the_node
     
    106106  if (the_node == the_rbtree->first[RBT_LEFT]) {
    107107    RBTree_Node *next;
    108     next = _RBTree_Successor_unprotected(the_node);
     108    next = _RBTree_Successor(the_node);
    109109    the_rbtree->first[RBT_LEFT] = next;
    110110  }
     
    114114  if (the_node == the_rbtree->first[RBT_RIGHT]) {
    115115    RBTree_Node *previous;
    116     previous = _RBTree_Predecessor_unprotected(the_node);
     116    previous = _RBTree_Predecessor(the_node);
    117117    the_rbtree->first[RBT_RIGHT] = previous;
    118118  }
     
    140140    } else {
    141141      /* fix the tree here if the child is a null leaf. */
    142       _RBTree_Extract_validate_unprotected(target);
     142      _RBTree_Extract_validate(target);
    143143    }
    144144    victim_color = target->color;
     
    177177    } else {
    178178      /* fix the tree here if the child is a null leaf. */
    179       _RBTree_Extract_validate_unprotected(the_node);
     179      _RBTree_Extract_validate(the_node);
    180180    }
    181181    victim_color = the_node->color;
  • cpukit/score/src/rbtreefind.c

    r833dd90 r4ea97d24  
    2121#include <rtems/score/isr.h>
    2222
    23 RBTree_Node *_RBTree_Find_unprotected(
     23RBTree_Node *_RBTree_Find(
    2424  const RBTree_Control *the_rbtree,
    2525  const RBTree_Node *the_node
  • cpukit/score/src/rbtreeinsert.c

    r833dd90 r4ea97d24  
    2222 *        append operation.
    2323 */
    24 static void _RBTree_Validate_insert_unprotected(
     24static void _RBTree_Validate_insert(
    2525    RBTree_Node    *the_node
    2626    )
     
    7474 *        of the extract operation.
    7575 */
    76 RBTree_Node *_RBTree_Insert_unprotected(
     76RBTree_Node *_RBTree_Insert(
    7777    RBTree_Control *the_rbtree,
    7878    RBTree_Node *the_node
     
    119119
    120120    /* verify red-black properties */
    121     _RBTree_Validate_insert_unprotected(the_node);
     121    _RBTree_Validate_insert(the_node);
    122122  }
    123123  return (RBTree_Node*)0;
  • cpukit/score/src/rbtreeiterate.c

    r833dd90 r4ea97d24  
    44 * @ingroup ScoreRBTree
    55 *
    6  * @brief _RBTree_Iterate_unprotected() implementation.
     6 * @brief _RBTree_Iterate() implementation.
    77 */
    88
     
    2727#include <rtems/score/rbtreeimpl.h>
    2828
    29 void _RBTree_Iterate_unprotected(
     29void _RBTree_Iterate(
    3030  const RBTree_Control *rbtree,
    3131  RBTree_Direction dir,
     
    4141    stop = (*visitor)( current, dir, visitor_arg );
    4242
    43     current = _RBTree_Next_unprotected( current, dir );
     43    current = _RBTree_Next( current, dir );
    4444  }
    4545}
  • cpukit/score/src/rbtreenext.c

    r833dd90 r4ea97d24  
    44 * @ingroup ScoreRBTree
    55 *
    6  * @brief _RBTree_Next_unprotected() and _RBTree_Next() implementation.
     6 * @brief _RBTree_Next() and _RBTree_Next() implementation.
    77 */
    88
     
    2828#include <rtems/score/isr.h>
    2929
    30 RBTree_Node *_RBTree_Next_unprotected(
     30RBTree_Node *_RBTree_Next(
    3131  const RBTree_Node *node,
    3232  RBTree_Direction dir
  • cpukit/score/src/scheduleredfenqueue.c

    r833dd90 r4ea97d24  
    3232  RBTree_Node *node = &(sched_info->Node);
    3333
    34   _RBTree_Insert_unprotected( &_Scheduler_EDF_Ready_queue, node );
     34  _RBTree_Insert( &_Scheduler_EDF_Ready_queue, node );
    3535  sched_info->queue_state = SCHEDULER_EDF_QUEUE_STATE_YES;
    3636}
  • cpukit/score/src/scheduleredfextract.c

    r833dd90 r4ea97d24  
    3232  RBTree_Node *node = &(sched_info->Node);
    3333
    34   _RBTree_Extract_unprotected( &_Scheduler_EDF_Ready_queue, node );
     34  _RBTree_Extract( &_Scheduler_EDF_Ready_queue, node );
    3535  sched_info->queue_state = SCHEDULER_EDF_QUEUE_STATE_NOT_PRESENTLY;
    3636}
  • cpukit/score/src/scheduleredfyield.c

    r833dd90 r4ea97d24  
    3636   * with the same priority in case there are such ones.
    3737   */
    38   _RBTree_Extract_unprotected( &_Scheduler_EDF_Ready_queue, thread_node );
    39   _RBTree_Insert_unprotected( &_Scheduler_EDF_Ready_queue, thread_node );
     38  _RBTree_Extract( &_Scheduler_EDF_Ready_queue, thread_node );
     39  _RBTree_Insert( &_Scheduler_EDF_Ready_queue, thread_node );
    4040
    4141  _ISR_Flash( level );
  • testsuites/libtests/rbheap01/init.c

    r833dd90 r4ea97d24  
    188188  };
    189189
    190   _RBTree_Iterate_unprotected(
     190  _RBTree_Iterate(
    191191    &control->chunk_tree,
    192192    RBT_RIGHT,
  • testsuites/sptests/sprbtree01/init.c

    r833dd90 r4ea97d24  
    118118  node2.id = 2;
    119119  node2.key = 2;
    120   rtems_rbtree_insert_unprotected( &rbtree1, &node1.Node );
    121   rtems_rbtree_insert_unprotected( &rbtree1, &node2.Node );
    122 
    123   p = rtems_rbtree_insert_unprotected( &rbtree1, NULL );
     120  rtems_rbtree_insert( &rbtree1, &node1.Node );
     121  rtems_rbtree_insert( &rbtree1, &node2.Node );
     122
     123  p = rtems_rbtree_insert( &rbtree1, NULL );
    124124  if (p != (void *)(-1))
    125125    puts( "INIT - FAILED NULL NODE INSERT" );
     
    136136    puts( "INIT - FAILED TREE CHECK" );
    137137
    138   for ( p = rtems_rbtree_get_min_unprotected(&rbtree1), id = 1 ; p ;
    139       p = rtems_rbtree_get_min_unprotected(&rbtree1) , id++ ) {
     138  for ( p = rtems_rbtree_get_min(&rbtree1), id = 1 ; p ;
     139      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
    140140    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    141141    if ( id > 2 ) {
     
    158158  puts("INIT - Verify rtems_rbtree_insert with the same value twice");
    159159  node2.key = node1.key;
    160   rtems_rbtree_insert_unprotected(&rbtree1, &node1.Node);
    161   p = rtems_rbtree_insert_unprotected(&rbtree1, &node2.Node);
     160  rtems_rbtree_insert(&rbtree1, &node1.Node);
     161  p = rtems_rbtree_insert(&rbtree1, &node2.Node);
    162162
    163163  if (p != &node1.Node)
    164164    puts( "INIT - FAILED DUPLICATE INSERT" );
    165165
    166   for ( p = rtems_rbtree_get_min_unprotected(&rbtree1), id = 1 ; p ;
    167       p = rtems_rbtree_get_min_unprotected(&rbtree1) , id++ ) {
     166  for ( p = rtems_rbtree_get_min(&rbtree1), id = 1 ; p ;
     167      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
    168168    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    169169    if ( id > 1 ) {
     
    193193
    194194  puts( "INIT - Verify rtems_XXX on an empty tree" );
    195   if(rtems_rbtree_get_min_unprotected(&rbtree1)) {
     195  if(rtems_rbtree_get_min(&rbtree1)) {
    196196    puts("INIT - get_min on empty returned non-NULL");
    197197    rtems_test_exit(0);
    198198  }
    199   if(rtems_rbtree_get_max_unprotected(&rbtree1)) {
     199  if(rtems_rbtree_get_max(&rbtree1)) {
    200200    puts("INIT - get_max on empty returned non-NULL");
    201201    rtems_test_exit(0);
     
    217217  node2.id = 1;
    218218  node2.key = 1;
    219   rtems_rbtree_insert_unprotected( &rbtree1, &node1.Node );
    220   rtems_rbtree_insert_unprotected( &rbtree1, &node2.Node );
     219  rtems_rbtree_insert( &rbtree1, &node1.Node );
     220  rtems_rbtree_insert( &rbtree1, &node2.Node );
    221221
    222222  puts( "INIT - Verify rtems_rbtree_peek_max/min, rtems_rbtree_extract" );
     
    230230  }
    231231  p = rtems_rbtree_peek_max(&rbtree1);
    232   rtems_rbtree_extract_unprotected(&rbtree1, p);
     232  rtems_rbtree_extract(&rbtree1, p);
    233233  t1 = rtems_rbtree_container_of(p,test_node,Node);
    234234  if (t1->key != 2) {
     
    236236    rtems_test_exit(0);
    237237  }
    238   rtems_rbtree_insert_unprotected(&rbtree1, p);
    239 
    240   for ( p = rtems_rbtree_get_min_unprotected(&rbtree1), id = 1 ; p ;
    241       p = rtems_rbtree_get_min_unprotected(&rbtree1) , id++ ) {
     238  rtems_rbtree_insert(&rbtree1, p);
     239
     240  for ( p = rtems_rbtree_get_min(&rbtree1), id = 1 ; p ;
     241      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
    242242    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    243243    if ( id > 2 ) {
     
    255255    node_array[i].id = i;
    256256    node_array[i].key = i;
    257     rtems_rbtree_insert_unprotected( &rbtree1, &node_array[i].Node );
     257    rtems_rbtree_insert( &rbtree1, &node_array[i].Node );
    258258
    259259    if (!rb_assert(rbtree1.root) )
     
    263263  puts( "INIT - Removing 100 nodes" );
    264264
    265   for ( p = rtems_rbtree_get_min_unprotected(&rbtree1), id = 0 ; p ;
    266       p = rtems_rbtree_get_min_unprotected(&rbtree1) , id++ ) {
     265  for ( p = rtems_rbtree_get_min(&rbtree1), id = 0 ; p ;
     266      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
    267267    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    268268    if ( id > 99 ) {
     
    288288    node_array[i].id = 99-i;
    289289    node_array[i].key = 99-i;
    290     rtems_rbtree_insert_unprotected( &rbtree1, &node_array[i].Node );
     290    rtems_rbtree_insert( &rbtree1, &node_array[i].Node );
    291291
    292292    if (!rb_assert(rbtree1.root) )
     
    296296  puts( "INIT - Removing 100 nodes" );
    297297
    298   for ( p = rtems_rbtree_get_min_unprotected(&rbtree1), id = 0 ; p ;
    299       p = rtems_rbtree_get_min_unprotected(&rbtree1) , id++ ) {
     298  for ( p = rtems_rbtree_get_min(&rbtree1), id = 0 ; p ;
     299      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
    300300    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    301301    if ( id > 99 ) {
     
    323323    node_array[i].id = i;
    324324    node_array[i].key = i;
    325     rtems_rbtree_insert_unprotected( &rbtree1, &node_array[i].Node );
     325    rtems_rbtree_insert( &rbtree1, &node_array[i].Node );
    326326
    327327    if (!rb_assert(rbtree1.root) )
     
    333333  for (i = 0; i < 20; i++) {
    334334    id = numbers[i];
    335     rtems_rbtree_extract_unprotected( &rbtree1, &node_array[id].Node );
     335    rtems_rbtree_extract( &rbtree1, &node_array[id].Node );
    336336    if (!rb_assert(rbtree1.root) )
    337337      puts( "INIT - FAILED TREE CHECK" );
     
    340340  puts( "INIT - Removing 80 nodes" );
    341341
    342   for ( p = rtems_rbtree_get_min_unprotected(&rbtree1), id = 0, i = 0 ; p ;
    343       p = rtems_rbtree_get_min_unprotected(&rbtree1) , id++ ) {
     342  for ( p = rtems_rbtree_get_min(&rbtree1), id = 0, i = 0 ; p ;
     343      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
    344344    test_node *t = rtems_rbtree_container_of(p, test_node, Node);
    345345
     
    375375    node_array[i].key = i;
    376376  }
    377   rtems_rbtree_insert_unprotected( &rbtree1, &node_array[3].Node );
    378   rtems_rbtree_insert_unprotected( &rbtree1, &node_array[1].Node );
    379   rtems_rbtree_insert_unprotected( &rbtree1, &node_array[5].Node );
    380   rtems_rbtree_insert_unprotected( &rbtree1, &node_array[0].Node );
    381   rtems_rbtree_insert_unprotected( &rbtree1, &node_array[2].Node );
    382   rtems_rbtree_insert_unprotected( &rbtree1, &node_array[4].Node );
    383   rtems_rbtree_insert_unprotected( &rbtree1, &node_array[6].Node );
    384   rtems_rbtree_extract_unprotected( &rbtree1, &node_array[2].Node );
     377  rtems_rbtree_insert( &rbtree1, &node_array[3].Node );
     378  rtems_rbtree_insert( &rbtree1, &node_array[1].Node );
     379  rtems_rbtree_insert( &rbtree1, &node_array[5].Node );
     380  rtems_rbtree_insert( &rbtree1, &node_array[0].Node );
     381  rtems_rbtree_insert( &rbtree1, &node_array[2].Node );
     382  rtems_rbtree_insert( &rbtree1, &node_array[4].Node );
     383  rtems_rbtree_insert( &rbtree1, &node_array[6].Node );
     384  rtems_rbtree_extract( &rbtree1, &node_array[2].Node );
    385385  /* node_array[1] has now only a left child. */
    386386  if ( !node_array[1].Node.child[RBT_LEFT] ||
    387387        node_array[1].Node.child[RBT_RIGHT] )
    388388     puts( "INIT - LEFT CHILD ONLY NOT FOUND" );
    389   rtems_rbtree_extract_unprotected( &rbtree1, &node_array[3].Node );
    390   while( (p = rtems_rbtree_get_max_unprotected(&rbtree1)) );
     389  rtems_rbtree_extract( &rbtree1, &node_array[3].Node );
     390  while( (p = rtems_rbtree_get_max(&rbtree1)) );
    391391
    392392  puts( "INIT - Verify rtems_rbtree_get_max with 100 nodes value [99,0]" );
     
    394394    node_array[i].id = 99-i;
    395395    node_array[i].key = 99-i;
    396     rtems_rbtree_insert_unprotected( &rbtree1, &node_array[i].Node );
     396    rtems_rbtree_insert( &rbtree1, &node_array[i].Node );
    397397
    398398    if (!rb_assert(rbtree1.root) )
     
    402402  puts( "INIT - Removing 100 nodes" );
    403403
    404   for ( p = rtems_rbtree_get_max_unprotected(&rbtree1), id = 0 ; p ;
    405       p = rtems_rbtree_get_max_unprotected(&rbtree1) , id++ ) {
     404  for ( p = rtems_rbtree_get_max(&rbtree1), id = 0 ; p ;
     405      p = rtems_rbtree_get_max(&rbtree1) , id++ ) {
    406406    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    407407    if ( id > 99 ) {
     
    427427    node_array[i].id = i;
    428428    node_array[i].key = i;
    429     rtems_rbtree_insert_unprotected( &rbtree1, &node_array[i].Node );
     429    rtems_rbtree_insert( &rbtree1, &node_array[i].Node );
    430430
    431431    if (!rb_assert(rbtree1.root) )
     
    435435  puts( "INIT - Verify rtems_rbtree_find" );
    436436  search_node.key = 30;
    437   p = rtems_rbtree_find_unprotected(&rbtree1, &search_node.Node);
     437  p = rtems_rbtree_find(&rbtree1, &search_node.Node);
    438438  if(rtems_rbtree_container_of(p,test_node,Node)->id != 30) {
    439439    puts ("INIT - ERROR ON RBTREE ID MISMATCH");
     
    442442
    443443  puts( "INIT - Verify rtems_rbtree_predecessor/successor");
    444   p = rtems_rbtree_predecessor_unprotected(p);
     444  p = rtems_rbtree_predecessor(p);
    445445  if(p && rtems_rbtree_container_of(p,test_node,Node)->id != 29) {
    446446    puts ("INIT - ERROR ON RBTREE ID MISMATCH");
    447447    rtems_test_exit(0);
    448448  }
    449   p = rtems_rbtree_find_unprotected(&rbtree1, &search_node.Node);
    450   p = rtems_rbtree_successor_unprotected(p);
     449  p = rtems_rbtree_find(&rbtree1, &search_node.Node);
     450  p = rtems_rbtree_successor(p);
    451451  if(p && rtems_rbtree_container_of(p,test_node,Node)->id != 31) {
    452452    puts ("INIT - ERROR ON RBTREE ID MISMATCH");
     
    454454  }
    455455
    456   p = rtems_rbtree_find_unprotected(&rbtree1, &search_node.Node);
     456  p = rtems_rbtree_find(&rbtree1, &search_node.Node);
    457457  puts( "INIT - Verify rtems_rbtree_find_header" );
    458   if (rtems_rbtree_find_header_unprotected(p) != &rbtree1) {
     458  if (rtems_rbtree_find_header(p) != &rbtree1) {
    459459    puts ("INIT - ERROR ON RBTREE HEADER MISMATCH");
    460460    rtems_test_exit(0);
     
    474474  puts( "INIT - Removing 100 nodes" );
    475475
    476   for ( p = rtems_rbtree_get_max_unprotected(&rbtree1), id = 99 ; p ;
    477       p = rtems_rbtree_get_max_unprotected(&rbtree1) , id-- ) {
     476  for ( p = rtems_rbtree_get_max(&rbtree1), id = 99 ; p ;
     477      p = rtems_rbtree_get_max(&rbtree1) , id-- ) {
    478478    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    479479    if ( id < 0 ) {
     
    495495  }
    496496
    497   if (rtems_rbtree_find_header_unprotected(&node_array[0].Node) != NULL) {
     497  if (rtems_rbtree_find_header(&node_array[0].Node) != NULL) {
    498498    puts ("INIT - ERROR ON RBTREE HEADER MISMATCH");
    499499    rtems_test_exit(0);
    500500  }
    501   if (rtems_rbtree_find_header_unprotected(NULL) != NULL) {
     501  if (rtems_rbtree_find_header(NULL) != NULL) {
    502502    puts ("INIT - ERROR ON RBTREE HEADER MISMATCH");
    503503    rtems_test_exit(0);
     
    508508    node_array[i].id = numbers[i];
    509509    node_array[i].key = numbers[i];
    510     rtems_rbtree_insert_unprotected( &rbtree1, &node_array[i].Node );
     510    rtems_rbtree_insert( &rbtree1, &node_array[i].Node );
    511511
    512512    if (!rb_assert(rbtree1.root) )
     
    516516  puts( "INIT - Removing 20 nodes" );
    517517
    518   for ( p = rtems_rbtree_get_min_unprotected(&rbtree1), id = 0 ; p ;
    519       p = rtems_rbtree_get_min_unprotected(&rbtree1) , id++ ) {
     518  for ( p = rtems_rbtree_get_min(&rbtree1), id = 0 ; p ;
     519      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
    520520    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    521521    if ( id > 19 ) {
     
    548548  puts( "INIT - Removing 100 nodes" );
    549549
    550   for ( p = rtems_rbtree_get_min_unprotected(&rbtree1), id = 0 ; p ;
    551       p = rtems_rbtree_get_min_unprotected(&rbtree1) , id++ ) {
     550  for ( p = rtems_rbtree_get_min(&rbtree1), id = 0 ; p ;
     551      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
    552552    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    553553    if ( id > 99 ) {
     
    583583    node_array[i].id = i;
    584584    node_array[i].key = i%5;
    585     rtems_rbtree_insert_unprotected( &rbtree1, &node_array[i].Node );
     585    rtems_rbtree_insert( &rbtree1, &node_array[i].Node );
    586586
    587587    if (!rb_assert(rbtree1.root) )
     
    591591  puts( "INIT - Verify rtems_rbtree_find in a duplicate tree" );
    592592  search_node.key = 2;
    593   p = rtems_rbtree_find_unprotected(&rbtree1, &search_node.Node);
     593  p = rtems_rbtree_find(&rbtree1, &search_node.Node);
    594594  if(rtems_rbtree_container_of(p,test_node,Node)->id != 2) {
    595595    puts ("INIT - ERROR ON RBTREE ID MISMATCH");
     
    599599  puts( "INIT - Removing 100 nodes" );
    600600
    601   for ( p = rtems_rbtree_get_min_unprotected(&rbtree1), id = 0 ; p ;
    602       p = rtems_rbtree_get_min_unprotected(&rbtree1) , id++ ) {
     601  for ( p = rtems_rbtree_get_min(&rbtree1), id = 0 ; p ;
     602      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
    603603    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    604604    if ( id > 99 ) {
     
    624624    node_array[i].id = 99-i;
    625625    node_array[i].key = (99-i)%5;
    626     rtems_rbtree_insert_unprotected( &rbtree1, &node_array[i].Node );
     626    rtems_rbtree_insert( &rbtree1, &node_array[i].Node );
    627627
    628628    if (!rb_assert(rbtree1.root) )
     
    632632  puts( "INIT - Verify rtems_rbtree_find in a duplicate tree" );
    633633  search_node.key = 2;
    634   p = rtems_rbtree_find_unprotected(&rbtree1, &search_node.Node);
     634  p = rtems_rbtree_find(&rbtree1, &search_node.Node);
    635635  if(rtems_rbtree_container_of(p,test_node,Node)->id != 97) {
    636636    puts ("INIT - ERROR ON RBTREE ID MISMATCH");
     
    640640  puts( "INIT - Removing 100 nodes" );
    641641
    642   for ( p = rtems_rbtree_get_min_unprotected(&rbtree1), id = 0 ; p ;
    643       p = rtems_rbtree_get_min_unprotected(&rbtree1) , id++ ) {
     642  for ( p = rtems_rbtree_get_min(&rbtree1), id = 0 ; p ;
     643      p = rtems_rbtree_get_min(&rbtree1) , id++ ) {
    644644    test_node *t = rtems_rbtree_container_of(p,test_node,Node);
    645645    if ( id > 99 ) {
Note: See TracChangeset for help on using the changeset viewer.