Ignore:
Timestamp:
Aug 24, 2010, 2:29:55 PM (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
469e71d
Parents:
b15fb6e
Message:

2010-08-24 Sebastian Huber <sebastian.huber@…>

PR 1673/cpukit

  • sapi/src/chainappendnotify.c, sapi/src/chaingetnotify.c, sapi/src/chaingetwait.c, sapi/src/chainprependnotify.c: New files.
  • sapi/Makefile.am: Reflect changes above.
  • sapi/include/rtems/chain.h: Declare rtems_chain_append_with_notification(), rtems_chain_prepend_with_notification(), rtems_chain_get_with_notification(), and rtems_chain_get_with_wait().
  • sapi/inline/rtems/chain.inl: Define rtems_chain_append_with_empty_check(), rtems_chain_prepend_with_empty_check(), and rtems_chain_get_with_empty_check().
File:
1 edited

Legend:

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

    rb15fb6e r69f2a07  
    11/**
    2  * @file rtems/chain.inl
    3  *
    4  *  This include file contains all the constants and structures associated
    5  *  with the Chain API in RTEMS. The chain is a double linked list that
    6  *  is part of the Super Core. This is the published interface to that
    7  *  code.
    8  *
    9  *  Iterate the node of a chain can be performed with the following code:
    10  *
    11  *     rtems_chain_control* cc = &object->pending;
    12  *     rtems_chain_node*    cn = cc->first;
    13  *     while (!rtems_chain_is_tail (cc, cn))
    14  *     {
    15  *       cn = cn->next;
    16  *     }
     2 * @file
     3 *
     4 * @ingroup ClassicChains
     5 *
     6 * @brief Chain API.
    177 */
    188 
    199/*
     10 *  Copyright (c) 2010 embedded brains GmbH.
     11 *
    2012 *  COPYRIGHT (c) 1989-2008.
    2113 *  On-Line Applications Research Corporation (OAR).
     
    3628
    3729#include <rtems/score/chain.inl>
     30
     31/**
     32 * @addtogroup ClassicChains
     33 *
     34 * @{
     35 */
    3836
    3937/**
     
    506504}
    507505
     506/**
     507 * @brief Checks if the @a chain is empty and appends the @a node.
     508 *
     509 * Interrupts are disabled to ensure the atomicity of the operation.
     510 *
     511 * @retval true The chain was empty before the append.
     512 * @retval false The chain contained at least one node before the append.
     513 */
     514RTEMS_INLINE_ROUTINE bool rtems_chain_append_with_empty_check(
     515  rtems_chain_control *chain,
     516  rtems_chain_node *node
     517)
     518{
     519  return _Chain_Append_with_empty_check( chain, node );
     520}
     521
     522/**
     523 * @brief Checks if the @a chain is empty and prepends the @a node.
     524 *
     525 * Interrupts are disabled to ensure the atomicity of the operation.
     526 *
     527 * @retval true The chain was empty before the prepend.
     528 * @retval false The chain contained at least one node before the prepend.
     529 */
     530RTEMS_INLINE_ROUTINE bool rtems_chain_prepend_with_empty_check(
     531  rtems_chain_control *chain,
     532  rtems_chain_node *node
     533)
     534{
     535  return _Chain_Prepend_with_empty_check( chain, node );
     536}
     537
     538/**
     539 * @brief Tries to get the first @a node and check if the @a chain is empty
     540 * afterwards.
     541 *
     542 * This function removes the first node from the @a chain and returns a pointer
     543 * to that node in @a node.  If the @a chain is empty, then @c NULL is returned.
     544 *
     545 * Interrupts are disabled to ensure the atomicity of the operation.
     546 *
     547 * @retval true The chain is empty after the node removal.
     548 * @retval false The chain contained at least one node after the node removal.
     549 */
     550RTEMS_INLINE_ROUTINE bool rtems_chain_get_with_empty_check(
     551  rtems_chain_control *chain,
     552  rtems_chain_node **node
     553)
     554{
     555  return _Chain_Get_with_empty_check( chain, node );
     556}
     557
     558/** @} */
     559
    508560#endif
    509561/* end of include file */
Note: See TracChangeset for help on using the changeset viewer.