RTEMS 6.1-rc7
Loading...
Searching...
No Matches
priority.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
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
49extern "C" {
50#endif
51
53
91typedef 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
112typedef struct {
116 union {
117 Chain_Node Chain;
118 RBTree_Node RBTree;
119 } Node;
120
126
130typedef enum {
131 PRIORITY_ACTION_ADD,
132 PRIORITY_ACTION_CHANGE,
133 PRIORITY_ACTION_REMOVE,
134 PRIORITY_ACTION_INVALID
136
138
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)
186#endif
187
192
198};
199
207typedef struct {
213
214#ifdef __cplusplus
215}
216#endif
217
220#endif
221/* end of include file */
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:91
Priority_Action_type
The priority action type.
Definition: priority.h:130
This header file provides interfaces of the Red-Black Tree Handler which are used by the implementati...
This header file provides interfaces of the Chain Handler which are used by the implementation and th...
This structure represents a chain node.
Definition: chain.h:78
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
struct Priority_Aggregation::@4405 Action
A priority action block to manage priority node additions, changes and removals.
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
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
Red-black tree node.
Definition: rbtree.h:73
Scheduler control.
Definition: scheduler.h:337