RTEMS
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 {
52 
58 
64 
70 
72 #endif
73 
74 typedef struct Scheduler_Node Scheduler_Node;
75 
80 #if defined(RTEMS_SMP)
81 
90  union {
92  RBTree_Node RBTree;
93  } Node;
94 
101 
108 
118 #endif
119 
124 
125 #if defined(RTEMS_SMP)
126 
130  struct {
136 
141  union {
146 
153  } Scheduler_node;
154 
160 
165  } Thread;
166 #endif
167 
171  struct {
172  Priority_Aggregation Priority;
173  } Wait;
174 
186  struct {
200 
201 #if defined(RTEMS_SMP)
202 
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
int sticky_level
The sticky level determines if this scheduler node should use an idle thread in case this node is sch...
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:70
SMP_sequence_lock_Control Lock
Sequence lock to synchronize priority value updates.
Scheduler_Node * next_request
Link to the next scheduler node in the Thread_Control::Scheduler::requests list.
union Scheduler_Node::@18 Node
Chain node for usage in various scheduler data structures.
Scheduler_Node_request
The scheduler node requests.
Definition: schedulernode.h:47
Red-black tree node.
Definition: rbtree.h:55
struct Scheduler_Node::@19 Thread
Block to register and manage this scheduler node in the thread control block of the owner of this sch...
Scheduler_Node_request request
The current scheduler node request.
There is a pending scheduler node request to remove this scheduler node from the Thread_Control::Sche...
Definition: schedulernode.h:63
struct _Thread_Control * idle
The idle thread claimed by this node in case the sticky level is greater than zero and the thread is ...
There is a pending scheduler node request to add this scheduler node to the Thread_Control::Scheduler...
Definition: schedulernode.h:57
Chain_Node Wait_node
Node to add this scheduler node to Thread_Control::Scheduler::Wait_nodes.
struct _Thread_Control * user
The thread using this node.
The scheduler node is not on the list of pending requests.
Definition: schedulernode.h:51
struct _Thread_Control * owner
The thread owning this node.
Priority Handler API.
SMP sequence lock control.
Definition: smplockseq.h:50
SMP Lock API.
const size_t _Scheduler_Node_size
The size of a scheduler node.
struct Scheduler_Node::@20 Wait
Thread wait support block.
Chain Handler API.
Scheduler node for per-thread data.
Definition: schedulernode.h:79
This header file provides basic definitions used by the API and the implementation.
Scheduler_Node * next
The next pointer for a temporary remove list.
Chain_Node Chain
The node for Thread_Control::Scheduler::Scheduler_nodes.
Definition: schedulernode.h:91
The scheduler node is on the list of pending requests, but nothing should change. ...
Definition: schedulernode.h:69
union Scheduler_Node::@19::@22 Scheduler_node
Node to add this scheduler node to Thread_Control::Scheduler::Scheduler_nodes or a temporary remove l...
Priority_Control value
The thread priority value of this scheduler node.