RTEMS: cpukit/include/rtems/score/priority.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
priority.h
Go to the documentation of this file.
1
9/*
10 * COPYRIGHT (c) 1989-2011.
11 * On-Line Applications Research Corporation (OAR).
12 *
13 * Copyright (c) 2016, 2017 embedded brains GmbH.
14 *
15 * The license and distribution terms for this file may be
16 * found in the file LICENSE in this distribution or at
17 * http://www.rtems.org/license/LICENSE.
18 */
19
20#ifndef _RTEMS_SCORE_PRIORITY_H
21#define _RTEMS_SCORE_PRIORITY_H
22
23#include <rtems/score/chain.h>
24#include <rtems/score/cpu.h>
25#include <rtems/score/rbtree.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31struct _Scheduler_Control;
32
70 typedef uint64_t Priority_Control;
71
75#define PRIORITY_MINIMUM 0
76
82#define PRIORITY_PSEUDO_ISR PRIORITY_MINIMUM
83
89#if defined (CPU_PRIORITY_MAXIMUM)
90 #define PRIORITY_DEFAULT_MAXIMUM CPU_PRIORITY_MAXIMUM
91#else
92 #define PRIORITY_DEFAULT_MAXIMUM 255
93#endif
94
98 typedef struct {
102 union {
103 Chain_Node Chain;
104 RBTree_Node RBTree;
105 } Node;
106
110 Priority_Control priority;
111} Priority_Node;
112
116 typedef enum {
117 PRIORITY_ACTION_ADD,
118 PRIORITY_ACTION_CHANGE,
119 PRIORITY_ACTION_REMOVE,
120 PRIORITY_ACTION_INVALID
121} Priority_Action_type;
122
123typedef struct Priority_Aggregation Priority_Aggregation;
124
133 struct Priority_Aggregation {
147 Priority_Node Node;
148
153 RBTree_Control Contributors;
154
155#if defined(RTEMS_SMP)
159 const struct _Scheduler_Control *scheduler;
160#endif
161
166 struct {
167#if defined(RTEMS_SMP)
171 Priority_Aggregation *next;
172#endif
173
177 Priority_Node *node;
178
182 Priority_Action_type type;
183 } Action;
184};
185
193 typedef struct {
197 Priority_Aggregation *actions;
198} Priority_Actions;
199
200#ifdef __cplusplus
201}
202#endif
203
206#endif
207/* end of include file */
Priority_Control
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:70
Priority_Action_type
Priority_Action_type
The priority action type.
Definition: priority.h:116
rbtree.h
Constants and Structures Associated with the Red-Black Tree Handler.
chain.h
Chain Handler API.
Chain_Node_struct
Definition: chain.h:68
Priority_Actions
A list of priority actions.
Definition: priority.h:193
Priority_Actions::actions
Priority_Aggregation * actions
The first action of a priority action list.
Definition: priority.h:197
Priority_Aggregation
The priority aggregation.
Definition: priority.h:133
Priority_Aggregation::type
Priority_Action_type type
The type of the action.
Definition: priority.h:182
Priority_Aggregation::Node
Priority_Node Node
This priority node reflects the overall priority of the aggregation.
Definition: priority.h:147
Priority_Aggregation::Contributors
RBTree_Control Contributors
A red-black tree to contain priority nodes contributing to the overall priority of this priority aggr...
Definition: priority.h:153
Priority_Aggregation::Action
struct Priority_Aggregation::@3980 Action
A priority action block to manage priority node additions, changes and removals.
Priority_Aggregation::node
Priority_Node * node
The priority node of the action.
Definition: priority.h:177
Priority_Node
The priority node to build up a priority aggregation.
Definition: priority.h:98
Priority_Node::priority
Priority_Control priority
The priority value of this node.
Definition: priority.h:110
RBTree_Node
Red-black tree node.
Definition: rbtree.h:55
_Scheduler_Control
Scheduler control.
Definition: scheduler.h:269