32 #include <rtems/sysinit.h> 36 static void _RTEMS_tasks_Prepare_user_stack(
41 thread_config->
stack_size = config->stack_size;
42 thread_config->
stack_area = config->stack_area;
44 if ( config->stack_free != NULL ) {
45 thread_config->
stack_free = config->stack_free;
56 return _RTEMS_tasks_Build( config,
id, _RTEMS_tasks_Prepare_user_stack );
67 #if defined(RTEMS_MULTIPROCESSING) 68 Objects_MP_Control *the_global_object = NULL;
100 memset( &thread_config, 0,
sizeof( thread_config ) );
102 THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE
103 : THREAD_CPU_BUDGET_ALGORITHM_NONE,
131 #if defined(RTEMS_MULTIPROCESSING) 132 if ( !_System_state_Is_multiprocessing ) {
136 is_global = _Attributes_Is_global( attributes );
148 the_thread = _RTEMS_tasks_Allocate();
155 #if defined(RTEMS_MULTIPROCESSING) 157 the_global_object = _Objects_MP_Allocate_global_object();
159 if ( _Objects_MP_Is_null_global_object( the_global_object ) ) {
167 ( *prepare_stack )( &thread_config, config );
168 status = ( thread_config.stack_area != NULL );
183 #if defined(RTEMS_MULTIPROCESSING) 185 _Objects_MP_Free_global_object( the_global_object );
199 #if defined(RTEMS_MULTIPROCESSING) 200 the_thread->is_global = is_global;
210 _RTEMS_tasks_MP_Send_process_packet(
211 RTEMS_TASKS_MP_ANNOUNCE_CREATE,
223 static void _RTEMS_tasks_Start_extension(
232 _Event_Initialize( &api->
Event );
236 #if defined(RTEMS_MULTIPROCESSING) 237 static void _RTEMS_tasks_Terminate_extension(
Thread_Control *executing )
239 if ( executing->is_global ) {
244 _RTEMS_tasks_MP_Send_process_packet(
245 RTEMS_TASKS_MP_ANNOUNCE_DELETE,
255 #if defined(RTEMS_MULTIPROCESSING) 256 .thread_terminate = _RTEMS_tasks_Terminate_extension,
258 .thread_start = _RTEMS_tasks_Start_extension,
259 .thread_restart = _RTEMS_tasks_Start_extension
263 static void _RTEMS_tasks_Manager_initialization(
void )
270 _RTEMS_tasks_Manager_initialization,
271 RTEMS_SYSINIT_CLASSIC_TASKS,
272 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.
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.
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.
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.
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.
System State Handler API.
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.
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.
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...
void(* stack_free)(void *)
This member contains the handler to free the stack.
void _Thread_Initialize_information(Thread_Information *information)
Initializes the thread information.
Classic Tasks Manager Implementation.