23 #ifndef _RTEMS_SCORE_PRIORITYIMPL_H 24 #define _RTEMS_SCORE_PRIORITYIMPL_H 66 #if defined(RTEMS_SMP) 87 return actions->
actions == NULL;
102 #if defined(RTEMS_SMP) 103 return aggregation != NULL;
123 aggregation = actions->
actions;
140 #if defined(RTEMS_SMP) 147 actions->
actions = aggregation;
215 #if defined(RTEMS_DEBUG) 216 #if defined(RTEMS_SMP) 220 aggregation->
Action.
type = PRIORITY_ACTION_INVALID;
237 #if defined(RTEMS_DEBUG) 238 #if defined(RTEMS_SMP) 242 aggregation->
Action.
type = PRIORITY_ACTION_INVALID;
288 #if defined(RTEMS_SMP) 367 #if defined(RTEMS_SMP) 395 return *the_left < the_right->
priority;
459 typedef void ( *Priority_Add_handler )(
465 typedef void ( *Priority_Change_handler )(
472 typedef void ( *Priority_Remove_handler )(
538 Priority_Change_handler change,
547 if ( is_new_minimum ) {
549 ( *change )( aggregation,
false, actions, arg );
569 Priority_Add_handler add,
570 Priority_Change_handler change,
576 ( *add )( aggregation, actions, arg );
603 Priority_Remove_handler
remove,
604 Priority_Change_handler change,
611 ( *remove )( aggregation, actions, arg );
619 ( *change )( aggregation,
true, actions, arg );
641 Priority_Change_handler change,
654 ( *change )( aggregation,
true, actions, arg );
678 Priority_Change_handler change,
690 ( *change )( aggregation, prepend_it, actions, arg );
713 &victim->
Node.RBTree,
714 &replacement->
Node.RBTree
The priority aggregation.
static __inline__ void _RBTree_Set_off_tree(RBTree_Node *the_node)
Sets a red-black tree node as off-tree.
static __inline__ void _Priority_Initialize_one(Priority_Aggregation *aggregation, Priority_Node *node)
Initializes the priority aggregation with the given information.
static __inline__ void _Priority_Non_empty_insert(Priority_Aggregation *aggregation, Priority_Node *node, Priority_Actions *actions, Priority_Change_handler change, void *arg)
Inserts the node in a nonempty aggregation and handles change if the node is the new minimum...
static __inline__ void _Priority_Set_action_node(Priority_Aggregation *aggregation, Priority_Node *node)
Sets the action node of the priority aggregation.
uint64_t Priority_Control
The thread priority control.
static __inline__ bool _RBTree_Insert_inline(RBTree_Control *the_rbtree, RBTree_Node *the_node, const void *key, bool(*less)(const void *, const RBTree_Node *))
Inserts the node into the red-black tree.
static __inline__ bool _Priority_Less(const void *left, const RBTree_Node *right)
Compares two priorities.
static __inline__ const Scheduler_Control * _Priority_Get_scheduler(const Priority_Aggregation *aggregation)
Gets the priority aggregation's scheduler.
static __inline__ void _Priority_Set_action_type(Priority_Aggregation *aggregation, Priority_Action_type type)
Sets the action type of the priority aggregation.
Priority_Aggregation * next
The next priority aggregation in the action list.
The priority node to build up a priority aggregation.
const struct _Scheduler_Control * scheduler
The scheduler instance of this priority aggregation.
static __inline__ void _Priority_Set_action(Priority_Aggregation *aggregation, Priority_Node *node, Priority_Action_type type)
Sets the action type and action node of the priority aggregation.
A list of priority actions.
static __inline__ void _RBTree_Initialize_empty(RBTree_Control *the_rbtree)
Initializes this RBTree as empty.
Priority_Control priority
The priority value of this node.
static __inline__ void _Priority_Initialize_empty(Priority_Aggregation *aggregation)
Initializes the priority aggregation empty.
struct Priority_Aggregation::@17 Action
A priority action block to manage priority node additions, changes and removals.
static __inline__ void _Priority_Insert(Priority_Aggregation *aggregation, Priority_Node *node, Priority_Actions *actions, Priority_Add_handler add, Priority_Change_handler change, void *arg)
static __inline__ void _Priority_Node_set_inactive(Priority_Node *node)
Sets the priority node inactive.
static __inline__ void _Priority_Plain_extract(Priority_Aggregation *aggregation, Priority_Node *node)
Extracts the priority node from the aggregation.
RBTree_Node * _RBTree_Minimum(const RBTree_Control *the_rbtree)
Returns the minimum node of the red-black tree.
static __inline__ Priority_Node * _Priority_Get_minimum_node(const Priority_Aggregation *aggregation)
Gets the minimum node of the priority aggregation.
#define RTEMS_CONTAINER_OF(_m, _type, _member_name)
Returns the pointer to the container of a specified member pointer.
Priority_Action_type type
The type of the action.
static __inline__ void _Priority_Changed(Priority_Aggregation *aggregation, Priority_Node *node, bool prepend_it, Priority_Actions *actions, Priority_Change_handler change, void *arg)
Updates the priority of the node in the aggregation.
static __inline__ bool _RBTree_Is_empty(const RBTree_Control *the_rbtree)
Checks if the RBTree is empty.
static __inline__ void _Priority_Replace(Priority_Aggregation *aggregation, Priority_Node *victim, Priority_Node *replacement)
Replaces one node by another.
RBTree_Control Contributors
A red-black tree to contain priority nodes contributing to the overall priority of this priority aggr...
void _RBTree_Replace_node(RBTree_Control *the_rbtree, RBTree_Node *victim, RBTree_Node *replacement)
Replaces a node in the red-black tree without a rebalance.
static __inline__ bool _RBTree_Is_node_off_tree(const RBTree_Node *the_node)
Checks if this red-black tree node is off-tree.
static __inline__ Priority_Aggregation * _Priority_Actions_move(Priority_Actions *actions)
Moves the priority actions' actions.
static __inline__ bool _Priority_Actions_is_valid(const Priority_Aggregation *aggregation)
Checks if the priority actions is valid.
const Scheduler_Control _Scheduler_Table[]
This table contains the configured schedulers.
static __inline__ void _Priority_Node_set_priority(Priority_Node *node, Priority_Control priority)
Sets the priority of the priority node to the given priority.
Priority_Node Node
This priority node reflects the overall priority of the aggregation.
static __inline__ void _Priority_Extract_non_empty(Priority_Aggregation *aggregation, Priority_Node *node, Priority_Actions *actions, Priority_Change_handler change, void *arg)
Extracts the node from the aggregation.
static __inline__ void _RBTree_Initialize_one(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Initializes this red-black tree to contain exactly the specified node.
static __inline__ void _Priority_Change_nothing(Priority_Aggregation *aggregation, bool prepend_it, Priority_Actions *actions, void *arg)
Does nothing.
static __inline__ void _Priority_Actions_initialize_one(Priority_Actions *actions, Priority_Aggregation *aggregation, Priority_Node *node, Priority_Action_type type)
Initializes the priority actions with the given information.
static __inline__ bool _Priority_Is_empty(const Priority_Aggregation *aggregation)
Checks if the priority aggregation is empty.
static __inline__ void _Priority_Actions_add(Priority_Actions *actions, Priority_Aggregation *aggregation)
Adds actions to the priority actions' actions.
static __inline__ void _RBTree_Initialize_node(RBTree_Node *the_node)
Initializes a red-black tree node.
static __inline__ Priority_Control _Priority_Get_priority(const Priority_Aggregation *aggregation)
Gets the priority aggregation's priority.
static __inline__ bool _Priority_Node_is_active(const Priority_Node *node)
Checks if the priority node is active.
static __inline__ void _Priority_Actions_initialize_empty(Priority_Actions *actions)
Initializes the priority actions empty.
static __inline__ bool _Priority_Actions_is_empty(const Priority_Actions *actions)
Checks if the priority actions is empty.
void _RBTree_Extract(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Extracts (removes) the node from the red-black tree.
Priority_Node * node
The priority node of the action.
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
Priority_Action_type
The priority action type.
union Priority_Node::@16 Node
Node component for a chain or red-black tree.
static __inline__ void _Priority_Remove_nothing(Priority_Aggregation *aggregation, Priority_Actions *actions, void *arg)
Does nothing.
static __inline__ void _Priority_Plain_changed(Priority_Aggregation *aggregation, Priority_Node *node)
Updates the priority of the node in the aggregation.
Constants and Structures Associated with the Scheduler.
static __inline__ void _Priority_Extract(Priority_Aggregation *aggregation, Priority_Node *node, Priority_Actions *actions, Priority_Remove_handler remove, Priority_Change_handler change, void *arg)
Extracts the node from the aggregation.
static __inline__ Priority_Aggregation * _Priority_Get_next_action(const Priority_Aggregation *aggregation)
Gets the next action of the priority aggregation.
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.
static __inline__ void _Priority_Node_initialize(Priority_Node *node, Priority_Control priority)
Initializes the priority node to the given priority.
static __inline__ bool _Priority_Plain_insert(Priority_Aggregation *aggregation, Priority_Node *node, Priority_Control priority)
Inserts the node with the given priority into the priority aggregation's contributors.
Priority_Aggregation * actions
The first action of a priority action list.