21 #ifndef _RTEMS_SCORE_THREADIMPL_H 22 #define _RTEMS_SCORE_THREADIMPL_H 25 #include <rtems/score/assert.h> 30 #include <rtems/score/schedulernodeimpl.h> 32 #include <rtems/score/status.h> 38 #include <rtems/config.h> 53 #define THREAD_STATUS_PROXY_BLOCKING 0x1111111 74 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 78 #if defined(RTEMS_SMP) 79 #define THREAD_OF_SCHEDULER_HELP_NODE( node ) \ 80 RTEMS_CONTAINER_OF( node, Thread_Control, Scheduler.Help_node ) 83 typedef bool ( *Thread_Visitor )(
Thread_Control *the_thread,
void *arg );
86 Thread_Visitor visitor,
187 void _Thread_Restart_self(
193 bool _Thread_Restart_other(
344 _Thread_queue_Do_acquire_critical( &the_thread->
Join_queue, lock_context );
353 _Thread_State_acquire_critical( the_thread, lock_context );
363 executing = _Thread_Executing;
364 _Thread_State_acquire_critical( executing, lock_context );
374 _Thread_queue_Do_release_critical( &the_thread->
Join_queue, lock_context );
382 _Thread_State_release_critical( the_thread, lock_context );
386 #if defined(RTEMS_DEBUG) 391 return _Thread_queue_Is_lock_owner( &the_thread->
Join_queue );
507 _Priority_Node_set_priority( priority_node, new_priority );
552 #if defined(RTEMS_SMP) 553 void _Thread_Priority_and_sticky_update(
555 int sticky_level_change
618 #if defined(RTEMS_SMP) 623 return _Per_CPU_Get();
632 #if defined(RTEMS_SMP) 649 return ( the_thread == _Thread_Executing );
652 #if defined(RTEMS_SMP) 664 return _CPU_Context_Get_is_executing( &the_thread->
Registers );
677 return ( the_thread == _Thread_Heir );
699 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 704 return ( the_thread == _Thread_Allocated_fp );
723 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 724 #if ( CPU_USE_DEFERRED_FP_SWITCH != TRUE ) 733 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 734 #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) 737 if ( _Thread_Allocated_fp !=
NULL )
740 _Thread_Allocated_fp = executing;
754 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 757 _Thread_Allocated_fp =
NULL;
768 return ( _Thread_Dispatch_necessary );
779 return ( the_thread ==
NULL );
797 uint32_t maximum_internal_threads =
801 #if defined(RTEMS_MULTIPROCESSING) 802 if ( _System_state_Is_multiprocessing ) {
803 ++maximum_internal_threads;
807 return maximum_internal_threads;
833 heir = cpu_self->
heir;
854 #if defined( RTEMS_SMP ) 861 _Thread_Update_CPU_time_used( cpu_for_heir->
heir, cpu_for_heir );
863 cpu_for_heir->
heir = heir;
869 void _Thread_Get_CPU_time_used(
896 _Assert( _Thread_State_is_owner( the_thread ) );
898 cpu_of_thread = _Thread_Get_CPU( the_thread );
900 action->handler = handler;
905 &the_thread->Post_switch_actions.Chain,
914 return ( life_state & THREAD_LIFE_RESTARTING ) != 0;
921 return ( life_state & THREAD_LIFE_TERMINATING ) != 0;
929 & ( THREAD_LIFE_PROTECTED | THREAD_LIFE_CHANGE_DEFERRED ) ) == 0;
937 & ( THREAD_LIFE_RESTARTING | THREAD_LIFE_TERMINATING ) ) != 0;
944 _Assert( _Thread_State_is_owner( the_thread ) );
945 return ( the_thread->
Life.
state & THREAD_LIFE_DETACHED ) == 0;
952 #if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT) 953 ++the_thread->resource_count;
963 #if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT) 964 --the_thread->resource_count;
970 #if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT) 983 return the_thread->resource_count != 0;
987 #if defined(RTEMS_SMP) 993 _Per_CPU_Acquire( cpu );
1000 _Per_CPU_Release( cpu );
1008 #if defined(RTEMS_SMP) 1009 return the_thread->
Scheduler.home_scheduler;
1020 #if defined(RTEMS_SMP) 1022 return SCHEDULER_NODE_OF_THREAD_WAIT_NODE(
1032 size_t scheduler_index
1035 #if defined(RTEMS_SMP) 1038 + scheduler_index * _Scheduler_Node_size );
1040 _Assert( scheduler_index == 0 );
1041 (void) scheduler_index;
1046 #if defined(RTEMS_SMP) 1063 void _Thread_Scheduler_process_requests(
Thread_Control *the_thread );
1068 Scheduler_Node_request request
1072 Scheduler_Node_request current_request;
1074 _Thread_Scheduler_acquire_critical( the_thread, &lock_context );
1076 current_request = scheduler_node->Thread.request;
1078 if ( current_request == SCHEDULER_NODE_REQUEST_NOT_PENDING ) {
1080 request == SCHEDULER_NODE_REQUEST_ADD
1081 || request == SCHEDULER_NODE_REQUEST_REMOVE
1083 _Assert( scheduler_node->Thread.next_request ==
NULL );
1084 scheduler_node->Thread.next_request = the_thread->
Scheduler.requests;
1085 the_thread->
Scheduler.requests = scheduler_node;
1086 }
else if ( current_request != SCHEDULER_NODE_REQUEST_NOTHING ) {
1088 ( current_request == SCHEDULER_NODE_REQUEST_ADD
1089 && request == SCHEDULER_NODE_REQUEST_REMOVE )
1090 || ( current_request == SCHEDULER_NODE_REQUEST_REMOVE
1091 && request == SCHEDULER_NODE_REQUEST_ADD )
1093 request = SCHEDULER_NODE_REQUEST_NOTHING;
1096 scheduler_node->Thread.request = request;
1098 _Thread_Scheduler_release_critical( the_thread, &lock_context );
1108 &scheduler_node->Thread.Wait_node
1110 _Thread_Scheduler_add_request(
1113 SCHEDULER_NODE_REQUEST_ADD
1123 _Thread_Scheduler_add_request(
1126 SCHEDULER_NODE_REQUEST_REMOVE
1146 scheduler_node = _Thread_Scheduler_get_home_node( the_thread );
1147 return _Priority_Get_priority( &scheduler_node->
Wait.Priority );
1186 executing = _Thread_Executing;
1245 #if defined(RTEMS_SMP) 1246 #define THREAD_QUEUE_CONTEXT_OF_REQUEST( node ) \ 1247 RTEMS_CONTAINER_OF( node, Thread_queue_Context, Lock_context.Wait.Gate.Node ) 1259 if ( first !=
_Chain_Tail( &the_thread->
Wait.Lock.Pending_requests ) ) {
1260 _Thread_queue_Gate_open( (Thread_queue_Gate *) first );
1269 _Thread_queue_Queue_acquire_critical(
1271 &_Thread_Executing->Potpourri_stats,
1281 _Thread_queue_Queue_release_critical(
1301 #if defined(RTEMS_SMP) 1312 if ( queue !=
NULL ) {
1313 _Thread_queue_Gate_add(
1314 &the_thread->
Wait.Lock.Pending_requests,
1321 _Thread_Wait_acquire_queue_critical( queue, &queue_context->
Lock_context );
1324 _Thread_Wait_release_queue_critical(
1332 _Thread_Wait_remove_request_locked(
1341 (void) queue_context;
1376 #if defined(RTEMS_SMP) 1381 if ( queue !=
NULL ) {
1382 _Thread_Wait_release_queue_critical(
1389 _Thread_Wait_remove_request_locked(
1401 (void) queue_context;
1447 #if defined(RTEMS_SMP) 1450 _Thread_queue_Gate_close( &the_thread->
Wait.Lock.Tranquilizer );
1489 #if defined(RTEMS_SMP) 1493 _Thread_Wait_remove_request_locked( the_thread, queue_lock_context );
1497 (void) queue_lock_context;
1517 #if defined(RTEMS_SMP) 1527 if ( node != tail ) {
1531 queue_context = THREAD_QUEUE_CONTEXT_OF_REQUEST( node );
1535 }
while ( node != tail );
1537 _Thread_queue_Gate_add(
1538 &the_thread->
Wait.Lock.Pending_requests,
1539 &the_thread->
Wait.Lock.Tranquilizer
1542 _Thread_queue_Gate_open( &the_thread->
Wait.Lock.Tranquilizer );
1549 #if defined(RTEMS_SMP) 1576 #if defined(RTEMS_SMP) 1577 _Thread_queue_Gate_wait( &the_thread->
Wait.Lock.Tranquilizer );
1599 #if defined(RTEMS_SMP) 1600 if ( queue !=
NULL ) {
1601 _Assert( queue_context->
Lock_context.Wait.queue == queue );
1611 #if defined(RTEMS_SMP) 1621 #define THREAD_WAIT_FLAGS_INITIAL 0x0U 1626 #define THREAD_WAIT_STATE_MASK 0xffU 1635 #define THREAD_WAIT_STATE_INTEND_TO_BLOCK 0x1U 1640 #define THREAD_WAIT_STATE_BLOCKED 0x2U 1647 #define THREAD_WAIT_STATE_READY_AGAIN 0x4U 1652 #define THREAD_WAIT_CLASS_MASK 0xff00U 1657 #define THREAD_WAIT_CLASS_EVENT 0x100U 1662 #define THREAD_WAIT_CLASS_SYSTEM_EVENT 0x200U 1667 #define THREAD_WAIT_CLASS_OBJECT 0x400U 1672 #define THREAD_WAIT_CLASS_PERIOD 0x800U 1679 #if defined(RTEMS_SMP) 1680 _Atomic_Store_uint( &the_thread->
Wait.
flags, flags, ATOMIC_ORDER_RELAXED );
1690 #if defined(RTEMS_SMP) 1691 return _Atomic_Load_uint( &the_thread->
Wait.
flags, ATOMIC_ORDER_RELAXED );
1701 #if defined(RTEMS_SMP) 1702 return _Atomic_Load_uint( &the_thread->
Wait.
flags, ATOMIC_ORDER_ACQUIRE );
1732 #if defined(RTEMS_SMP) 1733 return _Atomic_Compare_exchange_uint(
1737 ATOMIC_ORDER_RELEASE,
1738 ATOMIC_ORDER_RELAXED
1741 bool success = ( the_thread->
Wait.
flags == expected_flags );
1770 #if defined(RTEMS_SMP) 1771 return _Atomic_Compare_exchange_uint(
1775 ATOMIC_ORDER_ACQUIRE,
1776 ATOMIC_ORDER_ACQUIRE
1859 the_thread->
Timer.header =
1862 _Watchdog_Per_CPU_insert_ticks( &the_thread->
Timer.Watchdog, cpu, ticks );
1880 the_thread->
Timer.header = header;
1882 _Watchdog_Per_CPU_insert( &the_thread->
Timer.Watchdog, cpu, header, expire );
1893 _Watchdog_Per_CPU_remove(
1894 &the_thread->
Timer.Watchdog,
1895 #
if defined(RTEMS_SMP)
1896 the_thread->
Timer.Watchdog.cpu,
1900 the_thread->
Timer.header
1912 _Thread_Timer_remove( the_thread );
1914 #if defined(RTEMS_MULTIPROCESSING) 1918 _Thread_queue_Unblock_proxy( queue, the_thread );
1926 Status_Control _Thread_Set_name(
1931 size_t _Thread_Get_name(
1937 #if defined(RTEMS_SMP) 1938 #define THREAD_PIN_STEP 2 1940 #define THREAD_PIN_PREEMPTION 1 1942 void _Thread_Do_unpin(
1950 #if defined(RTEMS_SMP) 1951 _Assert( executing == _Thread_Executing );
1953 executing->
Scheduler.pin_level += THREAD_PIN_STEP;
1964 #if defined(RTEMS_SMP) 1965 unsigned int pin_level;
1967 _Assert( executing == _Thread_Executing );
1969 pin_level = executing->
Scheduler.pin_level;
1970 _Assert( pin_level > 0 );
1974 pin_level != ( THREAD_PIN_STEP | THREAD_PIN_PREEMPTION )
1977 executing->
Scheduler.pin_level = pin_level - THREAD_PIN_STEP;
1979 _Thread_Do_unpin( executing, cpu_self );
1993 #if defined(RTEMS_MULTIPROCESSING) Constants and Prototypes Related to the Internal Error Handler.
RTEMS_INLINE_ROUTINE Priority_Control _Thread_Priority_highest(Priority_Control left, Priority_Control right)
Returns the highest priority of the left and right thread priorities in the intuitive sense of priori...
Definition: threadimpl.h:575
void _Thread_Stack_Free(Thread_Control *the_thread)
Deallocate thread stack.
Definition: threadstackfree.c:24
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(Chain_Control *the_chain, Chain_Node *the_node)
Append a node (unprotected).
Definition: chainimpl.h:679
Index for realtime clock per-CPU watchdog header.
Definition: percpu.h:268
Timestamp_Control cpu_time_used
Definition: thread.h:823
Thread_Life_state state
The current thread life state.
Definition: thread.h:696
bool _Thread_Start(Thread_Control *the_thread, const Thread_Entry_information *entry, ISR_lock_Context *lock_context)
Initializes thread and executes it.
Definition: threadstart.c:26
int64_t Timestamp_Control
Definition: timestamp.h:52
RTEMS_INLINE_ROUTINE bool _Thread_Is_proxy_blocking(uint32_t code)
Is proxy blocking.
Definition: threadimpl.h:787
RTEMS_INLINE_ROUTINE void _Thread_Wait_claim_finalize(Thread_Control *the_thread, const Thread_queue_Operations *operations)
Finalizes the thread wait queue claim via registration of the corresponding thread queue operations...
Definition: threadimpl.h:1465
Definition: threadq.h:120
RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API(Objects_Id id)
Definition: object.h:250
RTEMS_INLINE_ROUTINE void _Thread_Priority_change(Thread_Control *the_thread, Priority_Node *priority_node, Priority_Control new_priority, bool prepend_it, Thread_queue_Context *queue_context)
Changes the thread priority value of the specified thread priority node in the corresponding thread p...
Definition: threadimpl.h:499
bool _Thread_Initialize(Thread_Information *information, Thread_Control *the_thread, const struct _Scheduler_Control *scheduler, void *stack_area, size_t stack_size, bool is_fp, Priority_Control priority, bool is_preemptible, Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name)
Initialize thread.
Objects_Control * _Objects_Allocate_unprotected(Objects_Information *information)
Allocates an object without locking the allocator mutex.
Definition: objectallocate.c:33
RTEMS_INLINE_ROUTINE void _Thread_Unblock(Thread_Control *the_thread)
Definition: threadimpl.h:686
#define THREAD_STATUS_PROXY_BLOCKING
Definition: threadimpl.h:53
void _Thread_Priority_update(Thread_queue_Context *queue_context)
Adds a priority node to the corresponding thread priority aggregation.
Definition: threadchangepriority.c:339
Watchdog_Header Header[PER_CPU_WATCHDOG_COUNT]
Header for watchdogs.
Definition: percpu.h:416
RTEMS_INLINE_ROUTINE void _Thread_Wait_claim(Thread_Control *the_thread, Thread_queue_Queue *queue)
Claims the thread wait queue.
Definition: threadimpl.h:1436
void _Thread_Start_multitasking(void) RTEMS_NO_RETURN
Start thread multitasking.
Definition: threadstartmultitasking.c:24
Thread_Wait_information Wait
Definition: thread.h:770
void(* Thread_Action_handler)(Thread_Control *the_thread, Thread_Action *action, ISR_lock_Context *lock_context)
Thread action handler.
Definition: thread.h:616
Thread queue context for the thread queue methods.
Definition: threadq.h:193
The priority node to build up a priority aggregation.
Definition: priority.h:94
#define _ISR_lock_ISR_disable_and_acquire(_lock, _context)
Acquires an ISR lock.
Definition: isrlock.h:223
struct _Thread_Control * executing
This is the thread executing on this processor.
Definition: percpu.h:362
RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid(uint32_t the_api)
Definition: objectimpl.h:586
Thread entry information.
Definition: thread.h:131
RTEMS_INLINE_ROUTINE bool _Thread_Wait_flags_try_change_release(Thread_Control *the_thread, Thread_Wait_flags expected_flags, Thread_Wait_flags desired_flags)
Tries to change the thread wait flags with release semantics in case of success.
Definition: threadimpl.h:1724
void _Thread_Handler(void)
Wrapper function for all threads.
Definition: threadhandler.c:72
RTEMS_INLINE_ROUTINE void _Thread_Wait_cancel(Thread_Control *the_thread, Thread_queue_Context *queue_context)
Cancels a thread wait on a thread queue.
Definition: threadimpl.h:1590
#define _ISR_lock_Acquire(_lock, _context)
Acquires an ISR lock inside an ISR disabled section.
Definition: isrlock.h:278
void _Thread_Priority_add(Thread_Control *the_thread, Priority_Node *priority_node, Thread_queue_Context *queue_context)
Adds the specified thread priority node to the corresponding thread priority aggregation.
Definition: threadchangepriority.c:277
Data Related to the Management of Processor Interrupt Levels.
Inlined Routines in the Watchdog Handler.
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
void _Thread_Priority_replace(Thread_Control *the_thread, Priority_Node *victim_node, Priority_Node *replacement_node)
Replaces the victim priority node with the replacement priority node in the corresponding thread prio...
Definition: threadchangepriority.c:323
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing(const Thread_Control *the_thread)
Definition: threadimpl.h:645
#define _Context_Save_fp(_fp)
Save floating point context area.
Definition: context.h:146
The control block used to manage each watchdog timer.
Definition: watchdog.h:87
#define STATES_BLOCKED
Definition: statesimpl.h:132
RTEMS_INLINE_ROUTINE void _Thread_Wait_release_default(Thread_Control *the_thread, ISR_lock_Context *lock_context)
Releases the thread wait default lock and restores the previous interrupt status. ...
Definition: threadimpl.h:1236
#define _ISR_lock_Initialize(_lock, _name)
Initializes an ISR lock.
Definition: isrlock.h:185
void _Thread_Priority_perform_actions(Thread_Control *start_of_path, Thread_queue_Context *queue_context)
Performs the priority actions specified by the thread queue context along the thread queue path...
Definition: threadchangepriority.c:182
RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_priority(const Thread_Control *the_thread)
Returns the priority of the thread.
Definition: threadimpl.h:1140
void _Thread_Create_idle(void)
Create idle thread.
Definition: threadcreateidle.c:86
Thread_Scheduler_control Scheduler
Scheduler related control.
Definition: thread.h:767
#define _Context_Restore_fp(_fp)
Restore floating point context area.
Definition: context.h:135
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_Next(const Chain_Node *the_node)
Return pointer the next node from this node.
Definition: chainimpl.h:324
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(const Chain_Node *node)
Is the node off chain.
Definition: chainimpl.h:139
RTEMS_INLINE_ROUTINE void _Chain_Extract_unprotected(Chain_Node *the_node)
Extract this node (unprotected).
Definition: chainimpl.h:557
void _Thread_Handler_initialization(void)
Initialize thread handler.
Definition: thread.c:59
#define _ISR_Get_level()
Return current interrupt level.
Definition: isrlevel.h:125
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(Chain_Control *the_chain)
Initialize this chain as empty.
Definition: chainimpl.h:504
void _Thread_Priority_changed(Thread_Control *the_thread, Priority_Node *priority_node, bool prepend_it, Thread_queue_Context *queue_context)
Propagates a thread priority value change in the specified thread priority node to the corresponding ...
Definition: threadchangepriority.c:307
Context_Control_fp * fp_context
Definition: thread.h:838
Helpers for Manipulating Timestamps.
Definition: threadq.h:397
Timestamp_Control cpu_usage_timestamp
The CPU usage timestamp contains the time point of the last heir thread change or last CPU usage upda...
Definition: percpu.h:394
RTEMS_INLINE_ROUTINE void _Timestamp_Add_to(Timestamp_Control *_time, const Timestamp_Control *_add)
Adds two timestamps.
Definition: timestampimpl.h:145
Watchdog_Service_routine_entry routine
This field is the function to invoke.
Definition: watchdog.h:111
Thread queue operations.
Definition: threadq.h:512
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:66
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(const Chain_Control *the_chain)
Is the chain empty.
Definition: chainimpl.h:390
Thread_Information _Thread_Information
The internal thread objects information.
#define RTEMS_PREDICT_TRUE(_exp)
Returns the value of the specified integral expression and tells the compiler that the predicted valu...
Definition: basedefs.h:345
States_Control _Thread_Set_state(Thread_Control *the_thread, States_Control state)
Sets the specified thread state.
Definition: threadsetstate.c:50
#define _ISR_Local_disable(_level)
Disables interrupts on this processor.
Definition: isrlevel.h:54
void _Thread_Priority_remove(Thread_Control *the_thread, Priority_Node *priority_node, Thread_queue_Context *queue_context)
Removes the specified thread priority node from the corresponding thread priority aggregation...
Definition: threadchangepriority.c:292
#define _ISR_lock_ISR_disable(_context)
Disables interrupts and saves the previous interrupt state in the ISR lock context.
Definition: isrlock.h:383
RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_default_critical(Thread_Control *the_thread, ISR_lock_Context *lock_context)
Acquires the thread wait default lock inside a critical section (interrupts disabled).
Definition: threadimpl.h:1160
void(* Thread_CPU_budget_algorithm_callout)(Thread_Control *)
Definition: thread.h:173
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_First(const Chain_Control *the_chain)
Return pointer to chain's first node.
Definition: chainimpl.h:257
uint32_t ISR_Level
Definition: isrlevel.h:38
RTEMS_INLINE_ROUTINE bool _Thread_Is_heir(const Thread_Control *the_thread)
Definition: threadimpl.h:673
Thread_Control * _Thread_Allocated_fp
Definition: threaddispatch.c:34
Control block to manage thread actions.
Definition: thread.h:661
#define _ISR_lock_ISR_enable(_context)
Restores the saved interrupt state of the ISR lock context.
Definition: isrlock.h:404
Per CPU Core Structure.
Definition: percpu.h:290
RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_default(Thread_Control *the_thread, ISR_lock_Context *lock_context)
Acquires the thread wait default lock and disables interrupts.
Definition: threadimpl.h:1201
RTEMS_INLINE_ROUTINE void _Thread_Wait_restore_default(Thread_Control *the_thread)
Restores the default thread wait queue and operations.
Definition: threadimpl.h:1513
void _Thread_Load_environment(Thread_Control *the_thread)
Initializes enviroment for a thread.
Definition: threadloadenv.c:24
#define _ISR_lock_Release(_lock, _context)
Releases an ISR lock inside an ISR disabled section.
Definition: isrlock.h:301
RTEMS_INLINE_ROUTINE void _Thread_Wait_release_critical(Thread_Control *the_thread, Thread_queue_Context *queue_context)
Releases the thread wait lock inside a critical section (interrupts disabled).
Definition: threadimpl.h:1371
RTEMS_INLINE_ROUTINE bool _Thread_Wait_flags_try_change_acquire(Thread_Control *the_thread, Thread_Wait_flags expected_flags, Thread_Wait_flags desired_flags)
Tries to change the thread wait flags with acquire semantics.
Definition: threadimpl.h:1764
Thread action.
Definition: thread.h:636
RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp(const Thread_Control *the_thread)
Definition: threadimpl.h:700
Thread_queue_Lock_context Lock_context
The lock context for the thread queue acquire and release operations.
Definition: threadq.h:198
Objects_Control Object
Definition: thread.h:730
Thread_Life_state
Thread life states.
Definition: thread.h:675
Thread_queue_Extract_operation extract
Thread queue extract operation.
Definition: threadq.h:530
RTEMS_INLINE_ROUTINE bool _Objects_Is_local_id(Objects_Id id RTEMS_UNUSED)
Definition: objectimpl.h:623
RTEMS_INLINE_ROUTINE void _Thread_Dispatch_request(Per_CPU_Control *cpu_self, Per_CPU_Control *cpu_target)
Requests a thread dispatch on the target processor.
Definition: threaddispatch.h:231
#define _ISR_lock_Release_and_ISR_enable(_lock, _context)
Releases an ISR lock.
Definition: isrlock.h:248
States_Control current_state
Definition: thread.h:752
Objects_Information **const _Objects_Information_table[OBJECTS_APIS_LAST+1]
Definition: exinit.c:53
#define _ISR_Local_enable(_level)
Enables interrupts on this processor.
Definition: isrlevel.h:71
RTEMS_INLINE_ROUTINE void _Watchdog_Preinitialize(Watchdog_Control *the_watchdog, Per_CPU_Control *cpu)
Pre-initializes a watchdog.
Definition: watchdogimpl.h:168
RTEMS_INLINE_ROUTINE Chain_Node * _Chain_Tail(Chain_Control *the_chain)
Return pointer to chain tail.
Definition: chainimpl.h:224
RTEMS_INLINE_ROUTINE void _Chain_Initialize_node(Chain_Node *the_node)
Initializes a chain node.
Definition: chainimpl.h:119
RTEMS_INLINE_ROUTINE bool _Thread_Priority_less_than(Priority_Control left, Priority_Control right)
Returns true if the left thread priority is less than the right thread priority in the intuitive sens...
Definition: threadimpl.h:563
Inlined Routines Associated with Thread State Information.
#define RTEMS_NO_RETURN
Definition: basedefs.h:101
struct Scheduler_Node::@3976 Wait
Thread wait support block.
volatile bool dispatch_necessary
This is set to true when this processor needs to run the thread dispatcher.
Definition: percpu.h:343
void _Thread_Kill_zombies(void)
Kills all zombie threads in the system.
Definition: threadrestart.c:218
Definition: inftrees.h:24
RTEMS_INLINE_ROUTINE void _Thread_Wait_remove_request(Thread_Control *the_thread, Thread_queue_Lock_context *queue_lock_context)
Removes a thread wait lock request.
Definition: threadimpl.h:1484
struct _Thread_Control * heir
This is the heir thread for this processor.
Definition: percpu.h:378
RTEMS_INLINE_ROUTINE void _Timestamp_Subtract(const Timestamp_Control *_start, const Timestamp_Control *_end, Timestamp_Control *_result)
Subtracts two timestamps.
Definition: timestampimpl.h:166
uint32_t States_Control
Definition: states.h:41
uint32_t Watchdog_Interval
Type is used to specify the length of intervals.
Definition: watchdogticks.h:36
unsigned context
Definition: tlb.h:108
System State Handler API.
size_t _Thread_Stack_Allocate(Thread_Control *the_thread, size_t stack_size)
Allocate the requested stack space for the thread.
Definition: threadstackallocate.c:26
Thread_queue_Control Join_queue
Thread queue for thread join operations and multi-purpose lock.
Definition: thread.h:749
Scheduler control.
Definition: scheduler.h:266
Scheduler node for per-thread data.
Definition: schedulernode.h:65
const Scheduler_Control _Scheduler_Table[]
Registered schedulers.
RTEMS_INLINE_ROUTINE Thread_Control * _Thread_Wait_acquire_default_for_executing(ISR_lock_Context *lock_context)
Acquires the thread wait default lock and returns the executing thread.
Definition: threadimpl.h:1179
Definition: threadimpl.h:239
RTEMS_INLINE_ROUTINE void _Thread_Wait_release(Thread_Control *the_thread, Thread_queue_Context *queue_context)
Releases the thread wait lock and restores the previous interrupt status.
Definition: threadimpl.h:1413
RTEMS_INLINE_ROUTINE bool _States_Is_ready(States_Control the_states)
Definition: statesimpl.h:185
RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp(void)
Definition: threadimpl.h:755
struct Per_CPU_Control::@3973 Watchdog
Watchdog state for this processor.
Scheduler_Node * nodes
The scheduler nodes of this thread.
Definition: thread.h:354
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(Chain_Node *node)
Set off chain.
Definition: chainimpl.h:101
States_Control _Thread_Clear_state(Thread_Control *the_thread, States_Control state)
Clears the specified thread state.
Definition: threadclearstate.c:51
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
ISR_lock_Context Lock_context
The lock context for the thread queue acquire and release operations.
Definition: threadq.h:125
Index for tick clock per-CPU watchdog header.
Definition: percpu.h:259
Definition: mmu-config.c:39
RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_critical(Thread_Control *the_thread, Thread_queue_Context *queue_context)
Acquires the thread wait lock inside a critical section (interrupts disabled).
Definition: threadimpl.h:1296
Inlined Routines in the Object Handler.
RTEMS_INLINE_ROUTINE void _Thread_Wait_tranquilize(Thread_Control *the_thread)
Tranquilizes the thread after a wait on a thread queue.
Definition: threadimpl.h:1572
RTEMS_INLINE_ROUTINE const Chain_Node * _Chain_Immutable_tail(const Chain_Control *the_chain)
Return pointer to immutable chain tail.
Definition: chainimpl.h:240
RTEMS_INLINE_ROUTINE bool _Thread_Is_context_switch_necessary(void)
Definition: threadimpl.h:766
Multiprocessing Portion of the Thread Package.
Objects_Id _Thread_Global_constructor
Object identifier of the global constructor thread.
Definition: threadhandler.c:49
uint32_t Objects_Id
Definition: object.h:75
Context_Control Registers
Definition: thread.h:833
Thread_Life_control Life
Thread life-cycle control.
Definition: thread.h:855
Constants and Structures Related with the Thread Control Block.
RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected(Chain_Control *the_chain, Chain_Node *the_node)
Append a node on the end of a chain if the node is in the off chain state (unprotected).
Definition: chainimpl.h:707
RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire(Thread_Control *the_thread, Thread_queue_Context *queue_context)
Acquires the thread wait default lock and disables interrupts.
Definition: threadimpl.h:1352
#define rtems_configuration_get_maximum_processors()
Returns the configured maximum count of processors.
Definition: config.h:351
Thread_Control * _Thread_Get(Objects_Id id, ISR_lock_Context *lock_context)
Gets a thread by its identifier.
Definition: threadget.c:24
void _Thread_Timeout(Watchdog_Control *the_watchdog)
General purpose thread wait timeout.
Definition: threadtimeout.c:83
void _Thread_Continue(Thread_Control *the_thread, Status_Control status)
Cancels a blocking operation so that the thread can continue its execution.
Definition: threadtimeout.c:25
RTEMS_INLINE_ROUTINE Thread_Control * _Thread_Get_heir_and_make_it_executing(Per_CPU_Control *cpu_self)
Gets the heir of the processor and makes it executing.
Definition: threadimpl.h:827
Watchdog_Service_routine(* Watchdog_Service_routine_entry)(Watchdog_Control *)
Pointer to a watchdog service routine.
Definition: watchdog.h:63
RTEMS_INLINE_ROUTINE bool _Thread_Is_null(const Thread_Control *the_thread)
Definition: threadimpl.h:775
Objects_Id _Thread_Wait_get_id(const Thread_Control *the_thread)
Returns the object identifier of the object containing the current thread wait queue.
Definition: threadwaitgetid.c:21
RTEMS_INLINE_ROUTINE void _Thread_Wait_release_default_critical(Thread_Control *the_thread, ISR_lock_Context *lock_context)
Releases the thread wait default lock inside a critical section (interrupts disabled).
Definition: threadimpl.h:1220
Thread_CPU_budget_algorithms
Definition: thread.h:159
Thread_Timer_information Timer
Definition: thread.h:772
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77
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:386
void _Thread_Close(Thread_Control *the_thread, Thread_Control *executing, Thread_Close_context *context)
Closes the thread.
Definition: threadrestart.c:511
Objects_Id id
Definition: objectdata.h:43