Changeset 8572752 in rtems


Ignore:
Timestamp:
May 2, 2012, 4:10:34 PM (7 years ago)
Author:
Gedare Bloom <gedare@…>
Branches:
4.11, master
Children:
0f31ec5d
Parents:
8712622
git-author:
Gedare Bloom <gedare@…> (05/02/12 16:10:34)
git-committer:
Gedare Bloom <gedare@…> (05/08/12 22:40:44)
Message:

rbtree: API Changes

Make default for rtems_rbtree functions be unprotected (preemption enabled)
unless an unprotected variant e.g. rtems_rbtree_xxx_unprotected is available.

Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/inline/rtems/rbtree.inl

    r8712622 r8572752  
    66 *  is part of the Super Core. This is the published interface to that
    77 *  code.
    8  *
    98 */
    109 
    1110/*
    12  *  Copyright (c) 2010 Gedare Bloom.
     11 *  Copyright (c) 2010-2012 Gedare Bloom.
    1312 *
    1413 *  The license and distribution terms for this file may be
    1514 *  found in the file LICENSE in this distribution or at
    1615 *  http://www.rtems.com/license/LICENSE.
    17  *
    18  *  $Id$
    1916 */
    2017
     
    255252}
    256253
     254/**
     255 * @copydoc _RBTree_Find_unprotected()
     256 */
     257RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_find_unprotected(
     258    rtems_rbtree_control *the_rbtree,
     259    rtems_rbtree_node *the_node
     260)
     261{
     262  return _RBTree_Find_unprotected( the_rbtree, the_node );
     263}
     264
    257265/** @brief Find the node with given key in the tree
    258266 *
     
    317325
    318326/**
     327 * @copydoc _RBTree_Extract_unprotected()
     328 */
     329RTEMS_INLINE_ROUTINE void rtems_rbtree_extract_unprotected(
     330  rtems_rbtree_control *the_rbtree,
     331  rtems_rbtree_node *the_node
     332)
     333{
     334  _RBTree_Extract_unprotected( the_rbtree, the_node );
     335}
     336
     337/**
    319338 *  @brief Extract the specified node from a rbtree
    320339 *
     
    328347{
    329348  _RBTree_Extract( the_rbtree, the_node );
     349}
     350
     351/**
     352 *  @brief Obtain the min node on a rbtree
     353 *
     354 *  This function removes the min node from @a the_rbtree and returns
     355 *  a pointer to that node.  If @a the_rbtree is empty, then NULL is returned.
     356 */
     357
     358RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_min_unprotected(
     359  rtems_rbtree_control *the_rbtree
     360)
     361{
     362  return _RBTree_Get_unprotected( the_rbtree, RBT_LEFT );
    330363}
    331364
     
    349382 *  This function removes the max node from @a the_rbtree and returns
    350383 *  a pointer to that node.  If @a the_rbtree is empty, then NULL is returned.
     384 */
     385
     386RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_max_unprotected(
     387  rtems_rbtree_control *the_rbtree
     388)
     389{
     390  return _RBTree_Get_unprotected( the_rbtree, RBT_RIGHT );
     391}
     392
     393/**
     394 *  @brief Obtain the max node on a rbtree
     395 *
     396 *  This function removes the max node from @a the_rbtree and returns
     397 *  a pointer to that node.  If @a the_rbtree is empty, then NULL is returned.
    351398 *  It disables interrupts to ensure the atomicity of the get operation.
    352399 */
     
    364411 *  without changing the tree.  If @a the_rbtree is empty,
    365412 *  then NULL is returned.
    366  *  It disables interrupts to ensure the atomicity of the peek operation.
    367413 */
    368414RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_peek_min(
     
    370416)
    371417{
    372   return _RBTree_Peek( the_rbtree, RBT_LEFT );
     418  return _RBTree_First( the_rbtree, RBT_LEFT );
    373419}
    374420
     
    379425 *  without changing the tree.  If @a the_rbtree is empty,
    380426 *  then NULL is returned.
    381  *  It disables interrupts to ensure the atomicity of the peek operation.
    382427 */
    383428RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_peek_max(
     
    385430)
    386431{
    387   return _RBTree_Peek( the_rbtree, RBT_RIGHT );
    388 }
    389 
     432  return _RBTree_First( the_rbtree, RBT_RIGHT );
     433}
     434
     435/**
     436 * @copydoc _RBTree_Find_header_unprotected()
     437 */
     438RTEMS_INLINE_ROUTINE rtems_rbtree_control *rtems_rbtree_find_header_unprotected(
     439  rtems_rbtree_node *the_node
     440)
     441{
     442  return _RBTree_Find_header_unprotected( the_node );
     443}
    390444
    391445/**
     
    400454)
    401455{
    402   return(_RBTree_Find_header( the_node ));
     456  return _RBTree_Find_header( the_node );
     457}
     458
     459/**
     460 * @copydoc _RBTree_Insert_unprotected()
     461 */
     462RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_insert_unprotected(
     463  rtems_rbtree_control *the_rbtree,
     464  rtems_rbtree_node *the_node
     465)
     466{
     467  return _RBTree_Insert_unprotected( the_rbtree, the_node );
    403468}
    404469
     
    428493)
    429494{
    430   return( _RBTree_Is_unique(the_rbtree) );
     495  return _RBTree_Is_unique(the_rbtree);
    431496}
    432497
  • cpukit/score/src/rbtree.c

    r8712622 r8572752  
    5353  next  = starting_address;
    5454  while ( count-- ) {
    55     _RBTree_Insert(the_rbtree, next);
     55    _RBTree_Insert_unprotected(the_rbtree, next);
    5656    next           = (RBTree_Node *)
    5757                        _Addresses_Add_offset( (void *) next, node_size );
Note: See TracChangeset for help on using the changeset viewer.