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 )
176static inline void rtems_chain_initialize(
178 void *starting_address,
198static inline void rtems_chain_initialize_empty(
202 _Chain_Initialize_empty( the_chain );
213static inline void rtems_chain_set_off_chain(
217 _Chain_Set_off_chain( node );
228static inline void rtems_chain_initialize_node(
232 _Chain_Initialize_node( node );
246static inline bool rtems_chain_is_node_off_chain(
250 return _Chain_Is_node_off_chain( node );
263static inline bool rtems_chain_is_null_node(
267 return the_node == NULL;
283 return _Chain_Head( the_chain );
299 return _Chain_Immutable_head( the_chain );
315 return _Chain_Tail( the_chain );
331 return _Chain_Immutable_tail( the_chain );
348 return _Chain_First( the_chain );
365 return _Chain_Immutable_first( the_chain );
382 return _Chain_Last( the_chain );
399 return _Chain_Immutable_last( the_chain );
415 return _Chain_Next( the_node );
431 return _Chain_Immutable_next( the_node );
447 return _Chain_Previous( the_node );
463 return _Chain_Immutable_previous( the_node );
478static inline bool rtems_chain_are_nodes_equal(
483 return _Chain_Are_nodes_equal( left, right );
497static inline bool rtems_chain_is_empty(
501 return _Chain_Is_empty( the_chain );
516static inline bool rtems_chain_is_first(
520 return _Chain_Is_first( the_node );
534static inline bool rtems_chain_is_last(
538 return _Chain_Is_last( the_node );
552static inline bool rtems_chain_has_only_one_node(
556 return _Chain_Has_only_one_node( the_chain );
571static inline bool rtems_chain_is_head(
576 return _Chain_Is_head( the_chain, the_node );
591static inline bool rtems_chain_is_tail(
596 return _Chain_Is_tail( the_chain, the_node );
620static inline void rtems_chain_extract_unprotected(
624 _Chain_Extract_unprotected( the_node );
650 return _Chain_Get_unprotected( the_chain );
660 return _Chain_Get_first_unprotected( the_chain );
680static inline void rtems_chain_insert_unprotected(
685 _Chain_Insert_unprotected( after_node, the_node );
709static inline void rtems_chain_append_unprotected(
714 _Chain_Append_unprotected( the_chain, the_node );
744static inline void rtems_chain_prepend_unprotected(
749 _Chain_Prepend_unprotected( the_chain, the_node );
805static 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 from the chain with an events wait if empty.
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