📄 thread.h
字号:
* Set the Start.stack field to the address of the stack * * NOTES: NONE * */unsigned32 _Thread_Stack_Allocate( Thread_Control *the_thread, unsigned32 stack_size);/* * _Thread_Stack_Free * * DESCRIPTION: * * Deallocate the Thread's stack. * NOTES: NONE * */void _Thread_Stack_Free( Thread_Control *the_thread);/* * _Thread_Initialize * * DESCRIPTION: * * This routine initializes the specified the thread. It allocates * all memory associated with this thread. It completes by adding * the thread to the local object table so operations on this * thread id are allowed. * * NOTES: * * If stack_area is NULL, it is allocated from the workspace. * * If the stack is allocated from the workspace, then it is guaranteed to be * of at least minimum size. */boolean _Thread_Initialize( Objects_Information *information, Thread_Control *the_thread, void *stack_area, unsigned32 stack_size, boolean is_fp, Priority_Control priority, boolean is_preemptible, Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, unsigned32 isr_level, Objects_Name name);/* * _Thread_Start * * DESCRIPTION: * * This routine initializes the executable information for a thread * and makes it ready to execute. After this routine executes, the * thread competes with all other threads for CPU time. */ boolean _Thread_Start( Thread_Control *the_thread, Thread_Start_types the_prototype, void *entry_point, void *pointer_argument, unsigned32 numeric_argument);/* * _Thread_Restart * * DESCRIPTION: * * This support routine restarts the specified task in a way that the * next time this thread executes, it will begin execution at its * original starting point. */ /* XXX multiple task arg profiles */ boolean _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, unsigned32 numeric_argument);/* * _Thread_Reset * * DESCRIPTION: * * This routine resets a thread to its initial state but does * not restart it. */ void _Thread_Reset( Thread_Control *the_thread, void *pointer_argument, unsigned32 numeric_argument);/* * _Thread_Close * * DESCRIPTION: * * This routine frees all memory associated with the specified * thread and removes it from the local object table so no further * operations on this thread are allowed. */ void _Thread_Close( Objects_Information *information, Thread_Control *the_thread);/* * _Thread_Ready * * DESCRIPTION: * * This routine removes any set states for the_thread. It performs * any necessary scheduling operations including the selection of * a new heir thread. */void _Thread_Ready( Thread_Control *the_thread);/* * _Thread_Clear_state * * DESCRIPTION: * * This routine clears the indicated STATES for the_thread. It performs * any necessary scheduling operations including the selection of * a new heir thread. */void _Thread_Clear_state( Thread_Control *the_thread, States_Control state);/* * _Thread_Set_state * * DESCRIPTION: * * This routine sets the indicated states for the_thread. It performs * any necessary scheduling operations including the selection of * a new heir thread. * */void _Thread_Set_state( Thread_Control *the_thread, States_Control state);/* * _Thread_Set_transient * * DESCRIPTION: * * This routine sets the TRANSIENT state for the_thread. It performs * any necessary scheduling operations including the selection of * a new heir thread. */void _Thread_Set_transient( Thread_Control *the_thread);/* * _Thread_Reset_timeslice * * DESCRIPTION: * * This routine is invoked upon expiration of the currently * executing thread's timeslice. If no other thread's are ready * at the priority of the currently executing thread, then the * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */void _Thread_Reset_timeslice( void );/* * _Thread_Tickle_timeslice * * DESCRIPTION: * * This routine is invoked as part of processing each clock tick. * It is responsible for determining if the current thread allows * timeslicing and, if so, when its timeslice expires. */void _Thread_Tickle_timeslice( void );/* * _Thread_Yield_processor * * DESCRIPTION: * * This routine is invoked when a thread wishes to voluntarily * transfer control of the processor to another thread of equal * or greater priority. */void _Thread_Yield_processor( void );/* * _Thread_Rotate_Ready_Queue * * DESCRIPTION: * * This routine is invoked to rotate the ready queue for the * given priority. It can be used to yeild the processor * by rotating the executing threads ready queue. */void _Thread_Rotate_Ready_Queue( Priority_Control priority);/* * _Thread_Load_environment * * DESCRIPTION: * * This routine initializes the context of the_thread to its * appropriate starting state. */void _Thread_Load_environment( Thread_Control *the_thread);/* * _Thread_Handler * * DESCRIPTION: * * This routine is the wrapper function for all threads. It is * the starting point for all threads. The user provided thread * entry point is invoked by this routine. Operations * which must be performed immediately before and after the user's * thread executes are found here. */void _Thread_Handler( void );/* * _Thread_Delay_ended * * DESCRIPTION: * * This routine is invoked when a thread must be unblocked at the * end of a time based delay (i.e. wake after or wake when). */void _Thread_Delay_ended( Objects_Id id, void *ignored);/* * _Thread_Change_priority * * DESCRIPTION: * * This routine changes the current priority of the_thread to * new_priority. It performs any necessary scheduling operations * including the selection of a new heir thread. */void _Thread_Change_priority ( Thread_Control *the_thread, Priority_Control new_priority, boolean prepend_it);/* * _Thread_Set_priority * * DESCRIPTION: * * This routine updates the priority related fields in the_thread * control block to indicate the current priority is now new_priority. */void _Thread_Set_priority( Thread_Control *the_thread, Priority_Control new_priority);/* * _Thread_Suspend * * DESCRIPTION: * * This routine updates the related suspend fields in the_thread * control block to indicate the current nested level. */void _Thread_Suspend( Thread_Control *the_thread);/* * _Thread_Resume * * DESCRIPTION: * * This routine updates the related suspend fields in the_thread * control block to indicate the current nested level. A force * parameter of TRUE will force a resume and clear the suspend count. */void _Thread_Resume( Thread_Control *the_thread, boolean force);/* * _Thread_Evaluate_mode * * DESCRIPTION: * * This routine evaluates the current scheduling information for the * system and determines if a context switch is required. This * is usually called after changing an execution mode such as preemptability * for a thread. */boolean _Thread_Evaluate_mode( void );/* * _Thread_Get * * NOTE: If we are not using static inlines, this must be a real * subroutine call. */ #ifndef USE_INLINESThread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location);#endif/* * _Thread_Idle_body * * DESCRIPTION: * * This routine is the body of the system idle thread. */ #if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)Thread _Thread_Idle_body( unsigned32 ignored);#endif#ifndef __RTEMS_APPLICATION__#include <rtems/score/thread.inl>#endif#if defined(RTEMS_MULTIPROCESSING)#include <rtems/score/threadmp.h>#endif#ifdef __cplusplus}#endif#endif/* end of include file */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -