summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/chainimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-10 08:21:54 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-09-06 10:52:20 +0200
commit3709987d968868d36701bf44474921b7cd560ce0 (patch)
tree8956017a0562ff14248ccb7fb1d14a6c10377444 /cpukit/score/include/rtems/score/chainimpl.h
parentscore: Improve red-black tree debug support (diff)
downloadrtems-3709987d968868d36701bf44474921b7cd560ce0.tar.bz2
score: Add _Chain_Initialize_one()
Diffstat (limited to 'cpukit/score/include/rtems/score/chainimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/chainimpl.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/chainimpl.h b/cpukit/score/include/rtems/score/chainimpl.h
index 4664175700..21c0e6b026 100644
--- a/cpukit/score/include/rtems/score/chainimpl.h
+++ b/cpukit/score/include/rtems/score/chainimpl.h
@@ -520,6 +520,33 @@ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
}
/**
+ * @brief Initializes this chain to contain exactly the specified node.
+ *
+ * @param[in] the_chain The chain control.
+ * @param[in] the_node The one and only node.
+ */
+RTEMS_INLINE_ROUTINE void _Chain_Initialize_one(
+ Chain_Control *the_chain,
+ Chain_Node *the_node
+)
+{
+ Chain_Node *head;
+ Chain_Node *tail;
+
+ _Assert( _Chain_Is_node_off_chain( the_node ) );
+
+ head = _Chain_Head( the_chain );
+ tail = _Chain_Tail( the_chain );
+
+ the_node->next = tail;
+ the_node->previous = head;
+
+ head->next = the_node;
+ head->previous = NULL;
+ tail->previous = the_node;
+}
+
+/**
* @brief Extract this node (unprotected).
*
* This routine extracts the_node from the chain on which it resides.