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 ) 148 void *starting_address,
static __inline__ void rtems_chain_set_off_chain(rtems_chain_node *node)
Set off chain.
static __inline__ bool rtems_chain_is_empty(const rtems_chain_control *the_chain)
Is the chain empty.
static __inline__ rtems_chain_node * rtems_chain_next(const rtems_chain_node *the_node)
Return pointer the next node from this node.
static __inline__ Chain_Node * _Chain_First(const Chain_Control *the_chain)
Returns pointer to chain's first node.
static __inline__ bool _Chain_Is_first(const Chain_Node *the_node)
Checks if this is the first node on the chain.
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...
static __inline__ bool _Chain_Are_nodes_equal(const Chain_Node *left, const Chain_Node *right)
Checks if two nodes are equal.
static __inline__ rtems_chain_node * rtems_chain_tail(rtems_chain_control *the_chain)
Return pointer to Chain Tail.
static __inline__ rtems_chain_node * rtems_chain_first(const rtems_chain_control *the_chain)
Return pointer to Chain's First node after the permanent head.
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...
static __inline__ void rtems_chain_initialize_empty(rtems_chain_control *the_chain)
Initialize this chain as empty.
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.
static __inline__ bool _Chain_Is_node_off_chain(const Chain_Node *node)
Checks if the node is off chain.
static __inline__ bool _Chain_Is_last(const Chain_Node *the_node)
Checks if this is the last node on the chain.
static __inline__ void _Chain_Initialize_node(Chain_Node *the_node)
Initializes a chain node.
static __inline__ rtems_chain_node * rtems_chain_get_unprotected(rtems_chain_control *the_chain)
See _Chain_Get_unprotected().
static __inline__ const Chain_Node * _Chain_Immutable_previous(const Chain_Node *the_node)
Returns pointer to the immutable previous node from this node.
static __inline__ void rtems_chain_initialize_node(rtems_chain_node *node)
Initializes a chain node.
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.
static __inline__ Chain_Node * _Chain_Get_first_unprotected(Chain_Control *the_chain)
Gets the first node (unprotected).
static __inline__ rtems_chain_node * rtems_chain_head(rtems_chain_control *the_chain)
Return pointer to Chain Head.
void _Chain_Initialize(Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size)
Initializes a chain header.
size_t _Chain_Node_count_unprotected(const Chain_Control *chain)
Returns the node count of the chain.
static __inline__ void rtems_chain_insert_unprotected(rtems_chain_node *after_node, rtems_chain_node *the_node)
See _Chain_Insert_unprotected().
static __inline__ bool _Chain_Is_head(const Chain_Control *the_chain, const Chain_Node *the_node)
Checks if this node is the chain head.
static __inline__ void rtems_chain_extract_unprotected(rtems_chain_node *the_node)
Extract the specified node from a chain (unprotected).
static __inline__ const rtems_chain_node * rtems_chain_immutable_last(const rtems_chain_control *the_chain)
Return pointer to immutable Chain's Last node.
static __inline__ bool rtems_chain_is_null_node(const rtems_chain_node *the_node)
Is the chain node pointer NULL.
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...
static __inline__ void _Chain_Insert_unprotected(Chain_Node *after_node, Chain_Node *the_node)
Inserts a node (unprotected).
static __inline__ bool rtems_chain_has_only_one_node(const rtems_chain_control *the_chain)
Does this chain have only one node.
static __inline__ bool rtems_chain_is_last(const rtems_chain_node *the_node)
Is this the last node on the chain.
static __inline__ void _Chain_Append_unprotected(Chain_Control *the_chain, Chain_Node *the_node)
Appends a node (unprotected).
static __inline__ 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).
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...
static __inline__ void _Chain_Prepend_unprotected(Chain_Control *the_chain, Chain_Node *the_node)
Prepends a node (unprotected).
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
static __inline__ bool _Chain_Is_null_node(const Chain_Node *the_node)
Checks if the chain node pointer is NULL.
static __inline__ Chain_Node * _Chain_Next(const Chain_Node *the_node)
Returns pointer to the next node from this node.
static __inline__ const rtems_chain_node * rtems_chain_immutable_first(const rtems_chain_control *the_chain)
Return pointer to immutable Chain's First node.
static __inline__ const rtems_chain_node * rtems_chain_immutable_next(const rtems_chain_node *the_node)
Return pointer the immutable next node from this node.
static __inline__ Chain_Node * _Chain_Head(Chain_Control *the_chain)
Returns pointer to chain head.
void rtems_chain_extract(rtems_chain_node *the_node)
Extract the specified node from a chain.
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.
static __inline__ bool _Chain_Has_only_one_node(const Chain_Control *the_chain)
Checks if this chain has only one node.
static __inline__ void _Chain_Extract_unprotected(Chain_Node *the_node)
Extracts this node (unprotected).
static __inline__ const Chain_Node * _Chain_Immutable_next(const Chain_Node *the_node)
Returns pointer to the immutable next node from this node.
static __inline__ bool rtems_chain_is_head(const rtems_chain_control *the_chain, const rtems_chain_node *the_node)
Is this node the chain head.
void rtems_chain_prepend(rtems_chain_control *the_chain, rtems_chain_node *the_node)
Prepend a node.
static __inline__ bool rtems_chain_is_first(const rtems_chain_node *the_node)
Is this the first node on the chain.
rtems_chain_node * rtems_chain_get(rtems_chain_control *the_chain)
Obtain the first node on a chain.
Watchdog_Interval rtems_interval
This type is used to represent clock tick intervals.
static __inline__ bool rtems_chain_are_nodes_equal(const rtems_chain_node *left, const rtems_chain_node *right)
Are Two nodes equal.
Objects_Id rtems_id
Values of this type identify an RTEMS object.
static __inline__ size_t rtems_chain_node_count_unprotected(const rtems_chain_control *chain)
Returns the node count of the chain.
static __inline__ void _Chain_Initialize_empty(Chain_Control *the_chain)
Initializes this chain as empty.
This header file defines the Event Manager API.
static __inline__ const Chain_Node * _Chain_Immutable_first(const Chain_Control *the_chain)
Returns pointer to immutable chain's first node.
void rtems_chain_append(rtems_chain_control *the_chain, rtems_chain_node *the_node)
Append a node on the end of a chain.
static __inline__ Chain_Node * _Chain_Last(const Chain_Control *the_chain)
Returns pointer to chain's last node.
static __inline__ Chain_Node * _Chain_Previous(const Chain_Node *the_node)
Returns pointer to the previous node from this node.
static __inline__ void _Chain_Set_off_chain(Chain_Node *node)
Sets off chain.
static __inline__ const Chain_Node * _Chain_Immutable_head(const Chain_Control *the_chain)
Returns pointer to immutable chain head.
void rtems_chain_insert(rtems_chain_node *after_node, rtems_chain_node *the_node)
Insert a node on a chain.
static __inline__ const Chain_Node * _Chain_Immutable_last(const Chain_Control *the_chain)
Returns pointer to immutable chain's last node.
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
static __inline__ rtems_chain_node * rtems_chain_last(const rtems_chain_control *the_chain)
Return pointer to Chain's Last node before the permanent tail.
static __inline__ bool rtems_chain_is_tail(const rtems_chain_control *the_chain, const rtems_chain_node *the_node)
Is this node the chain tail.
uint32_t rtems_event_set
This integer type can hold an event set of up to 32 events represented as a bit field.
static __inline__ bool _Chain_Is_empty(const Chain_Control *the_chain)
Checks if the chain is empty.
static __inline__ bool rtems_chain_is_node_off_chain(const rtems_chain_node *node)
Is the node off chain.
static __inline__ void rtems_chain_prepend_unprotected(rtems_chain_control *the_chain, rtems_chain_node *the_node)
Prepend a node (unprotected).
static __inline__ const rtems_chain_node * rtems_chain_immutable_head(const rtems_chain_control *the_chain)
Return pointer to immutable Chain Head.
static __inline__ Chain_Node * _Chain_Tail(Chain_Control *the_chain)
Returns pointer to chain tail.
static __inline__ rtems_chain_node * rtems_chain_previous(const rtems_chain_node *the_node)
Return pointer the previous node from this node.
static __inline__ rtems_chain_node * rtems_chain_get_first_unprotected(rtems_chain_control *the_chain)
See _Chain_Get_first_unprotected().
static __inline__ bool _Chain_Is_tail(const Chain_Control *the_chain, const Chain_Node *the_node)
Checks if this node is the chain tail.
static __inline__ const Chain_Node * _Chain_Immutable_tail(const Chain_Control *the_chain)
Returns pointer to immutable chain tail.
static __inline__ const rtems_chain_node * rtems_chain_immutable_previous(const rtems_chain_node *the_node)
Return pointer the immutable previous node from this node.
static __inline__ const rtems_chain_node * rtems_chain_immutable_tail(const rtems_chain_control *the_chain)
Return pointer to immutable Chain Tail.
static __inline__ Chain_Node * _Chain_Get_unprotected(Chain_Control *the_chain)
Gets the first node (unprotected).
static __inline__ void rtems_chain_initialize(rtems_chain_control *the_chain, void *starting_address, size_t number_nodes, size_t node_size)
Initialize a chain Header.