32 #include <rtems/sysinit.h> 49 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) 50 if ( thread_config->
is_fp ) {
78 return _RTEMS_tasks_Create( config,
id, _RTEMS_tasks_Prepare_user_stack );
84 RTEMS_tasks_Prepare_stack prepare_stack
89 #if defined(RTEMS_MULTIPROCESSING) 90 Objects_MP_Control *the_global_object = NULL;
124 memset( &thread_config, 0,
sizeof( thread_config ) );
126 THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE
127 : THREAD_CPU_BUDGET_ALGORITHM_NONE,
155 #if defined(RTEMS_MULTIPROCESSING) 156 if ( !_System_state_Is_multiprocessing ) {
160 is_global = _Attributes_Is_global( attributes );
172 the_thread = _RTEMS_tasks_Allocate();
179 #if defined(RTEMS_MULTIPROCESSING) 181 the_global_object = _Objects_MP_Allocate_global_object();
183 if ( _Objects_MP_Is_null_global_object( the_global_object ) ) {
191 status = ( *prepare_stack )( &thread_config, config );
212 #if defined(RTEMS_MULTIPROCESSING) 214 _Objects_MP_Free_global_object( the_global_object );
228 #if defined(RTEMS_MULTIPROCESSING) 229 the_thread->is_global = is_global;
239 _RTEMS_tasks_MP_Send_process_packet(
240 RTEMS_TASKS_MP_ANNOUNCE_CREATE,
252 static void _RTEMS_tasks_Start_extension(
261 _Event_Initialize( &api->
Event );
265 #if defined(RTEMS_MULTIPROCESSING) 266 static void _RTEMS_tasks_Terminate_extension(
Thread_Control *executing )
268 if ( executing->is_global ) {
273 _RTEMS_tasks_MP_Send_process_packet(
274 RTEMS_TASKS_MP_ANNOUNCE_DELETE,
284 #if defined(RTEMS_MULTIPROCESSING) 285 .thread_terminate = _RTEMS_tasks_Terminate_extension,
287 .thread_start = _RTEMS_tasks_Start_extension,
288 .thread_restart = _RTEMS_tasks_Start_extension
292 static void _RTEMS_tasks_Manager_initialization(
void )
299 _RTEMS_tasks_Manager_initialization,
300 RTEMS_SYSINIT_CLASSIC_TASKS,
301 RTEMS_SYSINIT_ORDER_MIDDLE
This status code indicates you have attempted to create too many instances of a particular object cla...
static __inline__ void _Objects_Allocator_unlock(void)
Unlocks the object allocator mutex.
This header file defines support services of the API.
Thread_CPU_budget_algorithms budget_algorithm
The thread's budget algorithm.
uintptr_t _TLS_Get_allocation_size(void)
Return the TLS area allocation size.
static __inline__ Priority_Control _RTEMS_Priority_To_core(const Scheduler_Control *scheduler, rtems_task_priority priority, bool *valid)
Converts the RTEMS API priority to the corresponding SuperCore priority and validates it...
#define ATTRIBUTES_REQUIRED
rtems_mode initial_modes
This member defines the initial modes of the task.
This status code indicates that an invalid thread priority was provided.
#define CONTEXT_FP_SIZE
Size of floating point context area.
RTEMS_INLINE_ROUTINE bool _Attributes_Is_floating_point(rtems_attribute attribute_set)
Checks if the floating point attribute is enabled in the attribute_set.
static __inline__ const Scheduler_Control * _Thread_Scheduler_get_home(const Thread_Control *the_thread)
Gets the home scheduler of the thread.
static __inline__ bool _Modes_Is_asr_disabled(rtems_mode mode_set)
Checks if mode_set says that Asynchronous Signal Processing is disabled.
#define PRIORITY_MINIMUM
The highest (most important) thread priority value.
static __inline__ uint32_t _Stack_Minimum(void)
Returns the minimum stack size.
Classic Modes Implementation.
static __inline__ void _RTEMS_tasks_Free(Thread_Control *the_task)
Frees a task control block.
void _Stack_Free_nothing(void *stack_area)
This function does nothing.
Inlined Routines Associated with the Manipulation of the Scheduler.
This status code indicates that the request was not satisfied.
static bool rtems_is_name_valid(rtems_status_code name)
Returns true, if the specified object name is valid, otherwise returns false.
rtems_name name
This member defines the name of the task.
RTEMS_INLINE_ROUTINE bool _Attributes_Is_system_task(rtems_attribute attribute_set)
Checks if the system task attribute is enabled in the attribute_set.
Event_Control System_event
User Extension Handler API.
This structure defines the configuration of a task constructed by rtems_task_construct().
RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Set(rtems_attribute new_attributes, rtems_attribute attribute_set)
Sets the requested new_attributes in the attribute_set passed in.
bool _Thread_Initialize(Thread_Information *information, Thread_Control *the_thread, const Thread_Configuration *config)
Initializes thread.
Thread_Information _RTEMS_tasks_Information
static __inline__ struct _Thread_Control * _Thread_Get_executing(void)
Returns the thread control block of the executing thread.
Classic Event Manager Implementation.
Inlined Routines from the Stack Handler.
Objects_Name name
Name of the object for the thread.
void(* storage_free)(void *)
This member defines the optional handler to free the task storage area.
This status code indicates successful completion.
Priority_Control priority
The new thread's priority.
static __inline__ bool _Modes_Is_timeslice(rtems_mode mode_set)
Checks if mode_set indicates that timeslicing is enabled.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
const struct _Scheduler_Control * scheduler
The scheduler control instance for the thread.
The configuration of a new thread to initialize.
size_t stack_size
The size of the stack area in bytes.
static __inline__ ISR_Level _Modes_Get_interrupt_level(rtems_mode mode_set)
Gets the interrupt level portion of the mode_set.
#define ATTRIBUTES_NOT_SUPPORTED
rtems_task_priority initial_priority
This member defines the initial priority of the task.
This status code indicates that a specified address was invalid.
uint32_t rtems_attribute
This type is used to represent Classic API attributes.
void * API_Extensions[THREAD_API_LAST+1]
Classic Attributes Implementation.
Objects_Id rtems_id
Values of this type identify an RTEMS object.
bool is_fp
Indicates whether the thread needs a floating-point area.
void * stack_area
The starting address of the stack area.
RTEMS_INLINE_ROUTINE rtems_attribute _Attributes_Clear(rtems_attribute attribute_set, rtems_attribute mask)
Clears the requested new_attributes in the attribute_set passed in.
Inlined Routines from the Thread Handler.
bool is_preemptible
Indicates whether the new thread is preemptible.
Manages each user extension set.
rtems_status_code rtems_task_construct(const rtems_task_config *config, rtems_id *id)
Constructs a task from the specified the task configuration.
static __inline__ bool _Modes_Is_preempt(rtems_mode mode_set)
Checks if mode_set indicates that preemption is enabled.
static __inline__ void _User_extensions_Add_API_set(User_extensions_Control *extension)
Adds a user extension.
rtems_attribute attributes
This member defines the attributes of the task.
This status code indicates that an object name was invalid.
uint32_t isr_level
The thread's initial ISR level.
#define RTEMS_GLOBAL
This attribute constant indicates that the Classic API object shall be a global resource in a multipr...
size_t maximum_thread_local_storage_size
This member defines the maximum thread-local storage size supported by the task storage area...
size_t storage_size
This member defines size of the task storage area in bytes.
void(* stack_free)(void *)
This member contains the handler to free the stack.
void * storage_area
This member shall point to the task storage area begin.
This status code indicates that a specified size was invalid.
void _Thread_Initialize_information(Thread_Information *information)
Initializes the thread information.
Classic Tasks Manager Implementation.