RTEMS CPU Kit with SuperCore  4.11.3
tasks.h
Go to the documentation of this file.
1 
30 /*
31  * COPYRIGHT (c) 1989-2014.
32  * On-Line Applications Research Corporation (OAR).
33  *
34  * The license and distribution terms for this file may be
35  * found in the file LICENSE in this distribution or at
36  * http://www.rtems.org/license/LICENSE.
37  */
38 
39 #ifndef _RTEMS_RTEMS_TASKS_H
40 #define _RTEMS_RTEMS_TASKS_H
41 
42 #include <rtems/score/object.h>
43 #include <rtems/score/thread.h>
44 #include <rtems/rtems/types.h>
45 #include <rtems/rtems/event.h>
46 #include <rtems/rtems/asr.h>
47 #include <rtems/rtems/attr.h>
48 #include <rtems/rtems/status.h>
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
68 #define RTEMS_SELF OBJECTS_ID_OF_SELF
69 
74 #define RTEMS_YIELD_PROCESSOR WATCHDOG_NO_TIMEOUT
75 
80 
87 #define RTEMS_NO_PRIORITY RTEMS_CURRENT_PRIORITY
88 
93 #define RTEMS_MINIMUM_PRIORITY (PRIORITY_MINIMUM + 1)
94 
105 #define RTEMS_MAXIMUM_PRIORITY PRIORITY_MAXIMUM
106 
111 #define RTEMS_CURRENT_PRIORITY PRIORITY_MINIMUM
112 
114 #define RTEMS_NOTEPAD_FIRST 0
115 
116 #define RTEMS_NOTEPAD_0 0
117 
118 #define RTEMS_NOTEPAD_1 1
119 
120 #define RTEMS_NOTEPAD_2 2
121 
122 #define RTEMS_NOTEPAD_3 3
123 
124 #define RTEMS_NOTEPAD_4 4
125 
126 #define RTEMS_NOTEPAD_5 5
127 
128 #define RTEMS_NOTEPAD_6 6
129 
130 #define RTEMS_NOTEPAD_7 7
131 
132 #define RTEMS_NOTEPAD_8 8
133 
134 #define RTEMS_NOTEPAD_9 9
135 
136 #define RTEMS_NOTEPAD_10 10
137 
138 #define RTEMS_NOTEPAD_11 11
139 
140 #define RTEMS_NOTEPAD_12 12
141 
142 #define RTEMS_NOTEPAD_13 13
143 
144 #define RTEMS_NOTEPAD_14 14
145 
146 #define RTEMS_NOTEPAD_15 15
147 
148 #define RTEMS_NOTEPAD_LAST RTEMS_NOTEPAD_15
149 
151 #define RTEMS_NUMBER_NOTEPADS (RTEMS_NOTEPAD_LAST+1)
152 
157 
161 typedef void rtems_task;
162 
167 
173  );
174 
181 typedef struct {
185  size_t stack_size;
187  rtems_task_priority initial_priority;
195  rtems_task_argument argument;
197 
219  rtems_name name,
220  rtems_task_priority initial_priority,
221  size_t stack_size,
222  rtems_mode initial_modes,
223  rtems_attribute attribute_set,
224  rtems_id *id
225 );
226 
248  rtems_name name,
249  uint32_t node,
250  rtems_id *id
251 );
252 
268  rtems_id id
269 );
270 
287  rtems_id id,
288  uint32_t notepad,
289  uint32_t *note
291 
310  rtems_id id,
311  uint32_t notepad,
312  uint32_t note
314 
331  rtems_mode mode_set,
332  rtems_mode mask,
333  rtems_mode *previous_mode_set
334 );
335 
349  rtems_id id,
350  uint32_t arg
351 );
352 
367  rtems_id id
368 );
369 
383  rtems_id id
384 );
385 
402  rtems_id id,
403  rtems_task_priority new_priority,
404  rtems_task_priority *old_priority
405 );
406 
417  rtems_id id,
418  rtems_task_entry entry_point,
419  rtems_task_argument argument
420 );
421 
434  rtems_time_of_day *time_buffer
435 );
436 
448  rtems_interval ticks
449 );
450 
458  rtems_id id
459 );
460 
461 #if !defined(RTEMS_SMP)
462 
472  rtems_id tid,
473  void **ptr,
474  void (*dtor)(void *)
476 
487  rtems_id tid,
488  void **ptr,
489  void **result
491 
502  rtems_id tid,
503  void **ptr
505 #endif
506 
507 #if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
508 
525 rtems_status_code rtems_task_get_affinity(
526  rtems_id id,
527  size_t cpusetsize,
528  cpu_set_t *cpuset
529 );
530 
558 rtems_status_code rtems_task_set_affinity(
559  rtems_id id,
560  size_t cpusetsize,
561  const cpu_set_t *cpuset
562 );
563 #endif
564 
577  rtems_id task_id,
578  rtems_id *scheduler_id
579 );
580 
597  rtems_id task_id,
598  rtems_id scheduler_id
599 );
600 
607 
623  rtems_name name,
624  rtems_id *id
625 );
626 
627 #if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
628 
644 rtems_status_code rtems_scheduler_get_processor_set(
645  rtems_id scheduler_id,
646  size_t cpusetsize,
647  cpu_set_t *cpuset
648 );
649 #endif
650 
661 typedef struct {
668 
673 
681  uint32_t Notepads[ RTEMS_ZERO_LENGTH_ARRAY ] RTEMS_COMPILER_DEPRECATED_ATTRIBUTE;
683 
691 extern void (*_RTEMS_tasks_Initialize_user_tasks_p)(void);
692 
706 extern void _RTEMS_tasks_Initialize_user_tasks_body( void );
707 
708 #ifdef __cplusplus
709 }
710 #endif
711 
712 #endif
713 /* end of include file */
Constants and Structures Associated with the Object Handler.
uint32_t rtems_attribute
This defines the type used to contain Classic API attributes.
Definition: attr.h:44
rtems_status_code rtems_task_wake_after(rtems_interval ticks)
RTEMS Task Wake After.
Definition: taskwakeafter.c:25
size_t stack_size
This is the Initialization Task&#39;s stack size.
Definition: tasks.h:185
rtems_status_code rtems_task_set_note(rtems_id id, uint32_t notepad, uint32_t note)
RTEMS Set Task Note.
Definition: tasksetnote.c:30
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:80
This is the API specific information required by each thread for the RTEMS API to function correctly...
Definition: tasks.h:661
rtems_status_code rtems_task_get_scheduler(rtems_id task_id, rtems_id *scheduler_id)
Gets the scheduler of a task.
Definition: taskgetscheduler.c:23
rtems_status_code rtems_scheduler_ident(rtems_name name, rtems_id *id)
Identifies a scheduler by its name.
Definition: schedulerident.c:23
rtems_status_code rtems_task_variable_delete(rtems_id tid, void **ptr)
RTEMS Delete Task Variable.
Definition: taskvariabledelete.c:32
void rtems_task
The following defines the "return type" of an RTEMS task.
Definition: tasks.h:161
rtems_name name
This is the Initialization Task&#39;s name.
Definition: tasks.h:183
Definition: event.h:510
rtems_status_code rtems_task_get_note(rtems_id id, uint32_t notepad, uint32_t *note)
RTEMS Get Task Node.
Definition: taskgetnote.c:30
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:31
Event_Control System_event
This field contains the system event control for this task.
Definition: tasks.h:665
rtems_task_argument argument
This is the Initialization Task&#39;s argument.
Definition: tasks.h:195
rtems_attribute attribute_set
This is the Initialization Task&#39;s attributes.
Definition: tasks.h:189
rtems_status_code rtems_task_mode(rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set)
RTEMS Task Mode.
Definition: taskmode.c:28
Event_Control Event
This field contains the event control for this task.
Definition: tasks.h:663
Constants and Structures Related with the Thread Control Block.
Watchdog_Interval rtems_interval
Used to manage and manipulate intervals specified by clock ticks.
Definition: types.h:119
uint32_t Priority_Control
The following type defines the control block used to manage thread priorities.
Definition: priority.h:56
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:30
void _RTEMS_tasks_Initialize_user_tasks_body(void)
_RTEMS_tasks_Initialize_user_tasks_body
Definition: taskinitusers.c:44
Data structure to manage and manipulate calendar time.
Definition: types.h:133
ASR_Information Signal
This field contains the Classic API Signal information for this task.
Definition: tasks.h:667
Priority_Control rtems_task_priority
Define the type for an RTEMS API task priority.
Definition: tasks.h:79
rtems_status_code
Classic API Status.
Definition: status.h:46
uint32_t rtems_name
Classic API object name type.
Definition: types.h:74
This structure defines the Thread Control Block (TCB).
Definition: thread.h:671
rtems_task_priority initial_priority
This is the Initialization Task&#39;s priority.
Definition: tasks.h:187
Thread action.
Definition: thread.h:480
rtems_task_entry entry_point
This is the Initialization Task&#39;s entry point.
Definition: tasks.h:191
rtems_status_code rtems_task_restart(rtems_id id, uint32_t arg)
RTEMS Task Restart.
Definition: taskrestart.c:24
void(* _RTEMS_tasks_Initialize_user_tasks_p)(void)
When the user configures a set of Classic API initialization tasks, This variable will point to the m...
#define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE
Instructs the compiler to issue a warning whenever a variable or function with this attribute will be...
Definition: basedefs.h:186
rtems_status_code rtems_task_delete(rtems_id id)
RTEMS Delete Task.
Definition: taskdelete.c:26
rtems_status_code rtems_task_set_scheduler(rtems_id task_id, rtems_id scheduler_id)
Sets the scheduler of a task.
Definition: tasksetscheduler.c:23
rtems_status_code rtems_task_start(rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument)
RTEMS Start Task.
Definition: taskstart.c:41
Thread_Control rtems_tcb
External API name for Thread_Control.
Definition: tasks.h:156
rtems_status_code rtems_task_variable_add(rtems_id tid, void **ptr, void(*dtor)(void *))
RTEMS Add Task Variable.
Definition: taskvariableadd.c:32
rtems_status_code rtems_task_is_suspended(rtems_id id)
rtems_task_is_suspended
Definition: taskissuspended.c:39
The following defines the control structure used to manage signals.
Definition: asr.h:65
CPU_Uint32ptr Thread_Entry_numeric_type
Type of the numeric argument of a thread entry function with at least one numeric argument...
Definition: thread.h:110
Thread_Entry_numeric_type rtems_task_argument
The following defines the argument to an RTEMS task.
Definition: tasks.h:166
rtems_id rtems_task_self(void)
RTEMS Get Self Task Id.
Definition: taskself.c:24
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:24
rtems_task(* rtems_task_entry)(rtems_task_argument)
The following defines the type for the entry point of an RTEMS task.
Definition: tasks.h:171
rtems_mode mode_set
This is the Initialization Task&#39;s initial mode.
Definition: tasks.h:193
Thread_Action Signal_action
Signal post-switch action in case signals are pending.
Definition: tasks.h:672
The following records define the Initialization Tasks Table.
Definition: tasks.h:181
Modes_Control rtems_mode
Task mode type.
Definition: types.h:167
rtems_status_code rtems_task_variable_get(rtems_id tid, void **ptr, void **result)
Get a per-task variable.
Definition: taskvariableget.c:32
rtems_status_code rtems_task_suspend(rtems_id id)
RTEMS Suspend Task.
Definition: tasksuspend.c:24
rtems_status_code rtems_task_resume(rtems_id id)
RTEMS Resume Task.
Definition: taskresume.c:24