56#ifndef _RTEMS_RTEMS_TASKS_H
57#define _RTEMS_RTEMS_TASKS_H
62#include <sys/cpuset.h>
69#include <rtems/score/cpu.h>
209#define RTEMS_CONFIGURED_MINIMUM_STACK_SIZE 0
219#define RTEMS_CURRENT_PRIORITY 0
303#define RTEMS_MAXIMUM_PRIORITY _RTEMS_Maximum_priority()
313#define RTEMS_MINIMUM_PRIORITY 1
331#define RTEMS_MINIMUM_STACK_SIZE STACK_MINIMUM_SIZE
341#define RTEMS_NO_PRIORITY RTEMS_CURRENT_PRIORITY
351#define RTEMS_SELF OBJECTS_ID_OF_SELF
365#define RTEMS_TASK_STORAGE_ALIGNMENT CPU_STACK_ALIGNMENT
383#if CPU_ALL_TASKS_ARE_FP == TRUE
384 #define RTEMS_TASK_STORAGE_SIZE( _size, _attributes ) \
385 ( ( _size ) + CONTEXT_FP_SIZE )
387 #define RTEMS_TASK_STORAGE_SIZE( _size, _attributes ) \
389 ( ( ( _attributes ) & RTEMS_FLOATING_POINT ) != 0 ? \
390 CONTEXT_FP_SIZE : 0 ) )
421#define RTEMS_YIELD_PROCESSOR WATCHDOG_NO_TIMEOUT
1846 const cpu_set_t *cpuset
This header file provides Classic API directive attributes.
This header file provides basic definitions used by the API and the implementation.
This header file provides the interfaces of the Context Handler.
This header file provides types used by the Classic API.
This header file provides interfaces of the Stack Handler which are used by the implementation and th...
#define RTEMS_NO_RETURN
Tells the compiler in a function declaration that this function does not return.
Definition basedefs.h:386
uint32_t rtems_attribute
This type represents Classic API attributes.
Definition attr.h:96
uint32_t rtems_mode
This type represents a Classic API task mode set.
Definition modes.h:174
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition status.h:85
bool(*) rtems_task_visitor(rtems_tcb *, void *)
Visitor routines invoked by rtems_task_iterate() shall have this type.
Definition tasks.h:410
rtems_status_code rtems_task_suspend(rtems_id id)
Suspends the task.
Definition tasksuspend.c:45
rtems_status_code rtems_task_set_scheduler(rtems_id task_id, rtems_id scheduler_id, rtems_task_priority priority)
Sets the home scheduler for the task.
Definition tasksetscheduler.c:45
rtems_status_code rtems_task_construct(const rtems_task_config *config, rtems_id *id)
Constructs a task from the specified task configuration.
Definition taskconstruct.c:120
rtems_status_code rtems_task_set_affinity(rtems_id id, size_t cpusetsize, const cpu_set_t *cpuset)
Sets the processor affinity of the task.
Definition tasksetaffinity.c:47
rtems_status_code rtems_task_restart(rtems_id id, rtems_task_argument argument)
Restarts the task.
Definition taskrestart.c:46
rtems_status_code rtems_task_resume(rtems_id id)
Resumes the task.
Definition taskresume.c:45
rtems_status_code rtems_task_is_suspended(rtems_id id)
Checks if the task is suspended.
Definition taskissuspended.c:45
rtems_status_code rtems_task_wake_after(rtems_interval ticks)
Wakes up after a count of clock ticks have occurred or yields the processor.
Definition taskwakeafter.c:46
void rtems_task_iterate(rtems_task_visitor visitor, void *arg)
Iterates over all tasks and invokes the visitor routine for each task.
Definition taskiterate.c:45
rtems_status_code rtems_task_ident(rtems_name name, uint32_t node, rtems_id *id)
Identifies a task by the object name.
Definition taskident.c:47
RTEMS_NO_RETURN void rtems_task_exit(void)
Deletes the calling task.
Definition taskexit.c:44
rtems_status_code rtems_task_create(rtems_name name, rtems_task_priority initial_priority, size_t stack_size, rtems_mode initial_modes, rtems_attribute attribute_set, rtems_id *id)
Creates a task.
Definition taskcreate.c:66
rtems_status_code rtems_task_start(rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument)
Starts the task.
Definition taskstart.c:46
rtems_status_code rtems_task_get_priority(rtems_id task_id, rtems_id scheduler_id, rtems_task_priority *priority)
Gets the current priority of the task with respect to the scheduler.
Definition taskgetpriority.c:45
rtems_status_code rtems_task_mode(rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set)
Gets and optionally sets the mode of the calling task.
Definition taskmode.c:50
struct _Thread_Control rtems_tcb
This structure represents the TCB.
Definition tasks.h:400
rtems_task(*) rtems_task_entry(rtems_task_argument)
This type defines the task entry point of an RTEMS task.
Definition tasks.h:239
void rtems_task
This type defines the return type of task entry points.
Definition tasks.h:230
rtems_status_code rtems_task_get_scheduler(rtems_id task_id, rtems_id *scheduler_id)
Gets the home scheduler of the task.
Definition taskgetscheduler.c:44
rtems_id rtems_task_self(void)
Gets the task identifier of the calling task.
rtems_status_code rtems_task_wake_when(const rtems_time_of_day *time_buffer)
Wakes up when specified.
Definition taskwakewhen.c:48
rtems_status_code rtems_task_set_priority(rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority)
Sets the real priority or gets the current priority of the task.
Definition tasksetpriority.c:82
CPU_Uint32ptr rtems_task_argument
This integer type represents task argument values.
Definition tasks.h:100
rtems_status_code rtems_task_get_affinity(rtems_id id, size_t cpusetsize, cpu_set_t *cpuset)
Gets the processor affinity of the task.
Definition taskgetaffinity.c:47
rtems_status_code rtems_task_delete(rtems_id id)
Deletes the task.
Definition taskdelete.c:46
uint32_t rtems_name
This type represents Classic API object names.
Definition types.h:226
uint32_t rtems_task_priority
This integer type represents task priorities of the Classic API.
Definition types.h:257
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition types.h:94
Watchdog_Interval rtems_interval
This type represents clock tick intervals.
Definition types.h:114
rtems_task_priority _RTEMS_Maximum_priority(void)
Returns the maximum priority of the scheduler with index zero.
Definition rtemsmaxprio.c:44
uintptr_t CPU_Uint32ptr
Definition cpu.h:557
This header file provides the task modes API of the Task Manager.
This header file provides the status codes of Classic API directives and support functions.
This header file provides interfaces of the Object Handler which are used by the implementation and t...
This structure defines the properties of the Classic API user initialization task.
Definition tasks.h:249
rtems_task_entry entry_point
This member defines the entry point of the task.
Definition tasks.h:273
rtems_task_priority initial_priority
This member defines the initial task priority.
Definition tasks.h:263
rtems_name name
This member defines the task name.
Definition tasks.h:253
rtems_mode mode_set
This member defines the initial modes of the task.
Definition tasks.h:278
rtems_attribute attribute_set
This member defines the attribute set of the task.
Definition tasks.h:268
size_t stack_size
This member defines the task stack size in bytes.
Definition tasks.h:258
rtems_task_argument argument
This member defines the entry point argument of the task.
Definition tasks.h:283
This structure defines the configuration of a task constructed by rtems_task_construct().
Definition tasks.h:110
size_t maximum_thread_local_storage_size
This member defines the maximum thread-local storage size supported by the task storage area.
Definition tasks.h:166
rtems_task_priority initial_priority
This member defines the initial priority of the task.
Definition tasks.h:119
rtems_mode initial_modes
This member defines the initial modes of the task.
Definition tasks.h:183
size_t storage_size
This member defines size of the task storage area in bytes.
Definition tasks.h:141
void(*) storage_free(void *)
This member defines the optional handler to free the task storage area.
Definition tasks.h:178
void * storage_area
This member shall point to the task storage area begin.
Definition tasks.h:133
rtems_attribute attributes
This member defines the attributes of the task.
Definition tasks.h:188
rtems_name name
This member defines the name of the task.
Definition tasks.h:114
This type represents Classic API calendar times.
Definition types.h:266
This header file provides the interfaces of the Watchdog Handler related to watchdog ticks which are ...