summaryrefslogtreecommitdiffstats
path: root/cpukit/score/inline/rtems/score/chain.inl
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-01-23 15:55:42 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-02-02 11:09:30 +0100
commit72a3af3e4294200b59764bcd2c17f76609526e6a (patch)
treeb464f37ab2f663e721d3fad9fc43fefcddad97f8 /cpukit/score/inline/rtems/score/chain.inl
parentImprove comments on console select patch. (diff)
downloadrtems-72a3af3e4294200b59764bcd2c17f76609526e6a.tar.bz2
Extended API to support iteration of const chains.
Diffstat (limited to 'cpukit/score/inline/rtems/score/chain.inl')
-rw-r--r--cpukit/score/inline/rtems/score/chain.inl42
1 files changed, 36 insertions, 6 deletions
diff --git a/cpukit/score/inline/rtems/score/chain.inl b/cpukit/score/inline/rtems/score/chain.inl
index 15dad9098b..a465a3462b 100644
--- a/cpukit/score/inline/rtems/score/chain.inl
+++ b/cpukit/score/inline/rtems/score/chain.inl
@@ -142,7 +142,7 @@ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_head(
/** @brief Return pointer to Chain Tail
*
- * This function returns a pointer to the last node on the chain.
+ * This function returns a pointer to the tail node on the chain.
*
* @param[in] the_chain is the chain to be operated upon.
*
@@ -157,7 +157,7 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail(
/** @brief Return pointer to immutable Chain Tail
*
- * This function returns a pointer to the last node on the chain.
+ * This function returns a pointer to the tail node on the chain.
*
* @param[in] the_chain is the chain to be operated upon.
*
@@ -249,6 +249,21 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
return the_node->next;
}
+/** @brief Return pointer the immutable next node from this node
+ *
+ * This function returns a pointer to the next node after this node.
+ *
+ * @param[in] the_node is the node to be operated upon.
+ *
+ * @return This method returns the next node on the chain.
+ */
+RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next(
+ const Chain_Node *the_node
+)
+{
+ return the_node->next;
+}
+
/** @brief Return pointer the previous node from this node
*
* This function returns a pointer to the previous node on this chain.
@@ -264,6 +279,21 @@ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Previous(
return the_node->previous;
}
+/** @brief Return pointer the immutable previous node from this node
+ *
+ * This function returns a pointer to the previous node on this chain.
+ *
+ * @param[in] the_node is the node to be operated upon.
+ *
+ * @return This method returns the previous node on the chain.
+ */
+RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_previous(
+ const Chain_Node *the_node
+)
+{
+ return the_node->previous;
+}
+
/** @brief Is the Chain Empty
*
* This function returns true if there a no nodes on @a the_chain and
@@ -347,11 +377,11 @@ RTEMS_INLINE_ROUTINE bool _Chain_Has_only_one_node(
* @a the_chain and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_head(
- Chain_Control *the_chain,
+ const Chain_Control *the_chain,
const Chain_Node *the_node
)
{
- return (the_node == _Chain_Head(the_chain));
+ return (the_node == _Chain_Immutable_head( the_chain ));
}
/** @brief Is this Node the Chail Tail
@@ -363,11 +393,11 @@ RTEMS_INLINE_ROUTINE bool _Chain_Is_head(
* @param[in] the_node is the node to check for being the Chain Tail.
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
- Chain_Control *the_chain,
+ const Chain_Control *the_chain,
const Chain_Node *the_node
)
{
- return (the_node == _Chain_Tail(the_chain));
+ return (the_node == _Chain_Immutable_tail( the_chain ));
}
/** @brief Initialize this Chain as Empty