18 #ifndef _RTEMS_CHAIN_H 19 #define _RTEMS_CHAIN_H 44 #define RTEMS_CHAIN_INITIALIZER_EMPTY( name ) \ 45 CHAIN_INITIALIZER_EMPTY( name ) 52 #define RTEMS_CHAIN_INITIALIZER_ONE_NODE( node ) \ 53 CHAIN_INITIALIZER_ONE_NODE( node ) 60 #define RTEMS_CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN( chain ) \ 61 CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN( chain ) 66 #define RTEMS_CHAIN_DEFINE_EMPTY( name ) \ 67 rtems_chain_control name = RTEMS_CHAIN_INITIALIZER_EMPTY( name ) 79 rtems_chain_control *chain,
80 rtems_chain_node *node,
95 rtems_chain_control *chain,
96 rtems_chain_node *node,
111 rtems_chain_control *chain,
114 rtems_chain_node **node
127 rtems_chain_control *chain,
130 rtems_chain_node **node
147 rtems_chain_control *the_chain,
148 void *starting_address,
169 rtems_chain_control *the_chain
184 rtems_chain_node *node
199 rtems_chain_node *node
217 const rtems_chain_node *node
234 const rtems_chain_node *the_node
250 rtems_chain_control *the_chain
266 const rtems_chain_control *the_chain
282 rtems_chain_control *the_chain
298 const rtems_chain_control *the_chain
315 const rtems_chain_control *the_chain
332 const rtems_chain_control *the_chain
349 const rtems_chain_control *the_chain
366 const rtems_chain_control *the_chain
382 const rtems_chain_node *the_node
398 const rtems_chain_node *the_node
414 const rtems_chain_node *the_node
430 const rtems_chain_node *the_node
449 const rtems_chain_node *left,
450 const rtems_chain_node *right
468 const rtems_chain_control *the_chain
487 const rtems_chain_node *the_node
505 const rtems_chain_node *the_node
523 const rtems_chain_control *the_chain
542 const rtems_chain_control *the_chain,
543 const rtems_chain_node *the_node
562 const rtems_chain_control *the_chain,
563 const rtems_chain_node *the_node
579 rtems_chain_node *the_node
591 rtems_chain_node *the_node
610 rtems_chain_control *the_chain
617 rtems_chain_control *the_chain
627 rtems_chain_control *the_chain
643 rtems_chain_node *after_node,
644 rtems_chain_node *the_node
651 rtems_chain_node *after_node,
652 rtems_chain_node *the_node
667 rtems_chain_control *the_chain,
668 rtems_chain_node *the_node
680 rtems_chain_control *the_chain,
681 rtems_chain_node *the_node
699 rtems_chain_control *the_chain,
700 rtems_chain_node *the_node
715 rtems_chain_control *the_chain,
716 rtems_chain_node *the_node
731 rtems_chain_control *chain,
732 rtems_chain_node *node
744 rtems_chain_control *chain,
745 rtems_chain_node *node
761 rtems_chain_control *chain,
762 rtems_chain_node **node
776 const rtems_chain_control *chain
RTEMS_INLINE_ROUTINE rtems_chain_node * rtems_chain_tail(rtems_chain_control *the_chain)
Return pointer to Chain Tail.
Definition: chain.h:281
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(Chain_Control *the_chain, Chain_Node *the_node)
Append a node (unprotected).
Definition: chainimpl.h:679
RTEMS_INLINE_ROUTINE void rtems_chain_initialize_node(rtems_chain_node *node)
Initializes a chain node.
Definition: chain.h:198
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_Head(Chain_Control *the_chain)
Return pointer to chain head.
Definition: chainimpl.h:192
RTEMS_INLINE_ROUTINE bool rtems_chain_has_only_one_node(const rtems_chain_control *the_chain)
Does this chain have only one node.
Definition: chain.h:522
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:29
RTEMS_INLINE_ROUTINE void rtems_chain_initialize_empty(rtems_chain_control *the_chain)
Initialize this chain as empty.
Definition: chain.h:168
RTEMS_INLINE_ROUTINE void rtems_chain_extract_unprotected(rtems_chain_node *the_node)
Extract the specified node from a chain (unprotected).
Definition: chain.h:590
RTEMS_INLINE_ROUTINE const rtems_chain_node * rtems_chain_immutable_tail(const rtems_chain_control *the_chain)
Return pointer to immutable Chain Tail.
Definition: chain.h:297
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:29
Watchdog_Interval rtems_interval
Used to manage and manipulate intervals specified by clock ticks.
Definition: types.h:127
void _Chain_Initialize(Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size)
Initialize a chain header.
Definition: chain.c:26
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:88
RTEMS_INLINE_ROUTINE const rtems_chain_node * rtems_chain_immutable_first(const rtems_chain_control *the_chain)
Return pointer to immutable Chain's First node.
Definition: chain.h:331
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
RTEMS_INLINE_ROUTINE size_t rtems_chain_node_count_unprotected(const rtems_chain_control *chain)
Returns the node count of the chain.
Definition: chain.h:775
RTEMS_INLINE_ROUTINE bool rtems_chain_is_last(const rtems_chain_node *the_node)
Is this the last node on the chain.
Definition: chain.h:504
Classic Event Manager API.
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:103
RTEMS_INLINE_ROUTINE bool _Chain_Are_nodes_equal(const Chain_Node *left, const Chain_Node *right)
Are two nodes equal.
Definition: chainimpl.h:158
RTEMS_INLINE_ROUTINE const Chain_Node * _Chain_Immutable_head(const Chain_Control *the_chain)
Return pointer to immutable chain head.
Definition: chainimpl.h:208
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_Next(const Chain_Node *the_node)
Return pointer the next node from this node.
Definition: chainimpl.h:324
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(const Chain_Node *node)
Is the node off chain.
Definition: chainimpl.h:139
RTEMS_INLINE_ROUTINE void _Chain_Extract_unprotected(Chain_Node *the_node)
Extract this node (unprotected).
Definition: chainimpl.h:557
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(Chain_Control *the_chain)
Initialize this chain as empty.
Definition: chainimpl.h:504
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:29
RTEMS_INLINE_ROUTINE void rtems_chain_append_unprotected(rtems_chain_control *the_chain, rtems_chain_node *the_node)
Append a node on the end of a chain (unprotected).
Definition: chain.h:679
RTEMS_INLINE_ROUTINE rtems_chain_node * rtems_chain_next(const rtems_chain_node *the_node)
Return pointer the next node from this node.
Definition: chain.h:381
RTEMS_INLINE_ROUTINE const Chain_Node * _Chain_Immutable_previous(const Chain_Node *the_node)
Return pointer the immutable previous node from this node.
Definition: chainimpl.h:372
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(const Chain_Control *the_chain)
Is the chain empty.
Definition: chainimpl.h:390
RTEMS_INLINE_ROUTINE rtems_chain_node * rtems_chain_get_unprotected(rtems_chain_control *the_chain)
See _Chain_Get_unprotected().
Definition: chain.h:616
RTEMS_INLINE_ROUTINE void rtems_chain_insert_unprotected(rtems_chain_node *after_node, rtems_chain_node *the_node)
See _Chain_Insert_unprotected().
Definition: chain.h:650
RTEMS_INLINE_ROUTINE rtems_chain_node * rtems_chain_last(const rtems_chain_control *the_chain)
Return pointer to Chain's Last node before the permanent tail.
Definition: chain.h:348
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:29
RTEMS_INLINE_ROUTINE void rtems_chain_prepend_unprotected(rtems_chain_control *the_chain, rtems_chain_node *the_node)
Prepend a node (unprotected).
Definition: chain.h:714
rtems_status_code
Classic API Status.
Definition: status.h:43
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_First(const Chain_Control *the_chain)
Return pointer to chain's first node.
Definition: chainimpl.h:257
RTEMS_INLINE_ROUTINE void rtems_chain_set_off_chain(rtems_chain_node *node)
Set off chain.
Definition: chain.h:183
RTEMS_INLINE_ROUTINE bool _Chain_Has_only_one_node(const Chain_Control *the_chain)
Does this chain have only one node.
Definition: chainimpl.h:449
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_Get_unprotected(Chain_Control *the_chain)
Get the first node (unprotected).
Definition: chainimpl.h:629
RTEMS_INLINE_ROUTINE bool rtems_chain_is_node_off_chain(const rtems_chain_node *node)
Is the node off chain.
Definition: chain.h:216
uint32_t rtems_event_set
Integer type to hold an event set of up to 32 events represented as a bit field.
Definition: event.h:40
size_t _Chain_Node_count_unprotected(const Chain_Control *chain)
Returns the node count of the chain.
Definition: chainnodecount.c:21
void rtems_chain_extract(rtems_chain_node *the_node)
Extract the specified node from a chain.
Definition: chainprotected.c:34
RTEMS_INLINE_ROUTINE bool _Chain_Is_last(const Chain_Node *the_node)
Is this the last node on the chain.
Definition: chainimpl.h:428
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:118
void rtems_chain_prepend(rtems_chain_control *the_chain, rtems_chain_node *the_node)
Prepend a node.
Definition: chainprotected.c:76
RTEMS_INLINE_ROUTINE bool rtems_chain_is_head(const rtems_chain_control *the_chain, const rtems_chain_node *the_node)
Is this node the chain head.
Definition: chain.h:541
RTEMS_INLINE_ROUTINE const Chain_Node * _Chain_Immutable_first(const Chain_Control *the_chain)
Return pointer to immutable chain's first node.
Definition: chainimpl.h:274
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_Tail(Chain_Control *the_chain)
Return pointer to chain tail.
Definition: chainimpl.h:224
RTEMS_INLINE_ROUTINE const Chain_Node * _Chain_Immutable_next(const Chain_Node *the_node)
Return pointer the immutable next node from this node.
Definition: chainimpl.h:340
RTEMS_INLINE_ROUTINE rtems_chain_node * rtems_chain_previous(const rtems_chain_node *the_node)
Return pointer the previous node from this node.
Definition: chain.h:413
RTEMS_INLINE_ROUTINE void _Chain_Initialize_node(Chain_Node *the_node)
Initializes a chain node.
Definition: chainimpl.h:119
RTEMS_INLINE_ROUTINE const rtems_chain_node * rtems_chain_immutable_next(const rtems_chain_node *the_node)
Return pointer the immutable next node from this node.
Definition: chain.h:397
RTEMS_INLINE_ROUTINE void _Chain_Insert_unprotected(Chain_Node *after_node, Chain_Node *the_node)
Insert a node (unprotected).
Definition: chainimpl.h:652
RTEMS_INLINE_ROUTINE bool rtems_chain_is_first(const rtems_chain_node *the_node)
Is this the first node on the chain.
Definition: chain.h:486
rtems_chain_node * rtems_chain_get(rtems_chain_control *the_chain)
Obtain the first node on a chain.
Definition: chainprotected.c:43
RTEMS_INLINE_ROUTINE bool rtems_chain_is_null_node(const rtems_chain_node *the_node)
Is the chain node pointer NULL.
Definition: chain.h:233
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_Previous(const Chain_Node *the_node)
Return pointer the previous node from this node.
Definition: chainimpl.h:356
RTEMS_INLINE_ROUTINE bool rtems_chain_are_nodes_equal(const rtems_chain_node *left, const rtems_chain_node *right)
Are Two nodes equal.
Definition: chain.h:448
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:64
RTEMS_INLINE_ROUTINE const rtems_chain_node * rtems_chain_immutable_last(const rtems_chain_control *the_chain)
Return pointer to immutable Chain's Last node.
Definition: chain.h:365
RTEMS_INLINE_ROUTINE bool rtems_chain_is_tail(const rtems_chain_control *the_chain, const rtems_chain_node *the_node)
Is this node the chain tail.
Definition: chain.h:561
RTEMS_INLINE_ROUTINE bool rtems_chain_is_empty(const rtems_chain_control *the_chain)
Is the chain empty.
Definition: chain.h:467
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(const Chain_Control *the_chain, const Chain_Node *the_node)
Is this node the chail tail.
Definition: chainimpl.h:489
RTEMS_INLINE_ROUTINE bool _Chain_Is_first(const Chain_Node *the_node)
Is this the first node on the chain.
Definition: chainimpl.h:410
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_Get_first_unprotected(Chain_Control *the_chain)
Get the first node (unprotected).
Definition: chainimpl.h:591
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(Chain_Node *node)
Set off chain.
Definition: chainimpl.h:101
void rtems_chain_insert(rtems_chain_node *after_node, rtems_chain_node *the_node)
Insert a node on a chain.
Definition: chainprotected.c:55
RTEMS_INLINE_ROUTINE bool _Chain_Is_null_node(const Chain_Node *the_node)
Is the chain node pointer NULL.
Definition: chainimpl.h:176
RTEMS_INLINE_ROUTINE void rtems_chain_initialize(rtems_chain_control *the_chain, void *starting_address, size_t number_nodes, size_t node_size)
Initialize a chain Header.
Definition: chain.h:146
RTEMS_INLINE_ROUTINE const Chain_Node * _Chain_Immutable_tail(const Chain_Control *the_chain)
Return pointer to immutable chain tail.
Definition: chainimpl.h:240
RTEMS_INLINE_ROUTINE rtems_chain_node * rtems_chain_get_first_unprotected(rtems_chain_control *the_chain)
See _Chain_Get_first_unprotected().
Definition: chain.h:626
RTEMS_INLINE_ROUTINE bool _Chain_Is_head(const Chain_Control *the_chain, const Chain_Node *the_node)
Is this node the chain head.
Definition: chainimpl.h:469
RTEMS_INLINE_ROUTINE const Chain_Node * _Chain_Immutable_last(const Chain_Control *the_chain)
Return pointer to immutable chain's last node.
Definition: chainimpl.h:308
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_Last(const Chain_Control *the_chain)
Return pointer to chain's last node.
Definition: chainimpl.h:291
RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(Chain_Control *the_chain, Chain_Node *the_node)
Prepend a node (unprotected).
Definition: chainimpl.h:728
RTEMS_INLINE_ROUTINE const rtems_chain_node * rtems_chain_immutable_previous(const rtems_chain_node *the_node)
Return pointer the immutable previous node from this node.
Definition: chain.h:429
RTEMS_INLINE_ROUTINE rtems_chain_node * rtems_chain_head(rtems_chain_control *the_chain)
Return pointer to Chain Head.
Definition: chain.h:249
RTEMS_INLINE_ROUTINE const rtems_chain_node * rtems_chain_immutable_head(const rtems_chain_control *the_chain)
Return pointer to immutable Chain Head.
Definition: chain.h:265
RTEMS_INLINE_ROUTINE rtems_chain_node * rtems_chain_first(const rtems_chain_control *the_chain)
Return pointer to Chain's First node after the permanent head.
Definition: chain.h:314