diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-28 06:59:29 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-06 10:52:19 +0200 |
commit | 83b022907173c9e1bd69874fadb5ed443400c2fa (patch) | |
tree | 92c480bb9d04696903c4b3fee4c1c34ef603d11a /cpukit/score/include/rtems/score/rbtree.h | |
parent | score: Add missing const qualifiers (diff) | |
download | rtems-83b022907173c9e1bd69874fadb5ed443400c2fa.tar.bz2 |
score: Add _RBTree_Initialize_one()
Diffstat (limited to 'cpukit/score/include/rtems/score/rbtree.h')
-rw-r--r-- | cpukit/score/include/rtems/score/rbtree.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/rbtree.h b/cpukit/score/include/rtems/score/rbtree.h index a5a6cf367b..818eee4290 100644 --- a/cpukit/score/include/rtems/score/rbtree.h +++ b/cpukit/score/include/rtems/score/rbtree.h @@ -388,6 +388,26 @@ RTEMS_INLINE_ROUTINE void _RBTree_Initialize_empty( } /** + * @brief Initializes this red-black tree to contain exactly the specified + * node. + * + * @param[in] the_rbtree The red-black tree control. + * @param[in] the_node The one and only node. + */ +RTEMS_INLINE_ROUTINE void _RBTree_Initialize_one( + RBTree_Control *the_rbtree, + RBTree_Node *the_node +) +{ + _Assert( _RBTree_Is_node_off_tree( the_node ) ); + RB_ROOT( the_rbtree ) = the_node; + RB_PARENT( the_node, Node ) = NULL; + RB_LEFT( the_node, Node ) = NULL; + RB_RIGHT( the_node, Node ) = NULL; + RB_COLOR( the_node, Node ) = RB_BLACK; +} + +/** * @brief Returns the minimum node of the red-black tree. * * @param[in] the_rbtree The red-black tree control. |