Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/_task.h
Show All 36 Lines | |||||
* field of struct task and the second argument is a count of how many | * field of struct task and the second argument is a count of how many | ||||
* times the task was enqueued before the call to taskqueue_run(). | * times the task was enqueued before the call to taskqueue_run(). | ||||
* | * | ||||
* List of locks | * List of locks | ||||
* (c) const after init | * (c) const after init | ||||
* (q) taskqueue lock | * (q) taskqueue lock | ||||
*/ | */ | ||||
typedef void task_fn_t(void *context, int pending); | typedef void task_fn_t(void *context, int pending); | ||||
typedef void gtask_fn_t(void *context); | |||||
struct task { | struct task { | ||||
STAILQ_ENTRY(task) ta_link; /* (q) link for queue */ | STAILQ_ENTRY(task) ta_link; /* (q) link for queue */ | ||||
uint16_t ta_pending; /* (q) count times queued */ | uint16_t ta_pending; /* (q) count times queued */ | ||||
u_short ta_priority; /* (c) Priority */ | u_short ta_priority; /* (c) Priority */ | ||||
task_fn_t *ta_func; /* (c) task handler */ | task_fn_t *ta_func; /* (c) task handler */ | ||||
void *ta_context; /* (c) argument for handler */ | void *ta_context; /* (c) argument for handler */ | ||||
}; | }; | ||||
struct gtask { | |||||
STAILQ_ENTRY(gtask) ta_link; /* (q) link for queue */ | |||||
uint16_t ta_flags; /* (q) state flags */ | |||||
u_short ta_priority; /* (c) Priority */ | |||||
gtask_fn_t *ta_func; /* (c) task handler */ | |||||
void *ta_context; /* (c) argument for handler */ | |||||
}; | |||||
struct grouptask { | struct grouptask { | ||||
struct task gt_task; | struct gtask gt_task; | ||||
void *gt_taskqueue; | void *gt_taskqueue; | ||||
LIST_ENTRY(grouptask) gt_list; | LIST_ENTRY(grouptask) gt_list; | ||||
void *gt_uniq; | void *gt_uniq; | ||||
char *gt_name; | char *gt_name; | ||||
int16_t gt_irq; | int16_t gt_irq; | ||||
int16_t gt_cpu; | int16_t gt_cpu; | ||||
}; | }; | ||||
#endif /* !_SYS__TASK_H_ */ | #endif /* !_SYS__TASK_H_ */ |