23 #ifndef _RTEMS_SCORE_THREAD_H 24 #define _RTEMS_SCORE_THREAD_H 28 #if defined(RTEMS_MULTIPROCESSING) 42 #if defined(RTEMS_SMP) 46 struct rtems_user_env_t;
48 struct _pthread_cleanup_context;
80 #define RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE 86 #define RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT 88 #if defined(RTEMS_DEBUG) 89 #define RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT 107 void *( *entry )( uintptr_t argument );
123 void *( *entry )(
void *argument );
159 THREAD_CPU_BUDGET_ALGORITHM_NONE,
160 THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE,
161 #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) 162 THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE,
164 #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) 165 THREAD_CPU_BUDGET_ALGORITHM_CALLOUT
199 void ( *stack_free )(
void * );
202 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 210 #if defined(RTEMS_SMP) 244 #if defined(RTEMS_SMP) 365 void *mutable_object;
366 const void *immutable_object;
392 #if defined(RTEMS_MULTIPROCESSING) 419 #if defined(RTEMS_SMP) 425 #if defined(RTEMS_SMP) 529 #if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT) 531 uint32_t resource_count;
543 #if defined(RTEMS_MULTIPROCESSING) 551 Thread_queue_MP_callout thread_queue_callout;
590 #define THREAD_API_FIRST THREAD_API_RTEMS 593 #define THREAD_API_LAST THREAD_API_POSIX 673 THREAD_LIFE_PROTECTED = 0x1,
674 THREAD_LIFE_RESTARTING = 0x2,
675 THREAD_LIFE_TERMINATING = 0x4,
676 THREAD_LIFE_CHANGE_DEFERRED = 0x8,
677 THREAD_LIFE_DETACHED = 0x10
756 #if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT) 758 uint32_t resource_count;
770 #if defined(RTEMS_MULTIPROCESSING) 776 #if defined(RTEMS_SMP) && defined(RTEMS_PROFILING) 785 SMP_lock_Stats Potpourri_stats;
790 #if defined(RTEMS_MULTIPROCESSING) 831 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 887 rtems_per_thread_routine routine
946 #define THREAD_DEFAULT_MAXIMUM_NAME_SIZE 16 980 #if defined(RTEMS_SMP) 991 #if defined(RTEMS_SMP) 994 #define _Thread_queue_Heads_size sizeof(Thread_queue_Heads) 1023 } Thread_queue_heads;
1031 #define THREAD_INFORMATION_DEFINE_ZERO( name, api, cls ) \ 1032 Thread_Information name##_Information = { \ 1034 _Objects_Build_id( api, cls, 1, 0 ), \ 1036 _Objects_Allocate_none, \ 1042 CHAIN_INITIALIZER_EMPTY( name##_Information.Objects.Inactive ), \ 1046 OBJECTS_INFORMATION_MP( name##_Information.Objects, NULL ), \ 1060 #define THREAD_INFORMATION_DEFINE( name, api, cls, max ) \ 1061 static Objects_Control * \ 1062 name##_Local_table[ _Objects_Maximum_per_allocation( max ) ]; \ 1063 static Thread_Configured_control \ 1064 name##_Objects[ _Objects_Maximum_per_allocation( max ) ]; \ 1065 static Thread_queue_Configured_heads \ 1066 name##_Heads[ _Objects_Maximum_per_allocation( max ) ]; \ 1067 Thread_Information name##_Information = { \ 1069 _Objects_Build_id( api, cls, 1, _Objects_Maximum_per_allocation( max ) ), \ 1070 name##_Local_table, \ 1071 _Objects_Is_unlimited( max ) ? \ 1072 _Thread_Allocate_unlimited : _Objects_Allocate_static, \ 1073 _Objects_Is_unlimited( max ) ? \ 1074 _Objects_Free_unlimited : _Objects_Free_static, \ 1076 _Objects_Is_unlimited( max ) ? _Objects_Maximum_per_allocation( max ) : 0, \ 1077 sizeof( Thread_Configured_control ), \ 1078 OBJECTS_NO_STRING_NAME, \ 1079 CHAIN_INITIALIZER_EMPTY( name##_Information.Objects.Inactive ), \ 1082 &name##_Objects[ 0 ].Control.Object \ 1083 OBJECTS_INFORMATION_MP( name##_Information.Objects, NULL ) \ 1085 &name##_Heads[ 0 ] \ 1096 #if defined(RTEMS_MULTIPROCESSING) 1103 typedef struct Thread_Configured_proxy_control Thread_Configured_proxy_control;
1110 extern Thread_Configured_proxy_control *
const _Thread_MP_Proxies;
Objects_Control * _Thread_Allocate_unlimited(Objects_Information *information)
Return an inactive thread object or NULL.
const struct _Scheduler_Control * home_scheduler
The home scheduler of this thread.
Timestamp_Control cpu_time_used
Thread_Life_state state
The current thread life state.
int64_t Timestamp_Control
Thread_CPU_budget_algorithm_callout budget_callout
Thread_Wait_information Wait
Information About Each Thread's Context.
uint64_t Priority_Control
The thread priority control.
Data for thread entry with one pointer argument and a pointer return value.
Thread_Life_state
Thread life states.
Thread_Wait_information Wait
The priority node to build up a priority aggregation.
Data for idle thread entry.
Thread entry information.
uint32_t pending_life_change_requests
The count of pending life change requests.
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) RTEMS_DEPRECATED
Deprecated, use rtems_task_iterate() instead.
A thread queue link from one thread to another specified by the thread queue owner and thread wait qu...
struct Per_CPU_Control * cpu
The processor assigned by the current scheduler.
Thread_Start_information Start
Thread_queue_Control Join_queue
The control block used to manage each watchdog timer.
const size_t _Thread_Maximum_TLS_size
If this constant is greater than zero, then it defines the maximum thread-local storage size...
size_t destination_offset
Offset of the pointer field in Thread_Control referencing an application configuration dependent memo...
Helpers for Manipulating Timestamps.
Thread Execution State Information.
Thread_Keys_information Keys
The POSIX Keys information.
This thread is scheduled with respect to the scheduler.
Chain iterator for dynamic user extensions.
This thread is ready with respect to the scheduler.
CPU_Uint32ptr Thread_Entry_numeric_type
Type of the numeric argument of a thread entry function with at least one numeric argument...
Thread_Scheduler_control Scheduler
Scheduler related control.
struct _pthread_cleanup_context * last_cleanup_context
LIFO list of POSIX cleanup contexts.
Thread_Timer_information Timer
Constants and Structures Associated with Watchdog Timers.
Constants and Structures Needed to Declare a Thread Queue.
Scheduler_Node * requests
List of pending scheduler node requests.
struct User_extensions_Iterator * last_user_extensions_iterator
LIFO list of user extensions iterators.
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.
Object Handler Data Structures.
struct _reent * libc_reent
struct rtems_user_env_t * user_environment
Pointer to an optional thread-specific POSIX user environment.
size_t helping_nodes
Count of nodes scheduler nodes minus one.
bool was_created_with_inherited_scheduler
True, if the thread was created with an inherited scheduler (PTHREAD_INHERIT_SCHED), and false otherwise.
Processor_mask Affinity
The thread processor affinity set.
size_t source_offset
Offset relative to the thread control block begin to an application configuration dependent memory ar...
Thread_CPU_budget_algorithms budget_algorithm
This thread is blocked with respect to the scheduler.
#define RTEMS_ZERO_LENGTH_ARRAY
This is a constant to declare zero-length arrays.
unsigned int Thread_Wait_flags
This type is able to contain several flags used to control the wait class and state of a thread...
int pin_level
The thread pinning to current processor level.
#define ISR_LOCK_MEMBER(_designator)
Defines an ISR lock member.
Control block to manage thread actions.
Thread_Scheduler_state
The thread state with respect to the scheduler.
Specification for the Packet Handler.
States_Control current_state
Chain_Node Help_node
Node for the Per_CPU_Control::Threads_in_need_for_help chain.
Thread_Scheduler_state state
The current scheduler state of this thread.
Thread_CPU_budget_algorithms
void * exit_value
The thread exit value.
const struct _Scheduler_Control * pinned_scheduler
The pinned scheduler of this thread.
struct Thread_queue_Configured_heads Thread_queue_Configured_heads
The configured thread queue heads.
void * API_Extensions[THREAD_API_LAST+1]
Chain_Control Scheduler_nodes
Scheduler nodes immediately available to the schedulers for this thread.
#define RTEMS_DEPRECATED
Instructs the compiler in a declaration to issue a warning whenever a variable, function, or type using this declaration will be used.
States_Control current_state
Data for thread entry with one numeric argument and no return value.
Thread scheduler control.
void(* Thread_CPU_budget_algorithm_callout)(Thread_Control *)
const size_t _Thread_queue_Heads_size
Size of the thread queue heads of a particular application.
Priority_Node Real_priority
The base priority of this thread in its home scheduler instance.
Thread_queue_Control Join_queue
Thread queue for thread join operations and multi-purpose lock.
Scheduler node for per-thread data.
void * extensions[RTEMS_ZERO_LENGTH_ARRAY]
Variable length array of user extension pointers.
The thread queue gate is an SMP synchronization means.
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.
Local ISR lock context for acquire and release pairs.
Thread_Action Action
Thread life action used to react upon thread restart and delete requests.
ISR_lock_Control Lock
Lock to protect the scheduler node change requests.
Context_Control Registers
Thread_Information _Thread_Information
The internal thread objects information.
Thread_Life_control Life
Thread life-cycle control.
Priority_Node Real_priority
The base priority of this thread in its home scheduler instance.
void(* Thread_Action_handler)(Thread_Control *the_thread, Thread_Action *action, ISR_lock_Context *lock_context)
Thread action handler.
Information About the Thread Stack Handler.
char _Thread_Idle_stacks[]
The idle thread stacks.
Thread_Scheduler_control Scheduler
Scheduler related control.
struct Thread_Configured_control Thread_Configured_control
The configured thread control block.
const size_t _Thread_Initial_thread_count
Count of configured threads.
Thread_Timer_information Timer
const size_t _Thread_Maximum_name_size
Maximum size of a thread name in characters (including the terminating '\0' character).