RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
cpukit
include
rtems
score
priority.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
12
13
/*
14
* COPYRIGHT (c) 1989-2011.
15
* On-Line Applications Research Corporation (OAR).
16
*
17
* Copyright (C) 2016, 2017 embedded brains GmbH & Co. KG
18
*
19
* Redistribution and use in source and binary forms, with or without
20
* modification, are permitted provided that the following conditions
21
* are met:
22
* 1. Redistributions of source code must retain the above copyright
23
* notice, this list of conditions and the following disclaimer.
24
* 2. Redistributions in binary form must reproduce the above copyright
25
* notice, this list of conditions and the following disclaimer in the
26
* documentation and/or other materials provided with the distribution.
27
*
28
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
32
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38
* POSSIBILITY OF SUCH DAMAGE.
39
*/
40
41
#ifndef _RTEMS_SCORE_PRIORITY_H
42
#define _RTEMS_SCORE_PRIORITY_H
43
44
#include <
rtems/score/chain.h
>
45
#include <rtems/score/cpu.h>
46
#include <
rtems/score/rbtree.h
>
47
48
#ifdef __cplusplus
49
extern
"C"
{
50
#endif
51
52
struct
_Scheduler_Control
;
53
71
91
typedef
uint64_t
Priority_Control
;
92
96
#define PRIORITY_MINIMUM 0
97
103
#if defined (CPU_PRIORITY_MAXIMUM)
104
#define PRIORITY_DEFAULT_MAXIMUM CPU_PRIORITY_MAXIMUM
105
#else
106
#define PRIORITY_DEFAULT_MAXIMUM 255
107
#endif
108
112
typedef
struct
{
116
union
{
117
Chain_Node
Chain;
118
RBTree_Node
RBTree;
119
} Node;
120
124
Priority_Control
priority
;
125
}
Priority_Node
;
126
130
typedef
enum
{
131
PRIORITY_ACTION_ADD,
132
PRIORITY_ACTION_CHANGE,
133
PRIORITY_ACTION_REMOVE,
134
PRIORITY_ACTION_INVALID
135
}
Priority_Action_type
;
136
137
typedef
struct
Priority_Aggregation
Priority_Aggregation
;
138
147
struct
Priority_Aggregation
{
161
Priority_Node
Node
;
162
167
RBTree_Control
Contributors
;
168
169
#if defined(RTEMS_SMP)
173
const
struct
_Scheduler_Control
*scheduler;
174
#endif
175
180
struct
{
181
#if defined(RTEMS_SMP)
185
Priority_Aggregation
*next;
186
#endif
187
191
Priority_Node
*
node
;
192
196
Priority_Action_type
type
;
197
} Action;
198
};
199
207
typedef
struct
{
211
Priority_Aggregation
*
actions
;
212
}
Priority_Actions
;
213
214
#ifdef __cplusplus
215
}
216
#endif
217
219
220
#endif
221
/* end of include file */
Priority_Control
uint64_t Priority_Control
The thread priority control.
Definition
priority.h:91
Priority_Action_type
Priority_Action_type
The priority action type.
Definition
priority.h:130
rbtree.h
This header file provides interfaces of the Red-Black Tree Handler which are used by the implementati...
chain.h
This header file provides interfaces of the Chain Handler which are used by the implementation and th...
Chain_Node
This structure represents a chain node.
Definition
chain.h:78
Priority_Actions
A list of priority actions.
Definition
priority.h:207
Priority_Actions::actions
Priority_Aggregation * actions
The first action of a priority action list.
Definition
priority.h:211
Priority_Aggregation::[struct].Action::node
Priority_Node * node
The priority node of the action.
Priority_Aggregation::[struct].Action::type
Priority_Action_type type
The type of the action.
Priority_Aggregation
The priority aggregation.
Definition
priority.h:147
Priority_Aggregation::Node
Priority_Node Node
This priority node reflects the overall priority of the aggregation.
Definition
priority.h:161
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:167
Priority_Node
The priority node to build up a priority aggregation.
Definition
priority.h:112
Priority_Node::priority
Priority_Control priority
The priority value of this node.
Definition
priority.h:124
RBTree_Node
Red-black tree node.
Definition
rbtree.h:73
_Scheduler_Control
Scheduler control.
Definition
scheduler.h:337
Generated by
1.18.0