37#ifndef _RTEMS_SCORE_PRIORITYIMPL_H
38#define _RTEMS_SCORE_PRIORITYIMPL_H
81static inline void _Priority_Actions_initialize_empty(
96static inline void _Priority_Actions_initialize_one(
103#if defined(RTEMS_SMP)
109 actions->
actions = aggregation;
120static inline bool _Priority_Actions_is_empty(
140 aggregation = actions->
actions;
152static inline void _Priority_Actions_add(
157#if defined(RTEMS_SMP)
164 actions->
actions = aggregation;
173static inline void _Priority_Node_initialize(
178 node->priority = priority;
179 _RBTree_Initialize_node( &node->Node.RBTree );
188static inline void _Priority_Node_set_priority(
193 node->priority = priority;
201static inline void _Priority_Node_set_inactive(
205 _RBTree_Set_off_tree( &node->Node.RBTree );
216static inline bool _Priority_Node_is_active(
220 return !_RBTree_Is_node_off_tree( &node->Node.RBTree );
228static inline void _Priority_Initialize_empty(
232#if defined(RTEMS_DEBUG)
233#if defined(RTEMS_SMP)
237 aggregation->
Action.
type = PRIORITY_ACTION_INVALID;
239 _RBTree_Initialize_node( &aggregation->
Node.
Node.RBTree );
249static inline void _Priority_Initialize_one(
254#if defined(RTEMS_DEBUG)
255#if defined(RTEMS_SMP)
259 aggregation->
Action.
type = PRIORITY_ACTION_INVALID;
261 _Priority_Node_initialize( &aggregation->
Node, node->priority );
262 _RBTree_Initialize_one( &aggregation->
Contributors, &node->Node.RBTree );
273static inline bool _Priority_Is_empty(
305#if defined(RTEMS_SMP)
306 return aggregation->scheduler;
332static inline void _Priority_Set_action_node(
346static inline void _Priority_Set_action_type(
362static inline void _Priority_Set_action(
372#if defined(RTEMS_SMP)
385 return aggregation->
Action.next;
398static inline bool _Priority_Less(
409 return *the_left < the_right->
priority;
425static inline bool _Priority_Plain_insert(
431 return _RBTree_Insert_inline(
447static inline void _Priority_Plain_extract(
464static inline void _Priority_Plain_changed(
469 _Priority_Plain_extract( aggregation, node );
470 _Priority_Plain_insert( aggregation, node, node->priority );
473typedef void ( *Priority_Add_handler )(
479typedef void ( *Priority_Change_handler )(
486typedef void ( *Priority_Remove_handler )(
502static inline void _Priority_Change_nothing(
524static inline void _Priority_Remove_nothing(
548static inline void _Priority_Non_empty_insert(
552 Priority_Change_handler change,
558 _Assert( !_Priority_Is_empty( aggregation ) );
559 is_new_minimum = _Priority_Plain_insert( aggregation, node, node->priority );
561 if ( is_new_minimum ) {
579static inline void _Priority_Insert(
583 Priority_Add_handler add,
584 Priority_Change_handler change,
588 if ( _Priority_Is_empty( aggregation ) ) {
589 _Priority_Initialize_one( aggregation, node );
590 ( *add )( aggregation, actions, arg );
592 _Priority_Non_empty_insert( aggregation, node, actions, change, arg );
613static inline void _Priority_Extract(
617 Priority_Remove_handler remove,
618 Priority_Change_handler change,
622 _Priority_Plain_extract( aggregation, node );
624 if ( _Priority_Is_empty( aggregation ) ) {
625 ( *remove )( aggregation, actions, arg );
630 min = _Priority_Get_minimum_node( aggregation );
633 if ( node->priority < min->priority ) {
653static inline void _Priority_Extract_non_empty(
657 Priority_Change_handler change,
663 _Priority_Plain_extract( aggregation, node );
664 _Assert( !_Priority_Is_empty( aggregation ) );
666 min = _Priority_Get_minimum_node( aggregation );
668 if ( node->priority < min->priority ) {
688static inline void _Priority_Changed(
693 Priority_Change_handler change,
699 _Priority_Plain_changed( aggregation, node );
705 min = _Priority_Get_minimum_node( aggregation );
710 ( *change )( aggregation, group_order, actions, arg );
724static inline void _Priority_Replace(
733 &victim->
Node.RBTree,
734 &replacement->
Node.RBTree
#define RTEMS_CONTAINER_OF(_m, _type, _member_name)
Gets the container of a member.
Definition: basedefs.h:306
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG and static analysis runs.
Definition: assert.h:96
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:91
Priority_Group_order
The priority group order determines if a priority node is inserted as the first or last node into its...
Definition: priorityimpl.h:62
Priority_Action_type
The priority action type.
Definition: priority.h:130
@ PRIORITY_GROUP_LAST
Priority group last option requests that the priority node is inserted as the last node into its prio...
Definition: priorityimpl.h:73
@ PRIORITY_GROUP_FIRST
Priority group first option requests that the priority node is inserted as the first node into its pr...
Definition: priorityimpl.h:67
void _RBTree_Extract(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Extracts (removes) the node from the red-black tree.
Definition: rbtreeextract.c:63
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:43
RBTree_Node * _RBTree_Minimum(const RBTree_Control *the_rbtree)
Returns the minimum node of the red-black tree.
Definition: rbtreemin.c:43
const Scheduler_Control _Scheduler_Table[]
This table contains the configured schedulers.
#define NULL
Requests a GPIO pin group configuration.
Definition: xil_types.h:54
This header file provides interfaces of the Priority Handler which are used by the implementation and...
This header file provides interfaces of the Scheduler Handler which are used by the implementation an...
A list of priority actions.
Definition: priority.h:207
Priority_Aggregation * actions
The first action of a priority action list.
Definition: priority.h:211
The priority aggregation.
Definition: priority.h:147
Priority_Action_type type
The type of the action.
Definition: priority.h:196
Priority_Node Node
This priority node reflects the overall priority of the aggregation.
Definition: priority.h:161
RBTree_Control Contributors
A red-black tree to contain priority nodes contributing to the overall priority of this priority aggr...
Definition: priority.h:167
struct Priority_Aggregation::@4382 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:191
The priority node to build up a priority aggregation.
Definition: priority.h:112
Priority_Control priority
The priority value of this node.
Definition: priority.h:124
union Priority_Node::@4381 Node
Node component for a chain or red-black tree.
Red-black tree node.
Definition: rbtree.h:73
Scheduler control.
Definition: scheduler.h:335