38#ifndef _RTEMS_SCORE_SCHEDULERNODEIMPL_H
39#define _RTEMS_SCORE_SCHEDULERNODEIMPL_H
56#define SCHEDULER_NODE_OF_WAIT_PRIORITY_NODE( node ) \
57 RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Priority.Node.Node.Chain )
59#define SCHEDULER_NODE_OF_WAIT_PRIORITY( node ) \
60 RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Priority )
65#define SCHEDULER_PRIORITY_MAP( priority ) ( ( priority ) << 1 )
70#define SCHEDULER_PRIORITY_UNMAP( priority ) ( ( priority ) >> 1 )
75#define SCHEDULER_PRIORITY_PURIFY( priority ) \
76 ( ( priority ) & ~( (Priority_Control) PRIORITY_GROUP_LAST ) )
81#define SCHEDULER_PRIORITY_APPEND( priority ) \
82 ( ( priority ) | ( (Priority_Control) PRIORITY_GROUP_LAST ) )
89#define SCHEDULER_PRIORITY_IS_APPEND( priority ) \
90 ( ( ( priority ) & ( (Priority_Control) PRIORITY_GROUP_LAST ) ) != 0 )
103static inline void _Scheduler_Node_do_initialize(
106 Thread_Control *the_thread,
110 node->
owner = the_thread;
112 node->Priority.value = priority;
114#if defined(RTEMS_SMP)
115 _Chain_Initialize_node( &node->Thread.Wait_node );
116 node->Wait.Priority.scheduler = scheduler;
117 node->user = the_thread;
119#if CPU_SIZEOF_POINTER != 8
135static inline void _Scheduler_Node_do_destroy(
142#if defined(RTEMS_SMP) && CPU_SIZEOF_POINTER != 8
156static inline const Scheduler_Control *_Scheduler_Node_get_scheduler(
160 return _Priority_Get_scheduler( &node->Wait.Priority );
170static inline Thread_Control *_Scheduler_Node_get_owner(
190#if defined(RTEMS_SMP) && CPU_SIZEOF_POINTER == 8
191 priority = _Atomic_Fetch_add_ulong(
192 &node->Priority.value,
200 priority = node->Priority.value;
217static inline void _Scheduler_Node_set_priority(
223#if defined(RTEMS_SMP) && CPU_SIZEOF_POINTER == 8
225 &node->Priority.value,
238#if defined(RTEMS_SMP)
246static inline Thread_Control *_Scheduler_Node_get_user(
259static inline void _Scheduler_Node_set_user(
274static inline Thread_Control *_Scheduler_Node_get_idle(
288static inline void _Scheduler_Node_set_idle_user(
293 _Assert( _Scheduler_Node_get_idle( node ) == NULL );
295 _Scheduler_Node_get_owner( node ) == _Scheduler_Node_get_user( node )
298 _Scheduler_Node_set_user( node, idle );
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG and static analysis runs.
Definition assert.h:96
#define _ISR_lock_Release(_lock, _context)
Releases an ISR lock inside an ISR disabled section.
Definition isrlock.h:282
#define _ISR_lock_Acquire(_lock, _context)
Acquires an ISR lock inside an ISR disabled section.
Definition isrlock.h:259
#define _ISR_lock_Destroy(_lock)
Destroys an ISR lock.
Definition isrlock.h:165
#define _ISR_lock_Initialize(_lock, _name)
Initializes an ISR lock.
Definition isrlock.h:150
uint64_t Priority_Control
The thread priority control.
Definition priority.h:91
Priority_Group_order
The priority group order determines if a priority node is inserted as the first or last node into its...
Definition priorityimpl.h:62
This header file provides interfaces of the Scheduler Handler related to scheduler nodes which are us...
This header file provides interfaces of the Priority Handler which are only used by the implementatio...
Local ISR lock context for acquire and release pairs.
Definition isrlock.h:94
Scheduler node for per-thread data.
Definition schedulernode.h:94
struct _Thread_Control * owner
The thread owning this node.
Definition schedulernode.h:138
Scheduler control.
Definition scheduler.h:337