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 )
102 rtems_chain_control *chain,
103 rtems_chain_node *node,
118 rtems_chain_control *chain,
119 rtems_chain_node *node,
134 rtems_chain_control *chain,
137 rtems_chain_node **node
150 rtems_chain_control *chain,
153 rtems_chain_node **node
169static inline void rtems_chain_initialize(
170 rtems_chain_control *the_chain,
171 void *starting_address,
191static inline void rtems_chain_initialize_empty(
192 rtems_chain_control *the_chain
195 _Chain_Initialize_empty( the_chain );
206static inline void rtems_chain_set_off_chain(
207 rtems_chain_node *node
210 _Chain_Set_off_chain( node );
221static inline void rtems_chain_initialize_node(
222 rtems_chain_node *node
225 _Chain_Initialize_node( node );
239static inline bool rtems_chain_is_node_off_chain(
240 const rtems_chain_node *node
243 return _Chain_Is_node_off_chain( node );
256static inline bool rtems_chain_is_null_node(
257 const rtems_chain_node *the_node
260 return the_node == NULL;
272static inline rtems_chain_node *rtems_chain_head(
273 rtems_chain_control *the_chain
276 return _Chain_Head( the_chain );
288static inline const rtems_chain_node *rtems_chain_immutable_head(
289 const rtems_chain_control *the_chain
292 return _Chain_Immutable_head( the_chain );
304static inline rtems_chain_node *rtems_chain_tail(
305 rtems_chain_control *the_chain
308 return _Chain_Tail( the_chain );
320static inline const rtems_chain_node *rtems_chain_immutable_tail(
321 const rtems_chain_control *the_chain
324 return _Chain_Immutable_tail( the_chain );
337static inline rtems_chain_node *rtems_chain_first(
338 const rtems_chain_control *the_chain
341 return _Chain_First( the_chain );
354static inline const rtems_chain_node *rtems_chain_immutable_first(
355 const rtems_chain_control *the_chain
358 return _Chain_Immutable_first( the_chain );
371static inline rtems_chain_node *rtems_chain_last(
372 const rtems_chain_control *the_chain
375 return _Chain_Last( the_chain );
388static inline const rtems_chain_node *rtems_chain_immutable_last(
389 const rtems_chain_control *the_chain
392 return _Chain_Immutable_last( the_chain );
404static inline rtems_chain_node *rtems_chain_next(
405 const rtems_chain_node *the_node
408 return _Chain_Next( the_node );
420static inline const rtems_chain_node *rtems_chain_immutable_next(
421 const rtems_chain_node *the_node
424 return _Chain_Immutable_next( the_node );
436static inline rtems_chain_node *rtems_chain_previous(
437 const rtems_chain_node *the_node
440 return _Chain_Previous( the_node );
452static inline const rtems_chain_node *rtems_chain_immutable_previous(
453 const rtems_chain_node *the_node
456 return _Chain_Immutable_previous( the_node );
471static inline bool rtems_chain_are_nodes_equal(
472 const rtems_chain_node *left,
473 const rtems_chain_node *right
476 return _Chain_Are_nodes_equal( left, right );
490static inline bool rtems_chain_is_empty(
491 const rtems_chain_control *the_chain
494 return _Chain_Is_empty( the_chain );
509static inline bool rtems_chain_is_first(
510 const rtems_chain_node *the_node
513 return _Chain_Is_first( the_node );
527static inline bool rtems_chain_is_last(
528 const rtems_chain_node *the_node
531 return _Chain_Is_last( the_node );
545static inline bool rtems_chain_has_only_one_node(
546 const rtems_chain_control *the_chain
549 return _Chain_Has_only_one_node( the_chain );
564static inline bool rtems_chain_is_head(
565 const rtems_chain_control *the_chain,
566 const rtems_chain_node *the_node
569 return _Chain_Is_head( the_chain, the_node );
584static inline bool rtems_chain_is_tail(
585 const rtems_chain_control *the_chain,
586 const rtems_chain_node *the_node
589 return _Chain_Is_tail( the_chain, the_node );
602 rtems_chain_node *the_node
613static inline void rtems_chain_extract_unprotected(
614 rtems_chain_node *the_node
617 _Chain_Extract_unprotected( the_node );
633 rtems_chain_control *the_chain
639static inline rtems_chain_node *rtems_chain_get_unprotected(
640 rtems_chain_control *the_chain
643 return _Chain_Get_unprotected( the_chain );
649static inline rtems_chain_node *rtems_chain_get_first_unprotected(
650 rtems_chain_control *the_chain
653 return _Chain_Get_first_unprotected( the_chain );
666 rtems_chain_node *after_node,
667 rtems_chain_node *the_node
673static inline void rtems_chain_insert_unprotected(
674 rtems_chain_node *after_node,
675 rtems_chain_node *the_node
678 _Chain_Insert_unprotected( after_node, the_node );
690 rtems_chain_control *the_chain,
691 rtems_chain_node *the_node
702static inline void rtems_chain_append_unprotected(
703 rtems_chain_control *the_chain,
704 rtems_chain_node *the_node
707 _Chain_Append_unprotected( the_chain, the_node );
722 rtems_chain_control *the_chain,
723 rtems_chain_node *the_node
737static inline void rtems_chain_prepend_unprotected(
738 rtems_chain_control *the_chain,
739 rtems_chain_node *the_node
742 _Chain_Prepend_unprotected( the_chain, the_node );
754 rtems_chain_control *chain,
755 rtems_chain_node *node
767 rtems_chain_control *chain,
768 rtems_chain_node *node
784 rtems_chain_control *chain,
785 rtems_chain_node **node
798static inline size_t rtems_chain_node_count_unprotected(
799 const rtems_chain_control *chain
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