19 #ifndef _VXWORKS_TASKLIB_H 20 #define _VXWORKS_TASKLIB_H 22 #include <copperplate/threadobj.h> 23 #include <copperplate/registry.h> 24 #include <copperplate/cluster.h> 25 #include <vxworks/taskLib.h> 27 struct wind_task_args {
42 pthread_mutex_t safelock;
44 struct WIND_TCB priv_tcb;
45 char name[XNOBJECT_NAME_LEN];
46 struct wind_task_args args;
47 struct threadobj thobj;
49 struct clusterobj cobj;
53 #define do_each_wind_task(__task, __action) \ 57 push_cleanup_lock(&wind_task_lock); \ 58 read_lock(&wind_task_lock); \ 59 if (!pvlist_empty(&wind_task_list)) \ 60 pvlist_for_each_entry(__task, &wind_task_list, next) { \ 61 threadobj_lock(&(__task)->thobj); \ 63 if (__ret == -EIDRM) \ 65 threadobj_unlock(&(__task)->thobj); \ 69 read_unlock(&wind_task_lock); \ 70 pop_cleanup_lock(&wind_task_lock); \ 75 int wind_task_get_priority(
struct wind_task *task);
77 #define task_magic 0x1a2b3c4d 79 static inline struct wind_task *wind_task_current(
void)
81 struct threadobj *thobj = threadobj_current();
84 threadobj_get_magic(thobj) != task_magic)
87 return container_of(thobj,
struct wind_task, thobj);
90 struct wind_task *get_wind_task(TASK_ID tid);
92 struct wind_task *get_wind_task_or_self(TASK_ID tid);
94 void put_wind_task(
struct wind_task *task);
96 int get_task_status(
struct wind_task *task);
98 extern struct cluster wind_task_table;
100 extern struct pvlistobj wind_task_list;
102 extern pthread_mutex_t wind_task_lock;
104 extern int wind_time_slice;