Ticket #1340: pr1340.diff

File pr1340.diff, 3.3 KB (added by Joel Sherrill, on 11/20/08 at 20:14:08)

Add rtems_chain_initialize

  • cpukit/sapi/inline/rtems/chain.inl

    RCS file: /usr1/CVS/rtems/cpukit/sapi/inline/rtems/chain.inl,v
    retrieving revision 1.4
    diff -u -r1.4 chain.inl
     
    3737#include <rtems/score/chain.inl>
    3838
    3939/**
     40 *  @brief Initialize a Chain Header
     41 *
     42 *  This routine initializes @a the_chain structure to manage the
     43 *  contiguous array of @a number_nodes nodes which starts at
     44 *  @a starting_address.  Each node is of @a node_size bytes.
     45 *
     46 *  @param[in] the_chain specifies the chain to initialize
     47 *  @param[in] starting_address is the starting address of the array
     48 *         of elements
     49 *  @param[in] number_nodes is the number of nodes that will be in the chain
     50 *  @param[in] node_size is the size of each node
     51 */
     52RTEMS_INLINE_ROUTINE void rtems_chain_initialize(
     53  rtems_chain_control *the_chain,
     54  void                *starting_address,
     55  size_t               number_nodes,
     56  size_t               node_size
     57)
     58{
     59  _Chain_Initialize( the_chain, starting_address, number_nodes, node_size );
     60}
     61
     62/**
    4063 *  @brief Initialize this Chain as Empty
    4164 *
    4265 *  This routine initializes the specified chain to contain zero nodes.
  • doc/user/chains.t

    RCS file: /usr1/CVS/rtems/doc/user/chains.t,v
    retrieving revision 1.4
    diff -u -r1.4 chains.t
     
    2121@c build_id
    2222@item @code{@value{DIRPREFIX}chain_node} - Chain node used in user objects
    2323@item @code{@value{DIRPREFIX}chain_control} - Chain control node
     24@item @code{@value{DIRPREFIX}chain_initialize} - initialize the chain with nodes
    2425@item @code{@value{DIRPREFIX}chain_initialize_empty} - initialize the chain as empty
    2526@item @code{@value{DIRPREFIX}chain_is_null_node} - Is the node NULL ?
    2627@item @code{@value{DIRPREFIX}chain_head} - Return the chain's head
     
    196197The section details the Chains directives.
    197198
    198199@c
     200@c Initialize this Chain With Nodes
     201@c
     202@page
     203@subsection Initialize Chain With Nodes
     204
     205@cindex chain initialize
     206
     207@subheading CALLING SEQUENCE:
     208
     209@ifset is-C
     210@findex @value{DIRPREFIX}chain_initialize
     211@example
     212void @value{DIRPREFIX}chain_initialize(
     213  @value{DIRPREFIX}chain_control *the_chain,
     214  void                *starting_address,
     215  size_t               number_nodes,
     216  size_t               node_size
     217)
     218@end example
     219@end ifset
     220
     221@subheading RETURNS
     222
     223Returns nothing.
     224
     225@subheading DESCRIPTION:
     226
     227This function take in a pointer to a chain control and initializes it
     228to contain a set of chain nodes.  The chain will contain @code{number_nodes}
     229chain nodes from the memory pointed to by @code{start_address}.  Each node
     230is assumed to be @code{node_size} bytes.
     231
     232@subheading NOTES:
     233
     234This call will discard any nodes on the chain.
     235
     236This call does NOT inititialize any user data on each node.
     237
     238@c
    199239@c Initialize this Chain as Empty
    200240@c
    201241@page
    202 @subsection Initialise Empty
     242@subsection Initialize Empty
    203243
    204 @cindex chain initialise empty
     244@cindex chain initialize empty
    205245
    206246@subheading CALLING SEQUENCE:
    207247