15 #ifndef _RTEMS_SCORE_PRIORITYIMPL_H 16 #define _RTEMS_SCORE_PRIORITYIMPL_H 39 #if defined(RTEMS_SMP) 59 #if defined(RTEMS_SMP) 60 return aggregation !=
NULL;
84 #if defined(RTEMS_SMP) 129 #if defined(RTEMS_DEBUG) 130 #if defined(RTEMS_SMP) 134 aggregation->
Action.
type = PRIORITY_ACTION_INVALID;
145 #if defined(RTEMS_DEBUG) 146 #if defined(RTEMS_SMP) 150 aggregation->
Action.
type = PRIORITY_ACTION_INVALID;
152 _Priority_Node_initialize( &aggregation->
Node, node->
priority );
174 #if defined(RTEMS_SMP) 175 return aggregation->scheduler;
218 #if defined(RTEMS_SMP) 219 return aggregation->
Action.next;
237 return *the_left < the_right->
priority;
267 _Priority_Plain_extract( aggregation, node );
268 _Priority_Plain_insert( aggregation, node, node->
priority );
271 typedef void ( *Priority_Add_handler )(
277 typedef void ( *Priority_Change_handler )(
284 typedef void ( *Priority_Remove_handler )(
318 Priority_Change_handler change,
324 _Assert( !_Priority_Is_empty( aggregation ) );
325 is_new_minimum = _Priority_Plain_insert( aggregation, node, node->
priority );
327 if ( is_new_minimum ) {
329 ( *change )( aggregation,
false, actions, arg );
337 Priority_Add_handler add,
338 Priority_Change_handler change,
342 if ( _Priority_Is_empty( aggregation ) ) {
343 _Priority_Initialize_one( aggregation, node );
344 ( *add )( aggregation, actions, arg );
346 _Priority_Non_empty_insert( aggregation, node, actions, change, arg );
354 Priority_Remove_handler
remove,
355 Priority_Change_handler change,
359 _Priority_Plain_extract( aggregation, node );
361 if ( _Priority_Is_empty( aggregation ) ) {
362 ( *remove )( aggregation, actions, arg );
366 min = _Priority_Get_minimum_node( aggregation );
370 ( *change )( aggregation,
true, actions, arg );
379 Priority_Change_handler change,
385 _Priority_Plain_extract( aggregation, node );
386 _Assert( !_Priority_Is_empty( aggregation ) );
388 min = _Priority_Get_minimum_node( aggregation );
392 ( *change )( aggregation,
true, actions, arg );
401 Priority_Change_handler change,
407 _Priority_Plain_changed( aggregation, node );
409 min = _Priority_Get_minimum_node( aggregation );
413 ( *change )( aggregation, prepend_it, actions, arg );
426 &victim->
Node.RBTree,
427 &replacement->
Node.RBTree
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:483
RTEMS_INLINE_ROUTINE bool _RBTree_Is_empty(const RBTree_Control *the_rbtree)
Is the RBTree empty.
Definition: rbtree.h:353
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:401
The priority aggregation.
Definition: priority.h:129
union Priority_Node::@3974 Node
Node component for a chain or red-black tree.
The priority node to build up a priority aggregation.
Definition: priority.h:94
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
Priority_Action_type
The priority action type.
Definition: priority.h:112
A list of priority actions.
Definition: priority.h:189
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
Priority_Control priority
The priority value of this node.
Definition: priority.h:106
Red-black tree node.
Definition: rbtree.h:50
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:66
RTEMS_INLINE_ROUTINE void _RBTree_Initialize_node(RBTree_Node *the_node)
Initializes a red-black tree node.
Definition: rbtree.h:125
Priority_Action_type type
The type of the action.
Definition: priority.h:178
RBTree_Control Contributors
A red-black tree to contain priority nodes contributing to the overall priority of this priority aggr...
Definition: priority.h:149
Priority_Node Node
This priority node reflects the overall priority of the aggregation.
Definition: priority.h:143
RTEMS_INLINE_ROUTINE bool _RBTree_Is_node_off_tree(const RBTree_Node *the_node)
Returns true, if this red-black tree node is off-tree, and false otherwise.
Definition: rbtree.h:99
RTEMS_INLINE_ROUTINE void _RBTree_Set_off_tree(RBTree_Node *the_node)
Sets a red-black tree node as off-tree.
Definition: rbtree.h:83
RBTree_Node * _RBTree_Minimum(const RBTree_Control *the_rbtree)
Returns the minimum node of the red-black tree.
Definition: rbtreenext.c:36
Scheduler control.
Definition: scheduler.h:266
const Scheduler_Control _Scheduler_Table[]
Registered schedulers.
void _RBTree_Extract(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Extracts (removes) the node from the red-black tree.
Definition: rbtreeextract.c:35
Priority_Node * node
The priority node of the action.
Definition: priority.h:173
#define RTEMS_CONTAINER_OF(_m, _type, _member_name)
Returns a pointer to the container of a specified member pointer.
Definition: basedefs.h:390
Constants and Structures Associated with the Scheduler.
struct Priority_Aggregation::@3975 Action
A priority action block to manage priority node additions, changes and removals.
RTEMS_INLINE_ROUTINE void _RBTree_Initialize_empty(RBTree_Control *the_rbtree)
Initialize this RBTree as empty.
Definition: rbtree.h:387
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77
Priority_Aggregation * actions
The first action of a priority action list.
Definition: priority.h:193