RTEMS  5.0.0
tasks.h
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 1989-2014.
11  * On-Line Applications Research Corporation (OAR).
12  *
13  * The license and distribution terms for this file may be
14  * found in the file LICENSE in this distribution or at
15  * http://www.rtems.org/license/LICENSE.
16  */
17 
18 #ifndef _RTEMS_RTEMS_TASKS_H
19 #define _RTEMS_RTEMS_TASKS_H
20 
21 #include <rtems/rtems/attr.h>
22 #include <rtems/rtems/status.h>
23 #include <rtems/rtems/types.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
43 #define RTEMS_SELF OBJECTS_ID_OF_SELF
44 
49 #define RTEMS_YIELD_PROCESSOR WATCHDOG_NO_TIMEOUT
50 
54 typedef uint32_t rtems_task_priority;
55 
62 #define RTEMS_NO_PRIORITY RTEMS_CURRENT_PRIORITY
63 
68 #define RTEMS_MINIMUM_PRIORITY 1
69 
70 rtems_task_priority _RTEMS_Maximum_priority( void );
71 
82 #define RTEMS_MAXIMUM_PRIORITY _RTEMS_Maximum_priority()
83 
88 #define RTEMS_CURRENT_PRIORITY 0
89 
90 struct _Thread_Control;
91 
95 typedef struct _Thread_Control rtems_tcb;
96 
100 typedef void rtems_task;
101 
106 
112  );
113 
120 typedef struct {
124  size_t stack_size;
126  rtems_task_priority initial_priority;
134  rtems_task_argument argument;
136 
158  rtems_name name,
159  rtems_task_priority initial_priority,
160  size_t stack_size,
161  rtems_mode initial_modes,
162  rtems_attribute attribute_set,
163  rtems_id *id
164 );
165 
187  rtems_name name,
188  uint32_t node,
189  rtems_id *id
190 );
191 
207  rtems_id id
208 );
209 
210 void rtems_task_exit( void ) RTEMS_NO_RETURN;
211 
228  rtems_mode mode_set,
229  rtems_mode mask,
230  rtems_mode *previous_mode_set
231 );
232 
246  rtems_id id,
247  rtems_task_argument argument
248 );
249 
264  rtems_id id
265 );
266 
280  rtems_id id
281 );
282 
299  rtems_id id,
300  rtems_task_priority new_priority,
301  rtems_task_priority *old_priority
302 );
303 
328  rtems_id task_id,
329  rtems_id scheduler_id,
330  rtems_task_priority *priority
331 );
332 
343  rtems_id id,
344  rtems_task_entry entry_point,
345  rtems_task_argument argument
346 );
347 
360  rtems_time_of_day *time_buffer
361 );
362 
374  rtems_interval ticks
375 );
376 
384  rtems_id id
385 );
386 
405  rtems_id id,
406  size_t cpusetsize,
407  cpu_set_t *cpuset
408 );
409 
438  rtems_id id,
439  size_t cpusetsize,
440  const cpu_set_t *cpuset
441 );
442 
455  rtems_id task_id,
456  rtems_id *scheduler_id
457 );
458 
483  rtems_id task_id,
484  rtems_id scheduler_id,
485  rtems_task_priority priority
486 );
487 
494 
506 typedef bool ( *rtems_task_visitor )( rtems_tcb *tcb, void *arg );
507 
522 void rtems_task_iterate(
523  rtems_task_visitor visitor,
524  void *arg
525 );
526 
540  rtems_name name,
541  rtems_id *id
542 );
543 
557  uint32_t cpu_index,
558  rtems_id *id
559 );
560 
581  size_t cpusetsize,
582  const cpu_set_t *cpuset,
583  rtems_id *id
584 );
585 
603  rtems_id scheduler_id,
604  size_t cpusetsize,
605  cpu_set_t *cpuset
606 );
607 
628  rtems_id scheduler_id,
629  uint32_t cpu_index
630 );
631 
653  rtems_id scheduler_id,
654  uint32_t cpu_index
655 );
656 
668  rtems_id scheduler_id,
669  rtems_task_priority *priority
670 );
671 
674 #ifdef __cplusplus
675 }
676 #endif
677 
678 #endif
679 /* end of include file */
bool(* rtems_task_visitor)(rtems_tcb *tcb, void *arg)
Task visitor.
Definition: tasks.h:506
uint32_t rtems_attribute
Definition: attr.h:41
rtems_status_code rtems_task_wake_after(rtems_interval ticks)
RTEMS Task Wake After.
Definition: taskwakeafter.c:25
rtems_status_code rtems_task_set_affinity(rtems_id id, size_t cpusetsize, const cpu_set_t *cpuset)
Sets the processor affinity set of a task.
Definition: tasksetaffinity.c:25
size_t stack_size
Definition: tasks.h:124
Watchdog_Interval rtems_interval
Used to manage and manipulate intervals specified by clock ticks.
Definition: types.h:127
rtems_status_code rtems_task_get_scheduler(rtems_id task_id, rtems_id *scheduler_id)
Gets the scheduler of a task.
Definition: taskgetscheduler.c:22
rtems_status_code rtems_scheduler_ident(rtems_name name, rtems_id *id)
Identifies a scheduler by its name.
Definition: schedulerident.c:22
uint32_t rtems_name
Classic API object name type.
Definition: types.h:77
void rtems_task
Definition: tasks.h:100
rtems_name name
Definition: tasks.h:122
rtems_status_code rtems_task_wake_when(rtems_time_of_day *time_buffer)
RTEMS Task Wake When.
Definition: taskwakewhen.c:27
rtems_status_code rtems_task_ident(rtems_name name, uint32_t node, rtems_id *id)
RTEMS Task Name to Id.
Definition: taskident.c:29
rtems_task_argument argument
Definition: tasks.h:134
rtems_status_code rtems_scheduler_get_processor_set(rtems_id scheduler_id, size_t cpusetsize, cpu_set_t *cpuset)
Gets the set of processors owned by the specified scheduler instance.
Definition: schedulergetprocessorset.c:22
rtems_attribute attribute_set
Definition: tasks.h:128
rtems_status_code rtems_task_mode(rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set)
RTEMS Task Mode.
Definition: taskmode.c:29
rtems_status_code rtems_task_get_affinity(rtems_id id, size_t cpusetsize, cpu_set_t *cpuset)
Gets the processor affinity set of a task.
Definition: taskgetaffinity.c:25
rtems_status_code rtems_scheduler_ident_by_processor_set(size_t cpusetsize, const cpu_set_t *cpuset, rtems_id *id)
Identifies a scheduler by a processor set.
Definition: scheduleridentbyprocessorset.c:23
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)
RTEMS Task Create.
Definition: taskcreate.c:33
Data structure to manage and manipulate calendar time.
Definition: types.h:141
rtems_status_code
Classic API Status.
Definition: status.h:43
Definition: thread.h:728
rtems_task_priority initial_priority
Definition: tasks.h:126
void rtems_task_iterate(rtems_task_visitor visitor, void *arg)
Iterates over all tasks in the system.
Definition: taskiterate.c:23
rtems_task_entry entry_point
Definition: tasks.h:130
#define RTEMS_NO_RETURN
Definition: basedefs.h:101
rtems_status_code rtems_task_delete(rtems_id id)
RTEMS Delete Task.
Definition: taskdelete.c:24
rtems_status_code rtems_scheduler_add_processor(rtems_id scheduler_id, uint32_t cpu_index)
Adds a processor to the set of processors owned by the specified scheduler instance.
Definition: scheduleraddprocessor.c:24
rtems_status_code rtems_task_start(rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument)
RTEMS Start Task.
Definition: taskstart.c:24
rtems_status_code rtems_task_set_scheduler(rtems_id task_id, rtems_id scheduler_id, rtems_task_priority priority)
Sets the scheduler instance of a task.
Definition: tasksetscheduler.c:23
rtems_status_code rtems_task_is_suspended(rtems_id id)
rtems_task_is_suspended
Definition: taskissuspended.c:24
rtems_id rtems_task_self(void)
RTEMS Get Self Task Id.
Definition: taskself.c:23
rtems_status_code rtems_task_set_priority(rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority)
RTEMS Set Task Priority.
Definition: tasksetpriority.c:61
rtems_task(* rtems_task_entry)(rtems_task_argument)
Definition: tasks.h:110
CPU_Uint32ptr rtems_task_argument
Definition: tasks.h:105
uintptr_t CPU_Uint32ptr
Definition: cpu.h:668
rtems_mode mode_set
Definition: tasks.h:132
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83
rtems_status_code rtems_scheduler_ident_by_processor(uint32_t cpu_index, rtems_id *id)
Identifies a scheduler by a processor index.
Definition: scheduleridentbyprocessor.c:23
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 specified task with respect to the specified scheduler instance...
Definition: taskgetpriority.c:23
rtems_status_code rtems_task_restart(rtems_id id, rtems_task_argument argument)
RTEMS Task Restart.
Definition: taskrestart.c:24
Definition: tasks.h:120
uint32_t rtems_mode
Definition: modes.h:41
rtems_status_code rtems_scheduler_remove_processor(rtems_id scheduler_id, uint32_t cpu_index)
Removes a processor from set of processors owned by the specified scheduler instance.
Definition: schedulerremoveprocessor.c:64
rtems_status_code rtems_task_suspend(rtems_id id)
RTEMS Suspend Task.
Definition: tasksuspend.c:24
rtems_status_code rtems_scheduler_get_maximum_priority(rtems_id scheduler_id, rtems_task_priority *priority)
Gets the maximum task priority of the specified scheduler instance.
Definition: schedulergetmaxprio.c:35
rtems_status_code rtems_task_resume(rtems_id id)
RTEMS Resume Task.
Definition: taskresume.c:24
uint32_t rtems_task_priority
Definition: tasks.h:54