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

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
schedulernode.h
Go to the documentation of this file.
1
9/*
10 * Copyright (c) 2014, 2016 embedded brains GmbH. All rights reserved.
11 *
12 * embedded brains GmbH
13 * Dornierstr. 4
14 * 82178 Puchheim
15 * Germany
16 * <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.org/license/LICENSE.
21 */
22
23#ifndef _RTEMS_SCORE_SCHEDULERNODE_H
24#define _RTEMS_SCORE_SCHEDULERNODE_H
25
26#include <rtems/score/basedefs.h>
27#include <rtems/score/chain.h>
28#include <rtems/score/priority.h>
29#include <rtems/score/smplockseq.h>
30
37struct _Thread_Control;
38
39#ifdef __cplusplus
40extern "C" {
41#endif /* __cplusplus */
42
43#if defined(RTEMS_SMP)
47typedef enum {
51 SCHEDULER_NODE_REQUEST_NOT_PENDING,
52
57 SCHEDULER_NODE_REQUEST_ADD,
58
63 SCHEDULER_NODE_REQUEST_REMOVE,
64
69 SCHEDULER_NODE_REQUEST_NOTHING,
70
71} Scheduler_Node_request;
72#endif
73
74typedef struct Scheduler_Node Scheduler_Node;
75
79 struct Scheduler_Node {
80#if defined(RTEMS_SMP)
90 union {
91 Chain_Node Chain;
92 RBTree_Node RBTree;
93 } Node;
94
100 int sticky_level;
101
107 struct _Thread_Control *user;
108
117 struct _Thread_Control *idle;
118#endif
119
123 struct _Thread_Control *owner;
124
125#if defined(RTEMS_SMP)
130 struct {
135 Chain_Node Wait_node;
136
141 union {
145 Chain_Node Chain;
146
152 Scheduler_Node *next;
153 } Scheduler_node;
154
159 Scheduler_Node *next_request;
160
164 Scheduler_Node_request request;
165 } Thread;
166#endif
167
171 struct {
172 Priority_Aggregation Priority;
173 } Wait;
174
186 struct {
199 Priority_Control value;
200
201#if defined(RTEMS_SMP)
205 SMP_sequence_lock_Control Lock;
206#endif
207 } Priority;
208};
209
210#if defined(RTEMS_SMP)
216extern const size_t _Scheduler_Node_size;
217#endif
218
219#if defined(RTEMS_SMP)
220#define SCHEDULER_NODE_OF_THREAD_WAIT_NODE( node ) \
221 RTEMS_CONTAINER_OF( node, Scheduler_Node, Thread.Wait_node )
222
223#define SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE( node ) \
224 RTEMS_CONTAINER_OF( node, Scheduler_Node, Thread.Scheduler_node.Chain )
225#endif
226
227#ifdef __cplusplus
228}
229#endif /* __cplusplus */
230
233#endif /* _RTEMS_SCORE_SCHEDULERNODE_H */
basedefs.h
Basic Definitions.
Priority_Control
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:70
priority.h
Priority Handler API.
chain.h
Chain Handler API.
smplockseq.h
SMP Lock API.
Chain_Node_struct
Definition: chain.h:68
Priority_Aggregation
The priority aggregation.
Definition: priority.h:133
RBTree_Node
Red-black tree node.
Definition: rbtree.h:55
Scheduler_Node
Scheduler node for per-thread data.
Definition: schedulernode.h:79
Scheduler_Node::value
Priority_Control value
The thread priority value of this scheduler node.
Definition: schedulernode.h:199
Scheduler_Node::owner
struct _Thread_Control * owner
The thread owning this node.
Definition: schedulernode.h:123
Scheduler_Node::Wait
struct Scheduler_Node::@3981 Wait
Thread wait support block.
_Thread_Control
Definition: thread.h:732