19 #ifndef _ALCHEMY_TASK_H
20 #define _ALCHEMY_TASK_H
23 #include <semaphore.h>
25 #include <boilerplate/list.h>
26 #include <copperplate/syncobj.h>
27 #include <copperplate/threadobj.h>
28 #include <copperplate/registry.h>
29 #include <copperplate/cluster.h>
30 #include <alchemy/task.h>
33 char name[XNOBJECT_NAME_LEN];
37 struct syncobj sobj_msg;
39 struct threadobj thobj;
40 struct clusterobj cobj;
41 void (*entry)(
void *arg);
47 struct alchemy_task_wait {
48 struct RT_TASK_MCB request;
49 struct RT_TASK_MCB reply;
52 #define task_magic 0x8282ebeb
54 static inline struct alchemy_task *alchemy_task_current(
void)
56 struct threadobj *thobj = threadobj_current();
59 threadobj_get_magic(thobj) != task_magic)
62 return container_of(thobj,
struct alchemy_task, thobj);
65 struct alchemy_task *get_alchemy_task(RT_TASK *task,
int *err_r);
67 struct alchemy_task *get_alchemy_task_or_self(RT_TASK *task,
int *err_r);
69 void put_alchemy_task(
struct alchemy_task *tcb);
71 static inline int check_task_priority(
int prio)
73 return prio < T_LOPRIO || prio > T_HIPRIO ? -EINVAL : 0;
76 extern struct syncluster alchemy_task_table;