23 #ifndef _RTEMS_SCORE_THREAD_H 24 #define _RTEMS_SCORE_THREAD_H 28 #if defined(RTEMS_MULTIPROCESSING) 42 #if defined(RTEMS_SMP) 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 96 typedef void *Thread RTEMS_DEPRECATED;
113 void *( *entry )( uintptr_t argument );
129 void *( *entry )(
void *argument );
165 THREAD_CPU_BUDGET_ALGORITHM_NONE,
166 THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE,
167 #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) 168 THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE,
170 #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) 171 THREAD_CPU_BUDGET_ALGORITHM_CALLOUT
209 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 217 #if defined(RTEMS_SMP) 227 THREAD_SCHEDULER_BLOCKED,
236 THREAD_SCHEDULER_SCHEDULED,
243 THREAD_SCHEDULER_READY
244 } Thread_Scheduler_state;
251 #if defined(RTEMS_SMP) 260 Thread_Scheduler_state state;
316 size_t helping_nodes;
350 Processor_mask Affinity;
372 void *mutable_object;
373 const void *immutable_object;
399 #if defined(RTEMS_MULTIPROCESSING) 426 #if defined(RTEMS_SMP) 432 #if defined(RTEMS_SMP) 471 Thread_queue_Gate Tranquilizer;
478 Thread_queue_Link Link;
536 #if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT) 538 uint32_t resource_count;
550 #if defined(RTEMS_MULTIPROCESSING) 558 Thread_queue_MP_callout thread_queue_callout;
597 #define THREAD_API_FIRST THREAD_API_RTEMS 600 #define THREAD_API_LAST THREAD_API_POSIX 680 THREAD_LIFE_PROTECTED = 0x1,
681 THREAD_LIFE_RESTARTING = 0x2,
682 THREAD_LIFE_TERMINATING = 0x4,
683 THREAD_LIFE_CHANGE_DEFERRED = 0x8,
684 THREAD_LIFE_DETACHED = 0x10
763 #if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT) 765 uint32_t resource_count;
777 #if defined(RTEMS_MULTIPROCESSING) 783 #if defined(RTEMS_SMP) && defined(RTEMS_PROFILING) 792 SMP_lock_Stats Potpourri_stats;
797 #if defined(RTEMS_MULTIPROCESSING) 838 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 894 rtems_per_thread_routine routine
953 #define THREAD_DEFAULT_MAXIMUM_NAME_SIZE 16 977 #if defined(RTEMS_SMP) 988 #if defined(RTEMS_SMP) 991 #define _Thread_queue_Heads_size sizeof(Thread_queue_Heads) 1020 } Thread_queue_heads;
1028 #define THREAD_INFORMATION_DEFINE_ZERO( name, api, cls ) \ 1029 Thread_Information name##_Information = { \ 1031 _Objects_Build_id( api, cls, 1, 0 ), \ 1033 _Objects_Allocate_none, \ 1039 CHAIN_INITIALIZER_EMPTY( name##_Information.Objects.Inactive ), \ 1043 OBJECTS_INFORMATION_MP( name##_Information.Objects, NULL ), \ 1057 #define THREAD_INFORMATION_DEFINE( name, api, cls, max ) \ 1058 static Objects_Control * \ 1059 name##_Local_table[ _Objects_Maximum_per_allocation( max ) ]; \ 1060 static Thread_Configured_control \ 1061 name##_Objects[ _Objects_Maximum_per_allocation( max ) ]; \ 1062 static Thread_queue_Configured_heads \ 1063 name##_Heads[ _Objects_Maximum_per_allocation( max ) ]; \ 1064 Thread_Information name##_Information = { \ 1066 _Objects_Build_id( api, cls, 1, _Objects_Maximum_per_allocation( max ) ), \ 1067 name##_Local_table, \ 1068 _Objects_Is_unlimited( max ) ? \ 1069 _Thread_Allocate_unlimited : _Objects_Allocate_static, \ 1070 _Objects_Is_unlimited( max ) ? \ 1071 _Objects_Free_unlimited : _Objects_Free_static, \ 1073 _Objects_Is_unlimited( max ) ? _Objects_Maximum_per_allocation( max ) : 0, \ 1074 sizeof( Thread_Configured_control ), \ 1075 OBJECTS_NO_STRING_NAME, \ 1076 CHAIN_INITIALIZER_EMPTY( name##_Information.Objects.Inactive ), \ 1079 &name##_Objects[ 0 ].Control.Object \ 1080 OBJECTS_INFORMATION_MP( name##_Information.Objects, NULL ) \ 1082 &name##_Heads[ 0 ] \ 1093 #if defined(RTEMS_MULTIPROCESSING) 1100 typedef struct Thread_Configured_proxy_control Thread_Configured_proxy_control;
1107 extern Thread_Configured_proxy_control *
const _Thread_MP_Proxies;
Objects_Control * _Thread_Allocate_unlimited(Objects_Information *information)
Return an inactive thread object or NULL.
Definition: threadallocateunlimited.c:66
Timestamp_Control cpu_time_used
Definition: thread.h:827
Thread_Life_state state
The current thread life state.
Definition: thread.h:700
int64_t Timestamp_Control
Definition: timestamp.h:57
Thread_CPU_budget_algorithm_callout budget_callout
Definition: thread.h:823
Thread_Wait_information Wait
Definition: thread.h:547
Information About the Thread Stack Handler.
Definition: objectdata.h:39
Information About Each Thread's Context.
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:70
Data for thread entry with one pointer argument and a pointer return value.
Definition: thread.h:128
bool is_preemptible
Definition: thread.h:802
Thread_Life_state
Thread life states.
Definition: thread.h:679
Thread_Wait_information Wait
Definition: thread.h:774
The priority node to build up a priority aggregation.
Definition: priority.h:98
Data for idle thread entry.
Definition: thread.h:112
Thread entry information.
Definition: thread.h:136
Thread register context.
Definition: cpu.h:194
uint32_t pending_life_change_requests
The count of pending life change requests.
Definition: thread.h:705
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) RTEMS_DEPRECATED
Deprecated, use rtems_task_iterate() instead.
Definition: iterateoverthreads.c:36
Thread_Start_information Start
Definition: thread.h:832
Thread_queue_Control Join_queue
Definition: thread.h:526
The control block used to manage each watchdog timer.
Definition: watchdog.h:90
size_t destination_offset
Offset of the pointer field in Thread_Control referencing an application configuration dependent memo...
Definition: thread.h:906
Helpers for Manipulating Timestamps.
Thread Execution State Information.
Thread_Keys_information Keys
The POSIX Keys information.
Definition: thread.h:852
Chain iterator for dynamic user extensions.
Definition: userextimpl.h:46
Definition: threadq.h:552
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:107
Thread_Scheduler_control Scheduler
Scheduler related control.
Definition: thread.h:771
struct _pthread_cleanup_context * last_cleanup_context
LIFO list of POSIX cleanup contexts.
Definition: thread.h:871
Thread_Timer_information Timer
Definition: thread.h:549
Red-black tree node.
Definition: rbtree.h:55
Constants and Structures Needed to Declare a Thread Queue.
Context_Control_fp * fp_context
Definition: thread.h:842
Definition: threadq.h:402
ISR lock control.
Definition: isrlock.h:56
#define _Thread_queue_Heads_size
Size of the thread queue heads of a particular application.
Definition: thread.h:991
bool is_fp
Definition: thread.h:804
struct User_extensions_Iterator * last_user_extensions_iterator
LIFO list of user extensions iterators.
Definition: thread.h:876
uint32_t States_Control
Definition: states.h:46
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.
Thread queue operations.
Definition: threadq.h:517
Object Handler Data Structures.
struct _reent * libc_reent
Definition: thread.h:845
struct rtems_user_env_t * user_environment
Pointer to an optional thread-specific POSIX user environment.
Definition: thread.h:866
bool was_created_with_inherited_scheduler
True, if the thread was created with an inherited scheduler (PTHREAD_INHERIT_SCHED),...
Definition: thread.h:810
Thread queue heads.
Definition: threadq.h:360
Thread_APIs
Definition: thread.h:589
User environment.
Definition: userenv.h:61
size_t source_offset
Offset relative to the thread control block begin to an application configuration dependent memory ar...
Definition: thread.h:912
Thread_CPU_budget_algorithms budget_algorithm
Definition: thread.h:821
#define THREAD_API_LAST
Definition: thread.h:600
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:390
#define ISR_LOCK_MEMBER(_designator)
Defines an ISR lock member.
Definition: isrlock.h:89
Control block to manage thread actions.
Definition: thread.h:665
Per CPU Core Structure.
Definition: percpu.h:347
Thread control add-on.
Definition: thread.h:900
Thread action.
Definition: thread.h:640
Objects_Control Object
Definition: thread.h:734
Specification for the Packet Handler.
States_Control current_state
Definition: thread.h:756
Constants and Structures Associated with Watchdog Timers.
SPARC basic context.
Definition: cpu.h:194
Thread_CPU_budget_algorithms
Definition: thread.h:164
Definition: intercom.c:74
void * exit_value
The thread exit value.
Definition: thread.h:715
void * API_Extensions[THREAD_API_LAST+1]
Definition: thread.h:847
States_Control current_state
Definition: thread.h:529
Data for thread entry with one numeric argument and no return value.
Definition: thread.h:119
Thread scheduler control.
Definition: thread.h:250
void(* Thread_CPU_budget_algorithm_callout)(Thread_Control *)
Definition: thread.h:178
Priority_Node Real_priority
The base priority of this thread in its home scheduler instance.
Definition: thread.h:534
Thread_queue_Control Join_queue
Thread queue for thread join operations and multi-purpose lock.
Definition: thread.h:753
Scheduler control.
Definition: scheduler.h:269
Scheduler node for per-thread data.
Definition: schedulernode.h:79
void * extensions[RTEMS_ZERO_LENGTH_ARRAY]
Variable length array of user extension pointers.
Definition: thread.h:883
uint32_t Objects_Id
Definition: object.h:80
Objects_Control Object
Definition: thread.h:521
uintptr_t CPU_Uint32ptr
Definition: cpu.h:662
Scheduler_Node * nodes
The scheduler nodes of this thread.
Definition: thread.h:358
Thread life control.
Definition: thread.h:690
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
Definition: mmu-config.c:40
Thread_queue_Heads Thread_queue_Configured_heads
The configured thread queue heads.
Definition: thread.h:980
Thread_Action Action
Thread life action used to react upon thread restart and delete requests.
Definition: thread.h:695
Context_Control Registers
Definition: thread.h:837
Thread_Information _Thread_Information
The internal thread objects information.
Thread_Life_control Life
Thread life-cycle control.
Definition: thread.h:859
Priority_Node Real_priority
The base priority of this thread in its home scheduler instance.
Definition: thread.h:761
void(* Thread_Action_handler)(Thread_Control *the_thread, Thread_Action *action, ISR_lock_Context *lock_context)
Thread action handler.
Definition: thread.h:620
char _Thread_Idle_stacks[]
The idle thread stacks.
Thread_Scheduler_control Scheduler
Scheduler related control.
Definition: thread.h:544
struct Thread_Configured_control Thread_Configured_control
The configured thread control block.
Definition: thread.h:969
uint32_t cpu_time_budget
Definition: thread.h:816
const size_t _Thread_Initial_thread_count
Count of configured threads.
Thread_Timer_information Timer
Definition: thread.h:776
The freechain control.
Definition: freechain.h:48
const size_t _Thread_Maximum_name_size
Maximum size of a thread name in characters (including the terminating '\0' character).
bool is_idle
Definition: thread.h:796