67#define RTEMS_CHAIN_INITIALIZER_EMPTY( name ) \
68 CHAIN_INITIALIZER_EMPTY( name )
75#define RTEMS_CHAIN_INITIALIZER_ONE_NODE( node ) \
76 CHAIN_INITIALIZER_ONE_NODE( node )
83#define RTEMS_CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN( chain ) \
84 CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN( chain )
89#define RTEMS_CHAIN_DEFINE_EMPTY( name ) \
90 rtems_chain_control name = RTEMS_CHAIN_INITIALIZER_EMPTY( name )
169static inline void rtems_chain_initialize(
171 void *starting_address,
191static inline void rtems_chain_initialize_empty(
195 _Chain_Initialize_empty( the_chain );
206static inline void rtems_chain_set_off_chain(
210 _Chain_Set_off_chain( node );
221static inline void rtems_chain_initialize_node(
225 _Chain_Initialize_node( node );
239static inline bool rtems_chain_is_node_off_chain(
243 return _Chain_Is_node_off_chain( node );
256static inline bool rtems_chain_is_null_node(
260 return the_node == NULL;
276 return _Chain_Head( the_chain );
292 return _Chain_Immutable_head( the_chain );
308 return _Chain_Tail( the_chain );
324 return _Chain_Immutable_tail( the_chain );
341 return _Chain_First( the_chain );
358 return _Chain_Immutable_first( the_chain );
375 return _Chain_Last( the_chain );
392 return _Chain_Immutable_last( the_chain );
408 return _Chain_Next( the_node );
424 return _Chain_Immutable_next( the_node );
440 return _Chain_Previous( the_node );
456 return _Chain_Immutable_previous( the_node );
471static inline bool rtems_chain_are_nodes_equal(
476 return _Chain_Are_nodes_equal( left, right );
490static inline bool rtems_chain_is_empty(
494 return _Chain_Is_empty( the_chain );
509static inline bool rtems_chain_is_first(
513 return _Chain_Is_first( the_node );
527static inline bool rtems_chain_is_last(
531 return _Chain_Is_last( the_node );
545static inline bool rtems_chain_has_only_one_node(
549 return _Chain_Has_only_one_node( the_chain );
564static inline bool rtems_chain_is_head(
569 return _Chain_Is_head( the_chain, the_node );
584static inline bool rtems_chain_is_tail(
589 return _Chain_Is_tail( the_chain, the_node );
613static inline void rtems_chain_extract_unprotected(
617 _Chain_Extract_unprotected( the_node );
643 return _Chain_Get_unprotected( the_chain );
653 return _Chain_Get_first_unprotected( the_chain );
673static inline void rtems_chain_insert_unprotected(
678 _Chain_Insert_unprotected( after_node, the_node );
702static inline void rtems_chain_append_unprotected(
707 _Chain_Append_unprotected( the_chain, the_node );
737static inline void rtems_chain_prepend_unprotected(
742 _Chain_Prepend_unprotected( the_chain, the_node );
798static inline size_t rtems_chain_node_count_unprotected(
This header file provides interfaces of the Chain Handler which are only used by the implementation.
rtems_status_code rtems_chain_get_with_wait(rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node)
Gets the first node of the chain and sends the events to the task if the chain is empty afterwards.
Definition: chaingetwait.c:43
bool rtems_chain_append_with_empty_check(rtems_chain_control *chain, rtems_chain_node *node)
Checks if the chain is empty and appends the node.
Definition: chainprotected.c:113
void rtems_chain_insert(rtems_chain_node *after_node, rtems_chain_node *the_node)
Insert a node on a chain.
Definition: chainprotected.c:80
void rtems_chain_prepend(rtems_chain_control *the_chain, rtems_chain_node *the_node)
Prepend a node.
Definition: chainprotected.c:101
rtems_status_code rtems_chain_prepend_with_notification(rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events)
Prepends the node to the chain and sends the events to the task if the chain was empty before the pre...
Definition: chainprependnotify.c:43
rtems_chain_node * rtems_chain_get(rtems_chain_control *the_chain)
Obtain the first node on a chain.
Definition: chainprotected.c:68
void rtems_chain_append(rtems_chain_control *the_chain, rtems_chain_node *the_node)
Append a node on the end of a chain.
Definition: chainprotected.c:89
rtems_status_code rtems_chain_append_with_notification(rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events)
Appends the node to the chain and sends the events to the task if the chain was empty before the appe...
Definition: chainappendnotify.c:43
bool rtems_chain_prepend_with_empty_check(rtems_chain_control *chain, rtems_chain_node *node)
Checks if the chain is empty and prepends the node.
Definition: chainprotected.c:128
bool rtems_chain_get_with_empty_check(rtems_chain_control *chain, rtems_chain_node **node)
Tries to get the first node and check if the chain is empty afterwards.
Definition: chainprotected.c:143
rtems_status_code rtems_chain_get_with_notification(rtems_chain_control *chain, rtems_id task, rtems_event_set events, rtems_chain_node **node)
Gets the first node of the chain and sends the events to the task if the chain is empty after the get...
Definition: chaingetnotify.c:43
void rtems_chain_extract(rtems_chain_node *the_node)
Extract the specified node from a chain.
Definition: chainprotected.c:59
uint32_t rtems_event_set
This integer type represents a bit field which can hold exactly 32 individual events.
Definition: event.h:436
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition: types.h:94
Watchdog_Interval rtems_interval
This type represents clock tick intervals.
Definition: types.h:114
size_t _Chain_Node_count_unprotected(const Chain_Control *chain)
Returns the node count of the chain.
Definition: chainnodecount.c:42
void _Chain_Initialize(Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size)
Initializes a chain header.
Definition: chain.c:46
This header file provides the Event Manager API.
This structure represents a chain node.
Definition: chain.h:78
This union represents a chain control block.
Definition: chain.h:96