28 #include <rtems/config.h> 37 bool extension_status;
42 #if defined(RTEMS_SMP) 46 size_t scheduler_index;
65 #if defined(RTEMS_SMP) 74 #if defined(RTEMS_SMP) || CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE 77 #
if CPU_ENABLE_ROBUST_THREAD_DISPATCH ==
FALSE 89 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 90 if ( config->
is_fp ) {
100 if ( tls_size > 0 ) {
103 stack_end -= tls_size;
106 ( ( (uintptr_t) stack_end + tls_align - 1 ) & ~( tls_align - 1 ) );
112 stack_end - stack_begin
136 case THREAD_CPU_BUDGET_ALGORITHM_NONE:
137 case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
139 #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) 140 case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
145 #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) 146 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
151 #if defined(RTEMS_SMP) 152 scheduler_node = NULL;
160 if ( scheduler_for_index == config->
scheduler ) {
161 priority_for_index = config->
priority;
162 scheduler_node = scheduler_node_for_index;
176 scheduler_node_for_index,
182 ++scheduler_for_index;
186 _Assert( scheduler_node != NULL );
208 &scheduler_node->
Wait.Priority,
212 #if defined(RTEMS_SMP) 223 _SMP_lock_Stats_initialize( &the_thread->Potpourri_stats,
"Thread Potpourri" );
224 _SMP_lock_Stats_initialize( &the_thread->
Join_queue.Lock_stats,
"Thread State" );
255 if ( extension_status )
258 #if defined(RTEMS_SMP) 259 while ( scheduler_index > 0 ) {
262 --scheduler_for_index;
267 if ( scheduler_index > 0 ) {
274 the_thread->
Wait.spare_heads
277 #if defined(RTEMS_SMP) || CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE Thread-Local Storage (TLS)
const struct _Scheduler_Control * home_scheduler
The home scheduler of this thread.
Thread_CPU_budget_algorithms budget_algorithm
The thread's budget algorithm.
static __inline__ void _Priority_Initialize_one(Priority_Aggregation *aggregation, Priority_Node *node)
Initializes the priority aggregation with the given information.
static __inline__ void _Thread_Action_control_initialize(Thread_Action_control *action_control)
Initializes the control chain of the action control.
uintptr_t _TLS_Get_allocation_size(void)
Return the TLS area allocation size.
#define rtems_configuration_get_ticks_per_timeslice()
Returns the clock ticks per timeslice configured for this application.
uint64_t Priority_Control
The thread priority control.
static __inline__ void _Stack_Initialize(Stack_Control *the_stack, void *starting_address, size_t size)
Initializes stack with the given starting address and size.
#define CONTEXT_FP_SIZE
Size of floating point context area.
Thread_Wait_information Wait
static __inline__ const bool _SMP_Need_inter_processor_interrupts(void)
Indicate if inter-processor interrupts are needed.
Inlined Routines in the Watchdog Handler.
static __inline__ Priority_Control _Scheduler_Map_priority(const Scheduler_Control *scheduler, Priority_Control priority)
Maps a thread priority from the user domain to the scheduler domain.
Thread_Start_information Start
static __inline__ const Processor_mask * _SMP_Get_online_processors(void)
Gets all online processors.
Inlined Routines Associated with the Manipulation of the Scheduler.
This header file defines parts of the application configuration information API.
static __inline__ void _RBTree_Initialize_empty(RBTree_Control *the_rbtree)
Initializes this RBTree as empty.
size_t destination_offset
Offset of the pointer field in Thread_Control referencing an application configuration dependent memo...
Thread_Keys_information Keys
The POSIX Keys information.
static __inline__ void _Scheduler_Node_initialize(const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
Initializes a scheduler node.
Thread_Scheduler_control Scheduler
Scheduler related control.
User Extension Handler API.
struct Scheduler_Node::@19 Thread
Block to register and manage this scheduler node in the thread control block of the owner of this sch...
static bool _User_extensions_Thread_create(Thread_Control *created)
Creates a thread.
static __inline__ void _Thread_Timer_initialize(Thread_Timer_information *timer, Per_CPU_Control *cpu)
Initializes the thread timer.
bool _Thread_Initialize(Thread_Information *information, Thread_Control *the_thread, const Thread_Configuration *config)
Initializes thread.
Inlined Routines from the Stack Handler.
Objects_Name name
Name of the object for the thread.
static __inline__ void * _Freechain_Pop(Freechain_Control *freechain)
Pops a node from the freechain.
const size_t _Thread_Control_add_on_count
Thread control add-on count.
const Thread_Control_add_on _Thread_Control_add_ons[]
Thread control add-ons.
Chain_Node Wait_node
Node to add this scheduler node to Thread_Control::Scheduler::Wait_nodes.
char _TLS_Alignment[]
The TLS section alignment.
Processor_mask Affinity
The thread processor affinity set.
static __inline__ void _Thread_queue_Gate_open(Thread_queue_Gate *gate)
Opens the gate.
size_t source_offset
Offset relative to the thread control block begin to an application configuration dependent memory ar...
This thread is blocked with respect to the scheduler.
static __inline__ void _Objects_Open(Objects_Information *information, Objects_Control *the_object, Objects_Name name)
Places the_object control pointer and object name in the Local Pointer and Local Name Tables...
Priority_Control priority
The new thread's priority.
const struct _Scheduler_Control * scheduler
The scheduler control instance for the thread.
static __inline__ Scheduler_Node * _Thread_Scheduler_get_home_node(const Thread_Control *the_thread)
Gets the scheduler's home node.
Priority_Control maximum_priority
The maximum priority value of this scheduler.
The configuration of a new thread to initialize.
static __inline__ void _Thread_Set_CPU(Thread_Control *thread, Per_CPU_Control *cpu)
Sets the cpu of the thread's scheduler.
size_t stack_size
The size of the stack area in bytes.
Thread_CPU_budget_algorithm_callout budget_callout
The thread's initial budget callout.
States_Control current_state
#define RTEMS_STATIC_ASSERT(_cond, _msg)
Asserts at compile time that the specified condition is satisfied.
const Scheduler_Control _Scheduler_Table[]
This table contains the configured schedulers.
static __inline__ void _Thread_queue_Heads_initialize(Thread_queue_Heads *heads)
Initializes the thread queue heads.
static __inline__ bool _Scheduler_Is_non_preempt_mode_supported(const Scheduler_Control *scheduler)
Indicate if the thread non-preempt mode is supported by the scheduler.
const size_t _Scheduler_Node_size
The size of a scheduler node.
Chain_Control Scheduler_nodes
Scheduler nodes immediately available to the schedulers for this thread.
static __inline__ void _Chain_Initialize_one(Chain_Control *the_chain, Chain_Node *the_node)
Initializes this chain to contain exactly the specified node.
struct Scheduler_Node::@20 Wait
Thread wait support block.
static void __inline__ _Freechain_Push(Freechain_Control *freechain, void *node)
Pushes a node back to the freechain.
bool is_fp
Indicates whether the thread needs a floating-point area.
static __inline__ void _RBTree_Initialize_node(RBTree_Node *the_node)
Initializes a red-black tree node.
void * stack_area
The starting address of the stack area.
Thread_queue_Control Join_queue
Thread queue for thread join operations and multi-purpose lock.
const size_t _Scheduler_Count
This constant contains the count of configured schedulers.
Scheduler node for per-thread data.
Inlined Routines from the Thread Handler.
#define _ISR_lock_Initialize(_lock, _name)
Initializes an ISR lock.
bool is_preemptible
Indicates whether the new thread is preemptible.
#define THREAD_WAIT_FLAGS_INITIAL
The initial thread wait flags value set by _Thread_Initialize().
#define FALSE
If FALSE is undefined, then FALSE is defined to 0.
RBTree_Node Registry_node
Node to register this link in the global thread queue links lookup tree.
Chain_Control Wait_nodes
Scheduler nodes immediately available to the thread by its home scheduler and due to thread queue own...
Scheduler_Node * nodes
The scheduler nodes of this thread.
RTEMS_INLINE_ROUTINE void _Processor_mask_Assign(Processor_mask *dst, const Processor_mask *src)
Copies the mask to another mask, also considers CPU_MAXIMUM_PROCESSORS.
ISR_lock_Control Lock
Lock to protect the scheduler node change requests.
uint32_t isr_level
The thread's initial ISR level.
Priority_Node Real_priority
The base priority of this thread in its home scheduler instance.
static __inline__ void _Scheduler_Node_destroy(const Scheduler_Control *scheduler, Scheduler_Node *node)
Destroys a scheduler node.
union Scheduler_Node::@19::@22 Scheduler_node
Node to add this scheduler node to Thread_Control::Scheduler::Scheduler_nodes or a temporary remove l...
void(* stack_free)(void *)
This member contains the handler to free the stack.
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.
static __inline__ void _Priority_Node_initialize(Priority_Node *node, Priority_Control priority)
Initializes the priority node to the given priority.
Thread_Timer_information Timer