Changeset 72a3af3 in rtems


Ignore:
Timestamp:
Jan 23, 2012, 2:55:42 PM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
184a612e
Parents:
52694844
git-author:
Sebastian Huber <sebastian.huber@…> (01/23/12 14:55:42)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/02/12 10:09:30)
Message:

Extended API to support iteration of const chains.

Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/inline/rtems/chain.inl

    r52694844 r72a3af3  
    136136}
    137137
     138/** @brief Return pointer to immutable Chain Head
     139 *
     140 *  This function returns a pointer to the head node on the chain.
     141 *
     142 *  @param[in] the_chain is the chain to be operated upon.
     143 *
     144 *  @return This method returns the permanent head node of the chain.
     145 */
     146RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_head(
     147  const rtems_chain_control *the_chain
     148)
     149{
     150  return _Chain_Immutable_head( the_chain );
     151}
     152
    138153/**
    139154 *  @brief Return pointer to Chain Tail
    140155 *
    141  *  This function returns a pointer to the last node on the chain.
     156 *  This function returns a pointer to the tail node on the chain.
    142157 *
    143158 *  @param[in] the_chain is the chain to be operated upon.
     
    152167}
    153168
     169/** @brief Return pointer to immutable Chain Tail
     170 *
     171 *  This function returns a pointer to the tail node on the chain.
     172 *
     173 *  @param[in] the_chain is the chain to be operated upon.
     174 *
     175 *  @return This method returns the permanent tail node of the chain.
     176 */
     177RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_tail(
     178  const rtems_chain_control *the_chain
     179)
     180{
     181  return _Chain_Immutable_tail( the_chain );
     182}
     183
    154184/**
    155185 *  @brief Return pointer to Chain's First node after the permanent head.
     
    169199}
    170200
     201/** @brief Return pointer to immutable Chain's First node
     202 *
     203 *  This function returns a pointer to the first node on the chain after the
     204 *  head.
     205 *
     206 *  @param[in] the_chain is the chain to be operated upon.
     207 *
     208 *  @return This method returns the first node of the chain.
     209 */
     210RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_first(
     211  const rtems_chain_control *the_chain
     212)
     213{
     214  return _Chain_Immutable_first( the_chain );
     215}
     216
    171217/**
    172218 *  @brief Return pointer to Chain's Last node before the permanent tail.
     
    186232}
    187233
     234/** @brief Return pointer to immutable Chain's Last node
     235 *
     236 *  This function returns a pointer to the last node on the chain just before
     237 *  the tail.
     238 *
     239 *  @param[in] the_chain is the chain to be operated upon.
     240 *
     241 *  @return This method returns the last node of the chain.
     242 */
     243RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_last(
     244  const rtems_chain_control *the_chain
     245)
     246{
     247  return _Chain_Immutable_last( the_chain );
     248}
     249
    188250/**
    189251 *  @brief Return pointer the next node from this node
     
    202264}
    203265
     266/** @brief Return pointer the immutable next node from this node
     267 *
     268 *  This function returns a pointer to the next node after this node.
     269 *
     270 *  @param[in] the_node is the node to be operated upon.
     271 *
     272 *  @return This method returns the next node on the chain.
     273 */
     274RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_next(
     275  const rtems_chain_node *the_node
     276)
     277{
     278  return _Chain_Immutable_next( the_node );
     279}
     280
    204281/**
    205282 *  @brief Return pointer the previous node from this node
     
    216293{
    217294  return _Chain_Previous( the_node );
     295}
     296
     297/** @brief Return pointer the immutable previous node from this node
     298 *
     299 *  This function returns a pointer to the previous node on this chain.
     300 *
     301 *  @param[in] the_node is the node to be operated upon.
     302 *
     303 *  @return This method returns the previous node on the chain.
     304 */
     305RTEMS_INLINE_ROUTINE const rtems_chain_node *rtems_chain_immutable_previous(
     306  const rtems_chain_node *the_node
     307)
     308{
     309  return _Chain_Immutable_previous( the_node );
    218310}
    219311
     
    250342 */
    251343RTEMS_INLINE_ROUTINE bool rtems_chain_is_empty(
    252   rtems_chain_control *the_chain
     344  const rtems_chain_control *the_chain
    253345)
    254346{
     
    324416 */
    325417RTEMS_INLINE_ROUTINE bool rtems_chain_is_head(
    326   rtems_chain_control    *the_chain,
     418  const rtems_chain_control *the_chain,
    327419  const rtems_chain_node *the_node
    328420)
     
    341433 */
    342434RTEMS_INLINE_ROUTINE bool rtems_chain_is_tail(
    343   rtems_chain_control    *the_chain,
     435  const rtems_chain_control *the_chain,
    344436  const rtems_chain_node *the_node
    345437)
  • cpukit/score/inline/rtems/score/chain.inl

    r52694844 r72a3af3  
    143143/** @brief Return pointer to Chain Tail
    144144 *
    145  *  This function returns a pointer to the last node on the chain.
     145 *  This function returns a pointer to the tail node on the chain.
    146146 *
    147147 *  @param[in] the_chain is the chain to be operated upon.
     
    158158/** @brief Return pointer to immutable Chain Tail
    159159 *
    160  *  This function returns a pointer to the last node on the chain.
     160 *  This function returns a pointer to the tail node on the chain.
    161161 *
    162162 *  @param[in] the_chain is the chain to be operated upon.
     
    250250}
    251251
     252/** @brief Return pointer the immutable next node from this node
     253 *
     254 *  This function returns a pointer to the next node after this node.
     255 *
     256 *  @param[in] the_node is the node to be operated upon.
     257 *
     258 *  @return This method returns the next node on the chain.
     259 */
     260RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next(
     261  const Chain_Node *the_node
     262)
     263{
     264  return the_node->next;
     265}
     266
    252267/** @brief Return pointer the previous node from this node
    253268 *
     
    265280}
    266281
     282/** @brief Return pointer the immutable previous node from this node
     283 *
     284 *  This function returns a pointer to the previous node on this chain.
     285 *
     286 *  @param[in] the_node is the node to be operated upon.
     287 *
     288 *  @return This method returns the previous node on the chain.
     289 */
     290RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_previous(
     291  const Chain_Node *the_node
     292)
     293{
     294  return the_node->previous;
     295}
     296
    267297/** @brief Is the Chain Empty
    268298 *
     
    348378 */
    349379RTEMS_INLINE_ROUTINE bool _Chain_Is_head(
    350   Chain_Control *the_chain,
     380  const Chain_Control *the_chain,
    351381  const Chain_Node    *the_node
    352382)
    353383{
    354   return (the_node == _Chain_Head(the_chain));
     384  return (the_node == _Chain_Immutable_head( the_chain ));
    355385}
    356386
     
    364394 */
    365395RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
    366   Chain_Control *the_chain,
     396  const Chain_Control *the_chain,
    367397  const Chain_Node    *the_node
    368398)
    369399{
    370   return (the_node == _Chain_Tail(the_chain));
     400  return (the_node == _Chain_Immutable_tail( the_chain ));
    371401}
    372402
Note: See TracChangeset for help on using the changeset viewer.