Changeset aa47302 in rtems


Ignore:
Timestamp:
Nov 3, 2015, 10:10:21 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
8dbb14d5
Parents:
eab538c
git-author:
Sebastian Huber <sebastian.huber@…> (11/03/15 10:10:21)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/05/15 10:30:09)
Message:

sapi: Add rtems_chain_get_first_unprotected()

Close #2459.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/rtems/chain.h

    reab538c raa47302  
    625625
    626626/**
     627 * @brief See _Chain_Get_first_unprotected().
     628 */
     629RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get_first_unprotected(
     630  rtems_chain_control *the_chain
     631)
     632{
     633  return _Chain_Get_first_unprotected( the_chain );
     634}
     635
     636/**
    627637 * @brief Insert a node on a chain
    628638 *
  • doc/user/chains.t

    reab538c raa47302  
    3636@item @code{@value{DIRPREFIX}chain_get} - Return the first node on the chain
    3737@item @code{@value{DIRPREFIX}chain_get_unprotected} - Return the first node on the chain (unprotected)
     38@item @code{@value{DIRPREFIX}chain_get_first_unprotected} - Get the first node on the chain (unprotected)
    3839@item @code{@value{DIRPREFIX}chain_insert} - Insert the node into the chain
    3940@item @code{@value{DIRPREFIX}chain_insert_unprotected} - Insert the node into the chain (unprotected)
     
    662663@c
    663664@page
     665@subsection Get the First Node (unprotected)
     666
     667@cindex chain get first node
     668
     669@subheading CALLING SEQUENCE:
     670
     671@ifset is-C
     672@findex @value{DIRPREFIX}chain_get_first_unprotected
     673@example
     674@value{DIRPREFIX}chain_node *@value{DIRPREFIX}chain_get_first_unprotected(
     675  @value{DIRPREFIX}chain_control *the_chain
     676);
     677@end example
     678@end ifset
     679
     680@subheading RETURNS:
     681
     682A pointer to the former first node is returned.
     683
     684@subheading DESCRIPTION:
     685
     686Removes the first node from the chain and returns a pointer to it.  In case the
     687chain was empty, then the results are unpredictable.
     688
     689@subheading NOTES:
     690
     691The function does nothing to ensure the atomicity of the operation.
     692
     693@c
     694@c
     695@c
     696@page
    664697@subsection Insert a Node
    665698
  • testsuites/sptests/spchain/init.c

    reab538c raa47302  
    118118  cnode = rtems_chain_last(&chain);
    119119  rtems_test_assert( rtems_chain_is_last( cnode ) );
     120
     121  cnode = rtems_chain_get_first_unprotected( &chain );
     122  rtems_test_assert( cnode == &node1 );
     123  cnode = rtems_chain_first( &chain );
     124  rtems_test_assert( cnode == &node2 );
     125  cnode = rtems_chain_last( &chain );
     126  rtems_test_assert( cnode == &node2 );
    120127}
    121128
Note: See TracChangeset for help on using the changeset viewer.