18 #ifndef _XENOMAI_ALCHEMY_TASK_H 19 #define _XENOMAI_ALCHEMY_TASK_H 21 #include <sys/types.h> 23 #include <xeno_config.h> 24 #include <boilerplate/list.h> 25 #include <copperplate/threadobj.h> 26 #include <alchemy/timer.h> 27 #include <alchemy/compat.h> 39 #define T_LOCK __THREAD_M_LOCK 41 #define T_WARNSW __THREAD_M_WARNSW 42 #define T_CONFORMING __THREAD_M_CONFORMING 43 #define T_JOINABLE __THREAD_M_SPARE0 50 typedef struct RT_TASK RT_TASK;
56 dref_type(
void *) __dref;
62 typedef struct RT_TASK_MCB RT_TASK_MCB;
79 struct threadobj_stat stat;
83 char name[XNOBJECT_NAME_LEN];
92 #define NO_ALCHEMY_TASK ((RT_TASK){ 0, 0 }) 107 const cpu_set_t *cpus);
110 void (*entry)(
void *arg),
114 int stksize,
int prio,
int mode,
115 void (*entry)(
void *arg),
126 RTIME idate, RTIME period));
157 RT_TASK_MCB *mcb_s, RT_TASK_MCB *mcb_r,
158 const struct timespec *abs_timeout);
162 RT_TASK_MCB *mcb_s, RT_TASK_MCB *mcb_r,
167 alchemy_abs_timeout(timeout, &ts));
172 RT_TASK_MCB *mcb_s, RT_TASK_MCB *mcb_r,
177 alchemy_rel_timeout(timeout, &ts));
181 const struct timespec *abs_timeout);
188 alchemy_abs_timeout(timeout, &ts));
196 alchemy_rel_timeout(timeout, &ts));
203 const char *name, RTIME timeout);
int rt_task_start(RT_TASK *task, void(*entry)(void *arg), void *arg)
Start a real-time task.
Definition: task.c:618
int rt_task_unblock(RT_TASK *task)
Unblock a real-time task.
Definition: task.c:1332
int rt_task_create(RT_TASK *task, const char *name, int stksize, int prio, int mode)
Create a task with Alchemy personality.
Definition: task.c:409
int rt_task_join(RT_TASK *task)
Wait on the termination of a real-time task.
Definition: task.c:534
static ssize_t rt_task_send(RT_TASK *task, RT_TASK_MCB *mcb_s, RT_TASK_MCB *mcb_r, RTIME timeout)
Send a message to a real-time task (with relative scalar timeout).
Definition: task.h:171
static int rt_task_receive_until(RT_TASK_MCB *mcb_r, RTIME timeout)
Receive a message from a real-time task (with absolute scalar timeout).
Definition: task.h:184
int rt_task_inquire(RT_TASK *task, RT_TASK_INFO *info)
Retrieve information about a real-time task.
Definition: task.c:1540
int rt_task_same(RT_TASK *task1, RT_TASK *task2)
Compare real-time task descriptors.
Definition: task.c:1083
RT_TASK * rt_task_self(void)
Retrieve the current task descriptor.
Definition: task.c:1208
static int rt_task_receive(RT_TASK_MCB *mcb_r, RTIME timeout)
Receive a message from a real-time task (with relative scalar timeout).
Definition: task.h:192
int rt_task_yield(void)
Manual round-robin.
Definition: task.c:1301
int rt_task_slice(RT_TASK *task, RTIME quantum)
Set a task's round-robin quantum.
Definition: task.c:1387
int rt_task_delete(RT_TASK *task)
Delete a real-time task.
Definition: task.c:476
static ssize_t rt_task_send_until(RT_TASK *task, RT_TASK_MCB *mcb_s, RT_TASK_MCB *mcb_r, RTIME timeout)
Send a message to a real-time task (with absolute scalar timeout).
Definition: task.h:161
int rt_task_set_mode(int clrmask, int setmask, int *mode_r)
Change the current task mode.
Definition: task.c:1484
int rt_task_receive_timed(RT_TASK_MCB *mcb_r, const struct timespec *abs_timeout)
Receive a message from a real-time task.
Definition: task.c:1899
int rt_task_sleep(RTIME delay)
Delay the current real-time task (with relative delay).
Definition: task.c:994
int rt_task_wait_period(unsigned long *overruns_r)
Wait for the next periodic release point.
Definition: task.c:912
Task status descriptor.
Definition: task.h:71
int rt_task_reply(int flowid, RT_TASK_MCB *mcb_s)
Reply to a remote task message.
Definition: task.c:2018
pid_t pid
Host pid.
Definition: task.h:87
int prio
Task priority.
Definition: task.h:75
ssize_t rt_task_send_timed(RT_TASK *task, RT_TASK_MCB *mcb_s, RT_TASK_MCB *mcb_r, const struct timespec *abs_timeout)
Send a message to a real-time task.
Definition: task.c:1700
int rt_task_set_affinity(RT_TASK *task, const cpu_set_t *cpus)
Set CPU affinity of real-time task.
Definition: task.c:569
int rt_task_sleep_until(RTIME date)
Delay the current real-time task (with absolute wakeup date).
Definition: task.c:952
int rt_task_bind(RT_TASK *task, const char *name, RTIME timeout)
Bind to a task.
Definition: task.c:2130
char name[XNOBJECT_NAME_LEN]
Name of task.
Definition: task.h:83
int rt_task_unbind(RT_TASK *task)
Unbind from a task.
Definition: task.c:2152
int rt_task_suspend(RT_TASK *task)
Suspend a real-time task.
Definition: task.c:1130
int rt_task_set_priority(RT_TASK *task, int prio)
Change the base priority of a real-time task.
Definition: task.c:1254
int rt_task_resume(RT_TASK *task)
Resume a real-time task.
Definition: task.c:1174
int rt_task_shadow(RT_TASK *task, const char *name, int prio, int mode)
Turn caller into a real-time task.
Definition: task.c:713
int rt_task_set_periodic(RT_TASK *task, RTIME idate, RTIME period)
Make a real-time task periodic.
Definition: task.c:828
int rt_task_spawn(RT_TASK *task, const char *name, int stksize, int prio, int mode, void(*entry)(void *arg), void *arg)
Create and start a real-time task.
Definition: task.c:1052