21 #ifndef _RTEMS_SCORE_THREAD_H 22 #define _RTEMS_SCORE_THREAD_H 26 #if defined(RTEMS_MULTIPROCESSING) 38 #if defined(RTEMS_SMP) 69 #if defined(RTEMS_POSIX_API) 70 #define RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE 77 #define RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT 79 #if defined(RTEMS_POSIX_API) 80 #define RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API 120 THREAD_START_NUMERIC,
121 THREAD_START_POINTER,
122 #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) 123 THREAD_START_BOTH_POINTER_FIRST,
124 THREAD_START_BOTH_NUMERIC_FIRST
160 THREAD_CPU_BUDGET_ALGORITHM_NONE,
161 THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE,
162 #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) 163 THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE,
165 #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) 166 THREAD_CPU_BUDGET_ALGORITHM_CALLOUT
175 #if !defined(RTEMS_SMP) 181 struct rtems_task_variable_tt;
190 struct rtems_task_variable_tt *
next;
200 void (*dtor)(
void *);
232 #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) 234 bool core_allocated_stack;
238 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 259 void *mutable_object;
260 const void *immutable_object;
338 #if defined(RTEMS_SMP) 409 #if defined(RTEMS_MULTIPROCESSING) 433 #define THREAD_API_FIRST THREAD_API_RTEMS 436 #define THREAD_API_LAST THREAD_API_POSIX 502 THREAD_LIFE_NORMAL = 0x0,
503 THREAD_LIFE_PROTECTED = 0x1,
504 THREAD_LIFE_RESTARTING = 0x2,
505 THREAD_LIFE_PROTECTED_RESTARTING = 0x3,
506 THREAD_LIFE_TERMINATING = 0x4,
507 THREAD_LIFE_PROTECTED_TERMINATING = 0x5,
508 THREAD_LIFE_RESTARTING_TERMINATING = 0x6,
509 THREAD_LIFE_PROTECTED_RESTARTING_TERMINATING = 0x7
537 #if defined(RTEMS_SMP) 547 THREAD_SCHEDULER_BLOCKED,
556 THREAD_SCHEDULER_SCHEDULED,
563 THREAD_SCHEDULER_READY
564 } Thread_Scheduler_state;
571 #if defined(RTEMS_SMP) 575 Thread_Scheduler_state state;
611 #if defined(RTEMS_SMP) 617 #if defined(RTEMS_DEBUG) 632 #if defined(RTEMS_SMP) 664 Atomic_Uint generation;
665 } Thread_Lock_control;
718 #if defined(RTEMS_MULTIPROCESSING) 724 #if defined(RTEMS_SMP) 728 Thread_Lock_control Lock;
731 #ifdef __RTEMS_STRICT_ORDER_MUTEX__ 737 #if defined(RTEMS_SMP) 744 #if defined(RTEMS_MULTIPROCESSING) 788 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 799 #if !defined(RTEMS_SMP) 827 void *extensions[ RTEMS_ZERO_LENGTH_ARRAY ];
830 #if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE) void(* Thread_Action_handler)(Thread_Control *thread, Thread_Action *action, struct Per_CPU_Control *cpu, ISR_Level level)
Thread action handler.
Definition: thread.h:456
Constants and Structures Associated with the Object Handler.
const size_t _Thread_Control_add_on_count
Thread control add-on count.
void * _Thread_Idle_body(uintptr_t ignored)
This routine is the body of the system idle thread.
Thread Priority Manipulation Routines.
This is used to manage each element (node) which is placed on a chain.
Definition: chain.h:65
uintptr_t CPU_Uint32ptr
Type that can store a 32-bit integer or a pointer.
Definition: types.h:41
The following record contains the prefix for every packet passed between nodes in an MP system...
Definition: mppkt.h:80
Chain_Node Active
This field is used to manage the set of proxies in the system.
Definition: thread.h:415
Thread_Life_state state
The current thread life state.
Definition: thread.h:525
Thread(* Thread_Entry_both_pointer_first)(void *, Thread_Entry_numeric_type)
This type corresponds to a thread entry point which takes a single untyped pointer and an unsigned th...
Definition: thread.h:144
Thread_Wait_information Wait
This field is the blocking information for this proxy.
Definition: thread.h:406
Scheduler control.
Definition: scheduler.h:192
The following defines the Object Control Block used to manage each object local to this node...
Definition: object.h:232
Priority_Control current_priority
This field is the current priority state of this thread.
Definition: thread.h:683
Information About Each Thread's Context.
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
Iterates over all threads.
Definition: iterateoverthreads.c:24
Thread_CPU_budget_algorithm_callout budget_callout
This field is the method invoked with the budgeted time is consumed.
Definition: thread.h:773
This defines the minimal set of integer and processor state registers that must be saved during a vol...
Definition: cpu.h:248
Thread_Start_information Start
This field contains information about the starting state of this thread.
Definition: thread.h:782
void ** ptr
This field points to the physical memory location of this per task variable.
Definition: thread.h:194
uint32_t cpu_time_budget
This field is the length of the time quantum that this thread is allowed to consume.
Definition: thread.h:766
Information About the CPU Set.
void * gval
This field is to the global value for this per task variable.
Definition: thread.h:196
Thread_CPU_budget_algorithms budget_algorithm
This field is the algorithm used to manage this thread's time quantum.
Definition: thread.h:771
The control block used to manage each watchdog timer.
Definition: watchdog.h:98
Priority_Control real_priority
This field is the base priority of this thread.
Definition: thread.h:381
This is used to manage a chain.
Definition: chain.h:83
size_t destination_offset
Offset of the pointer field in Thread_Control referencing an application configuration dependent memo...
Definition: thread.h:863
Helpers for Manipulating Timestamps.
Thread Execution State Information.
This is the structure used to manage sets of tasks which are blocked waiting to acquire a resource...
Definition: threadq.h:171
This value is for the Classic RTEMS API.
Definition: thread.h:427
Constants and Structures Associated with Watchdog Timers.
bool priority_restore_hint
Hints if a priority restore is necessary once the resource count changes from one to zero...
Definition: thread.h:710
Constants and Structures Needed to Declare a Thread Queue.
Thread_Control * terminator
The terminator thread of this thread.
Definition: thread.h:534
ISR lock control.
Definition: isrlock.h:56
Resource node to reflect ownership of resources and a dependency on a resource.
Definition: resource.h:150
void(* rtems_per_thread_routine)(Thread_Control *)
This defines the type for a method which operates on a single thread.
Definition: thread.h:843
Thread(* Thread_Entry)(void)
This type corresponds to a very simple style thread entry point.
Definition: thread.h:129
uint32_t resource_count
This field is the number of mutexes currently held by this proxy.
Definition: thread.h:403
Thread queue operations.
Definition: threadq.h:118
bool priority_restore_hint
Hints if a priority restore is necessary once the resource count changes from one to zero...
Definition: thread.h:400
Thread_CPU_usage_t cpu_time_used
This field is the amount of CPU time consumed by this thread since it was created.
Definition: thread.h:777
uint32_t Priority_Control
The following type defines the control block used to manage thread priorities.
Definition: priority.h:56
Thread_Scheduler_control Scheduler
Scheduler related control.
Definition: thread.h:756
struct rtems_task_variable_tt * next
This field points to the next per task variable for this task.
Definition: thread.h:190
size_t source_offset
Offset relative to the thread control block begin to an application configuration dependent memory ar...
Definition: thread.h:869
uint32_t priority_generation
Generation of the current priority value.
Definition: thread.h:389
void(* Thread_CPU_budget_algorithm_callout)(Thread_Control *)
This defines thes the entry point for the thread specific timeslice budget management algorithm...
Definition: thread.h:173
Objects_Control Object
This field is the object management structure for each thread.
Definition: thread.h:673
uint32_t ISR_Level
The following type defines the control block used to manage the interrupt level portion of the status...
Definition: isrlevel.h:42
Control block to manage thread actions.
Definition: thread.h:490
Thread(* Thread_Entry_both_numeric_first)(Thread_Entry_numeric_type, void *)
This type corresponds to a thread entry point which takes a single unsigned thirty-two bit integer an...
Definition: thread.h:150
struct Scheduler_Node * node
The scheduler node of this thread.
Definition: thread.h:609
This structure defines the Thread Control Block (TCB).
Definition: thread.h:671
bool is_fp
This field is true if the thread uses the floating point unit.
Definition: thread.h:751
Per CPU Core Structure.
Definition: percpu.h:233
Thread control add-on.
Definition: thread.h:857
Thread action.
Definition: thread.h:480
struct _reent * libc_reent
This field points to the newlib reentrancy structure for this thread.
Definition: thread.h:795
Thread_Life_state
Thread life states.
Definition: thread.h:501
Thread_Start_types
The following defines the ways in which the entry point for a thread can be invoked.
Definition: thread.h:119
uint32_t resource_count
This field is the number of mutexes currently held by this thread.
Definition: thread.h:713
Context_Control_fp * fp_context
This field points to the floating point context for this thread.
Definition: thread.h:792
Specification for the Packet Handler.
Thread_Life_control Life
Thread life-cycle control.
Definition: thread.h:818
Priority_Control real_priority
This field is the base priority of this thread.
Definition: thread.h:691
uint32_t priority_generation
Generation of the current priority value.
Definition: thread.h:699
This defines the complete set of floating point registers that must be saved during any context switc...
Definition: cpu.h:294
Thread(* Thread_Entry_pointer)(void *)
This type corresponds to a thread entry point which takes a single untyped pointer as an argument...
Definition: thread.h:139
Watchdog_Control Timer
This field is the Watchdog used to manage proxy delays and timeouts.
Definition: thread.h:408
States_Control current_state
This field is the current execution state of this thread.
Definition: thread.h:675
struct bintime Timestamp_Control
Define the Timestamp control type.
Definition: timestamp.h:55
SCORE_EXTERN void * rtems_ada_self
Self for the GNU Ada Run-Time.
Definition: threadimpl.h:55
This value is for the POSIX API.
Definition: thread.h:429
uint32_t States_Control
The following type defines the control block used to manage a thread's state.
Definition: states.h:41
void * tval
This field is to this thread's value for this per task variable.
Definition: thread.h:198
States_Control current_state
This field is the current execution state of this proxy.
Definition: thread.h:365
Thread scheduler control.
Definition: thread.h:570
Context_Control Registers
This field contains the context of this thread.
Definition: thread.h:787
CPU_Uint32ptr Thread_Entry_numeric_type
Type of the numeric argument of a thread entry function with at least one numeric argument...
Definition: thread.h:110
Watchdog_Control Timer
This field is the Watchdog used to manage thread delays and timeouts.
Definition: thread.h:717
Scheduler node for per-thread data.
Definition: scheduler.h:281
Chain_Control Key_Chain
This is the thread key value chain's control, which is used to track all key value for specific threa...
Definition: thread.h:811
The following defines the control block used to manage each thread proxy.
Definition: thread.h:361
The following defines the control block used to manage each stack.
Definition: stack.h:48
Objects_Control Object
This field is the object management structure for each proxy.
Definition: thread.h:363
Thread_APIs
The following record defines the control block used to manage each thread.
Definition: thread.h:425
const size_t _Thread_Control_size
Size of the thread control block of a particular application.
Thread life control.
Definition: thread.h:515
Thread_Action Action
Thread life action used to react upon thread restart and delete requests.
Definition: thread.h:520
uint32_t Objects_Id
The following type defines the control block used to manage object IDs.
Definition: object.h:122
void * Thread
The following defines the "return type" of a thread.
Definition: thread.h:99
const Thread_Control_add_on _Thread_Control_add_ons[]
Thread control add-ons.
Thread(* Thread_Entry_numeric)(Thread_Entry_numeric_type)
This type corresponds to a thread entry point which takes a single unsigned thirty-two bit integer as...
Definition: thread.h:134
This is used to manage each element (node) which is placed on a RBT.
Definition: rbtree.h:75
Information About the Thread Stack Handler.
Thread_Wait_information Wait
This field is the blocking information for this thread.
Definition: thread.h:715
rtems_task_variable_t * task_variables
This field points to the set of per task variables.
Definition: thread.h:801
Priority_Control current_priority
This field is the current priority state of this thread.
Definition: thread.h:373
bool is_preemptible
This field is true if the thread is preemptible.
Definition: thread.h:749
Thread_CPU_budget_algorithms
The following lists the algorithms used to manage the thread cpu budget.
Definition: thread.h:159
#define THREAD_API_LAST
This macro defines the last API which has threads.
Definition: thread.h:436
unsigned int Thread_Wait_flags
This type is able to contain several flags used to control the wait class and state of a thread...
Definition: thread.h:277
Internal structure used to manager per task variables.
Definition: thread.h:188