--- c-user/chains.rst | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/c-user/chains.rst b/c-user/chains.rst index 0dce1d9..8350fc4 100644 --- a/c-user/chains.rst +++ b/c-user/chains.rst @@ -28,11 +28,11 @@ includes wait queues and task queues. The Chains API provided by RTEMS is: - rtems_chain_is_empty_ - Is the chain empty ? -- rtems_chain_is_first_ - Is the Node the first in the chain ? +- rtems_chain_is_first_ - Is the node the first in the chain ? -- rtems_chain_is_last_ - Is the Node the last in the chain ? +- rtems_chain_is_last_ - Is the node the last in the chain ? -- rtems_chain_has_only_one_node_ - Does the node have one node ? +- rtems_chain_has_only_one_node_ - Does the chain have only one node ? - rtems_chain_node_count_unprotected_ - Returns the node count of the chain (unprotected) @@ -52,22 +52,22 @@ includes wait queues and task queues. The Chains API provided by RTEMS is: - rtems_chain_insert_unprotected_ - Insert the node into the chain (unprotected) -- rtems_chain_append_ - Append the node to chain +- rtems_chain_append_ - Append the node to the chain -- rtems_chain_append_unprotected_ - Append the node to chain (unprotected) +- rtems_chain_append_unprotected_ - Append the node to the chain (unprotected) - rtems_chain_prepend_ - Prepend the node to the end of the chain -- rtems_chain_prepend_unprotected_ - Prepend the node to chain (unprotected) +- rtems_chain_prepend_unprotected_ - Prepend the node to the chain (unprotected) Background ========== The Chains API maps to the Super Core Chains API. Chains are implemented as a -double linked list of nodes anchored to a control node. The list starts at the +doubly linked list of nodes anchored to a control node. The list starts at the control node and is terminated at the control node. A node has previous and -next pointers. Being a double linked list nodes can be inserted and removed -without the need to travse the chain. +next pointers. Being a doubly linked list nodes can be inserted and removed +without the need to traverse the chain. Chains have a small memory footprint and can be used in interrupt service routines and are thread safe in a multi-threaded environment. The directives @@ -78,7 +78,7 @@ Chains are very useful in Board Support packages and applications. Nodes ----- -A chain is made up from nodes that orginate from a chain control object. A node +A chain is made up from nodes that originate from a chain control object. A node is of type ``rtems_chain_node``. The node is designed to be part of a user data structure and a cast is used to move from the node address to the user data structure address. For example: @@ -102,7 +102,7 @@ from the list you perform the following: } The node is placed at the start of the user's structure to allow the node -address on the chain to be easly cast to the user's structure address. +address on the chain to be easily cast to the user's structure address. Controls -------- @@ -132,8 +132,8 @@ Multi-threading Chains are designed to be used in a multi-threading environment. The directives list which operations mask interrupts. Chains supports tasks and interrupt -service routines appending and extracting nodes with out the need for extra -locks. Chains how-ever cannot insure the integrity of a chain for all +service routines appending and extracting nodes without the need for extra +locks. Chains how-ever cannot ensure the integrity of a chain for all operations. This is the responsibility of the user. For example an interrupt service routine extracting nodes while a task is iterating over the chain can have unpredictable results. @@ -178,7 +178,7 @@ Iterating a Chain Iterating a chain is a common function. The example shows how to iterate the buffer pool chain created in the last section to find buffers starting with a -specific string. If the buffer is located it is extracted from the chain and +specific string. If the buffer is located, it is extracted from the chain and placed on another chain: .. code-block:: c @@ -209,9 +209,9 @@ placed on another chain: Directives ========== -The section details the Chains directives. +The section details the chains directives. -.. COMMENT: Initialize this Chain With Nodes +.. COMMENT: Initialize this Chain with Nodes .. raw:: latex @@ -239,15 +239,15 @@ RETURNS: Returns nothing. DESCRIPTION: - This function take in a pointer to a chain control and initializes it to + This function takes in a pointer to a chain control and initializes it to contain a set of chain nodes. The chain will contain ``number_nodes`` - chain nodes from the memory pointed to by ``start_address``. Each node is + chain nodes from memory pointed to by ``start_address``. Each node is assumed to be ``node_size`` bytes. NOTES: This call will discard any nodes on the chain. - This call does NOT inititialize any user data on each node. + This call does NOT initialize any user data on each node. .. COMMENT: Initialize this Chain as Empty @@ -274,7 +274,7 @@ RETURNS: Returns nothing. DESCRIPTION: - This function take in a pointer to a chain control and initializes it to + This function takes in a pointer to a chain control and initializes it to empty. NOTES: @@ -404,11 +404,11 @@ CALLING SEQUENCE: ); RETURNS: - This function returns ``true`` if there a no nodes on the chain and + This function returns ``true`` if there are no nodes on the chain and ``false`` otherwise. DESCRIPTION: - This function returns ``true`` if there a no nodes on the chain and + This function returns ``true`` if there are no nodes on the chain and ``false`` otherwise. .. raw:: latex @@ -652,7 +652,7 @@ CALLING SEQUENCE: ); RETURNS: - Returns a pointer a node. If a node was removed, then a pointer to that + Returns a pointer to a node. If a node was removed, then a pointer to that node is returned. If the chain was empty, then ``NULL`` is returned. DESCRIPTION: -- 2.17.1 _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel