RTEMS  5.0.0
priority.h
Go to the documentation of this file.
1 
7 /*
8  * COPYRIGHT (c) 1989-2011.
9  * On-Line Applications Research Corporation (OAR).
10  *
11  * Copyright (c) 2016, 2017 embedded brains GmbH.
12  *
13  * The license and distribution terms for this file may be
14  * found in the file LICENSE in this distribution or at
15  * http://www.rtems.org/license/LICENSE.
16  */
17 
18 #ifndef _RTEMS_SCORE_PRIORITY_H
19 #define _RTEMS_SCORE_PRIORITY_H
20 
21 #include <rtems/score/chain.h>
22 #include <rtems/score/cpu.h>
23 #include <rtems/score/rbtree.h>
24 
25 struct _Scheduler_Control;
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
66 typedef uint64_t Priority_Control;
67 
71 #define PRIORITY_MINIMUM 0
72 
78 #define PRIORITY_PSEUDO_ISR PRIORITY_MINIMUM
79 
85 #if defined (CPU_PRIORITY_MAXIMUM)
86  #define PRIORITY_DEFAULT_MAXIMUM CPU_PRIORITY_MAXIMUM
87 #else
88  #define PRIORITY_DEFAULT_MAXIMUM 255
89 #endif
90 
94 typedef struct {
98  union {
99  Chain_Node Chain;
100  RBTree_Node RBTree;
101  } Node;
102 
106  Priority_Control priority;
107 } Priority_Node;
108 
112 typedef enum {
113  PRIORITY_ACTION_ADD,
114  PRIORITY_ACTION_CHANGE,
115  PRIORITY_ACTION_REMOVE,
116  PRIORITY_ACTION_INVALID
118 
119 typedef struct Priority_Aggregation Priority_Aggregation;
120 
129 struct Priority_Aggregation {
144 
149  RBTree_Control Contributors;
150 
151 #if defined(RTEMS_SMP)
152 
155  const struct _Scheduler_Control *scheduler;
156 #endif
157 
162  struct {
163 #if defined(RTEMS_SMP)
164 
167  Priority_Aggregation *next;
168 #endif
169 
174 
178  Priority_Action_type type;
179  } Action;
180 };
181 
189 typedef struct {
193  Priority_Aggregation *actions;
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 
202 #endif
203 /* end of include file */
The priority aggregation.
Definition: priority.h:129
Definition: chain.h:65
The priority node to build up a priority aggregation.
Definition: priority.h:94
Priority_Action_type
The priority action type.
Definition: priority.h:112
A list of priority actions.
Definition: priority.h:189
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
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
Constants and Structures Associated with the Red-Black Tree Handler.
Priority_Node Node
This priority node reflects the overall priority of the aggregation.
Definition: priority.h:143
Chain Handler API.
Scheduler control.
Definition: scheduler.h:266
Priority_Node * node
The priority node of the action.
Definition: priority.h:173
Priority_Aggregation * actions
The first action of a priority action list.
Definition: priority.h:193