RTEMS  5.1
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 
37 struct _Thread_Control;
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif /* __cplusplus */
42 
43 #if defined(RTEMS_SMP)
44 
47 typedef 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 
74 typedef struct Scheduler_Node Scheduler_Node;
75 
80 #if defined(RTEMS_SMP)
81 
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 
124 
125 #if defined(RTEMS_SMP)
126 
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 {
200 
201 #if defined(RTEMS_SMP)
202 
205  SMP_sequence_lock_Control Lock;
206 #endif
207  } Priority;
208 };
209 
210 #if defined(RTEMS_SMP)
211 
216 extern 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 */
The priority aggregation.
Definition: priority.h:133
Definition: chain.h:68
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:70
Red-black tree node.
Definition: rbtree.h:55
Definition: thread.h:732
struct _Thread_Control * owner
The thread owning this node.
Definition: schedulernode.h:123
Priority Handler API.
SMP Lock API.
Chain Handler API.
Scheduler node for per-thread data.
Definition: schedulernode.h:79
struct Scheduler_Node::@3980 Wait
Thread wait support block.
Basic Definitions.
Priority_Control value
The thread priority value of this scheduler node.
Definition: schedulernode.h:199