23#ifndef _RTEMS_SCORE_PRIORITYIMPL_H
24#define _RTEMS_SCORE_PRIORITYIMPL_H
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)
289 return aggregation->scheduler;
367#if defined(RTEMS_SMP)
368 return aggregation->
Action.next;
395 return *the_left < the_right->
priority;
459typedef void ( *Priority_Add_handler )(
465typedef void ( *Priority_Change_handler )(
472typedef 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 );
617 if ( node->
priority < min->priority ) {
619 ( *change )( aggregation,
true, actions, arg );
641 Priority_Change_handler change,
652 if ( node->
priority < min->priority ) {
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
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.
Definition: assert.h:100
#define RTEMS_CONTAINER_OF(_m, _type, _member_name)
Returns a pointer to the container of a specified member pointer.
Definition: basedefs.h:430
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
RTEMS_INLINE_ROUTINE bool _Priority_Is_empty(const Priority_Aggregation *aggregation)
Checks if the priority aggregation is empty.
Definition: priorityimpl.h:256
RTEMS_INLINE_ROUTINE void _Priority_Set_action_type(Priority_Aggregation *aggregation, Priority_Action_type type)
Sets the action type of the priority aggregation.
Definition: priorityimpl.h:329
RTEMS_INLINE_ROUTINE void _Priority_Node_initialize(Priority_Node *node, Priority_Control priority)
Initializes the priority node to the given priority.
Definition: priorityimpl.h:156
RTEMS_INLINE_ROUTINE bool _Priority_Actions_is_empty(const Priority_Actions *actions)
Checks if the priority actions is empty.
Definition: priorityimpl.h:83
RTEMS_INLINE_ROUTINE 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.
Definition: priorityimpl.h:345
RTEMS_INLINE_ROUTINE 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.
Definition: priorityimpl.h:411
RTEMS_INLINE_ROUTINE Priority_Node * _Priority_Get_minimum_node(const Priority_Aggregation *aggregation)
Gets the minimum node of the priority aggregation.
Definition: priorityimpl.h:302
RTEMS_INLINE_ROUTINE void _Priority_Change_nothing(Priority_Aggregation *aggregation, bool prepend_it, Priority_Actions *actions, void *arg)
Does nothing.
Definition: priorityimpl.h:488
RTEMS_INLINE_ROUTINE bool _Priority_Node_is_active(const Priority_Node *node)
Checks if the priority node is active.
Definition: priorityimpl.h:199
RTEMS_INLINE_ROUTINE void _Priority_Plain_extract(Priority_Aggregation *aggregation, Priority_Node *node)
Extracts the priority node from the aggregation.
Definition: priorityimpl.h:433
RTEMS_INLINE_ROUTINE 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.
Definition: priorityimpl.h:599
RTEMS_INLINE_ROUTINE void _Priority_Replace(Priority_Aggregation *aggregation, Priority_Node *victim, Priority_Node *replacement)
Replaces one node by another.
Definition: priorityimpl.h:704
RTEMS_INLINE_ROUTINE void _Priority_Remove_nothing(Priority_Aggregation *aggregation, Priority_Actions *actions, void *arg)
Does nothing.
Definition: priorityimpl.h:510
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:70
RTEMS_INLINE_ROUTINE void _Priority_Actions_add(Priority_Actions *actions, Priority_Aggregation *aggregation)
Adds actions to the priority actions' actions.
Definition: priorityimpl.h:135
RTEMS_INLINE_ROUTINE Priority_Aggregation * _Priority_Get_next_action(const Priority_Aggregation *aggregation)
Gets the next action of the priority aggregation.
Definition: priorityimpl.h:363
RTEMS_INLINE_ROUTINE 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.
Definition: priorityimpl.h:534
RTEMS_INLINE_ROUTINE bool _Priority_Less(const void *left, const RBTree_Node *right)
Compares two priorities.
Definition: priorityimpl.h:384
RTEMS_INLINE_ROUTINE void _Priority_Actions_initialize_empty(Priority_Actions *actions)
Initializes the priority actions empty.
Definition: priorityimpl.h:44
RTEMS_INLINE_ROUTINE 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.
Definition: priorityimpl.h:637
RTEMS_INLINE_ROUTINE Priority_Aggregation * _Priority_Actions_move(Priority_Actions *actions)
Moves the priority actions' actions.
Definition: priorityimpl.h:117
RTEMS_INLINE_ROUTINE void _Priority_Initialize_empty(Priority_Aggregation *aggregation)
Initializes the priority aggregation empty.
Definition: priorityimpl.h:211
RTEMS_INLINE_ROUTINE void _Priority_Node_set_priority(Priority_Node *node, Priority_Control priority)
Sets the priority of the priority node to the given priority.
Definition: priorityimpl.h:171
RTEMS_INLINE_ROUTINE void _Priority_Plain_changed(Priority_Aggregation *aggregation, Priority_Node *node)
Updates the priority of the node in the aggregation.
Definition: priorityimpl.h:450
RTEMS_INLINE_ROUTINE void _Priority_Node_set_inactive(Priority_Node *node)
Sets the priority node inactive.
Definition: priorityimpl.h:184
RTEMS_INLINE_ROUTINE bool _Priority_Actions_is_valid(const Priority_Aggregation *aggregation)
Checks if the priority actions is valid.
Definition: priorityimpl.h:98
RTEMS_INLINE_ROUTINE void _Priority_Initialize_one(Priority_Aggregation *aggregation, Priority_Node *node)
Initializes the priority aggregation with the given information.
Definition: priorityimpl.h:232
RTEMS_INLINE_ROUTINE 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.
Definition: priorityimpl.h:59
RTEMS_INLINE_ROUTINE void _Priority_Insert(Priority_Aggregation *aggregation, Priority_Node *node, Priority_Actions *actions, Priority_Add_handler add, Priority_Change_handler change, void *arg)
Definition: priorityimpl.h:565
Priority_Action_type
The priority action type.
Definition: priority.h:116
RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_priority(const Priority_Aggregation *aggregation)
Gets the priority aggregation's priority.
Definition: priorityimpl.h:270
RTEMS_INLINE_ROUTINE void _Priority_Set_action_node(Priority_Aggregation *aggregation, Priority_Node *node)
Sets the action node of the priority aggregation.
Definition: priorityimpl.h:315
RTEMS_INLINE_ROUTINE 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.
Definition: priorityimpl.h:673
RTEMS_INLINE_ROUTINE const Scheduler_Control * _Priority_Get_scheduler(const Priority_Aggregation *aggregation)
Gets the priority aggregation's scheduler.
Definition: priorityimpl.h:284
RTEMS_INLINE_ROUTINE bool _RBTree_Is_empty(const RBTree_Control *the_rbtree)
Checks if the RBTree is empty.
Definition: rbtree.h:375
void _RBTree_Extract(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Extracts (removes) the node from the red-black tree.
Definition: rbtreeextract.c:35
RTEMS_INLINE_ROUTINE void _RBTree_Initialize_empty(RBTree_Control *the_rbtree)
Initializes this RBTree as empty.
Definition: rbtree.h:410
RTEMS_INLINE_ROUTINE bool _RBTree_Is_node_off_tree(const RBTree_Node *the_node)
Checks if this red-black tree node is off-tree.
Definition: rbtree.h:103
RTEMS_INLINE_ROUTINE void _RBTree_Initialize_one(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Initializes this red-black tree to contain exactly the specified node.
Definition: rbtree.h:424
RTEMS_INLINE_ROUTINE void _RBTree_Set_off_tree(RBTree_Node *the_node)
Sets a red-black tree node as off-tree.
Definition: rbtree.h:88
RTEMS_INLINE_ROUTINE 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.
Definition: rbtree.h:508
RTEMS_INLINE_ROUTINE void _RBTree_Initialize_node(RBTree_Node *the_node)
Initializes a red-black tree node.
Definition: rbtree.h:129
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.
Definition: rbtreereplace.c:29
RBTree_Node * _RBTree_Minimum(const RBTree_Control *the_rbtree)
Returns the minimum node of the red-black tree.
Definition: rbtreenext.c:36
const Scheduler_Control _Scheduler_Table[]
Registered schedulers.
Constants and Structures Associated with the Scheduler.
A list of priority actions.
Definition: priority.h:193
Priority_Aggregation * actions
The first action of a priority action list.
Definition: priority.h:197
The priority aggregation.
Definition: priority.h:133
Priority_Action_type type
The type of the action.
Definition: priority.h:182
Priority_Node Node
This priority node reflects the overall priority of the aggregation.
Definition: priority.h:147
RBTree_Control Contributors
A red-black tree to contain priority nodes contributing to the overall priority of this priority aggr...
Definition: priority.h:153
struct Priority_Aggregation::@3980 Action
A priority action block to manage priority node additions, changes and removals.
Priority_Node * node
The priority node of the action.
Definition: priority.h:177
The priority node to build up a priority aggregation.
Definition: priority.h:98
Priority_Control priority
The priority value of this node.
Definition: priority.h:110
union Priority_Node::@3979 Node
Node component for a chain or red-black tree.
Red-black tree node.
Definition: rbtree.h:55
Scheduler control.
Definition: scheduler.h:269