Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/gtaskqueue.h
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
void taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *grptask, | void taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *grptask, | ||||
void *uniq, int irq, char *name); | void *uniq, int irq, char *name); | ||||
int taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *grptask, | int taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *grptask, | ||||
void *uniq, int cpu, int irq, char *name); | void *uniq, int cpu, int irq, char *name); | ||||
void taskqgroup_detach(struct taskqgroup *qgroup, struct grouptask *gtask); | void taskqgroup_detach(struct taskqgroup *qgroup, struct grouptask *gtask); | ||||
struct taskqgroup *taskqgroup_create(char *name); | struct taskqgroup *taskqgroup_create(char *name); | ||||
void taskqgroup_destroy(struct taskqgroup *qgroup); | void taskqgroup_destroy(struct taskqgroup *qgroup); | ||||
int taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride, bool ithread, int pri); | int taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride, bool ithread, int pri); | ||||
int taskqgroup_adjust_once(struct taskqgroup *qgroup, int cnt, int stride, bool ithread, int pri); | |||||
void taskqgroup_set_adjust(struct taskqgroup *qgroup, void (*adjust_func)(void*)); | |||||
#define TASK_ENQUEUED 0x1 | #define TASK_ENQUEUED 0x1 | ||||
#define TASK_SKIP_WAKEUP 0x2 | #define TASK_SKIP_WAKEUP 0x2 | ||||
#define GTASK_INIT(task, flags, priority, func, context) do { \ | #define GTASK_INIT(task, flags, priority, func, context) do { \ | ||||
(task)->ta_flags = flags; \ | (task)->ta_flags = flags; \ | ||||
(task)->ta_priority = (priority); \ | (task)->ta_priority = (priority); \ | ||||
Show All 11 Lines | |||||
extern struct taskqgroup *qgroup_##name | extern struct taskqgroup *qgroup_##name | ||||
#define TASKQGROUP_DEFINE(name, cnt, stride, intr, pri) \ | #define TASKQGROUP_DEFINE(name, cnt, stride, intr, pri) \ | ||||
\ | \ | ||||
struct taskqgroup *qgroup_##name; \ | struct taskqgroup *qgroup_##name; \ | ||||
\ | \ | ||||
static void \ | static void \ | ||||
taskqgroup_define_##name(void *arg) \ | taskqgroup_adjust_##name(void *arg) \ | ||||
{ \ | { \ | ||||
qgroup_##name = taskqgroup_create(#name); \ | int max = (intr) ? 1 : (cnt); \ | ||||
if (arg != NULL) { \ | |||||
uintptr_t maxcpu = (uintptr_t) arg; \ | |||||
max = maxcpu; \ | |||||
} \ | } \ | ||||
\ | \ | ||||
SYSINIT(taskqgroup_##name, SI_SUB_TASKQ, SI_ORDER_FIRST, \ | taskqgroup_adjust_once(qgroup_##name, max, (stride), (intr), (pri)); \ | ||||
taskqgroup_define_##name, NULL); \ | } \ | ||||
\ | \ | ||||
SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY, \ | |||||
taskqgroup_adjust_##name, NULL); \ | |||||
\ | |||||
static void \ | static void \ | ||||
taskqgroup_adjust_##name(void *arg) \ | taskqgroup_define_##name(void *arg) \ | ||||
{ \ | { \ | ||||
taskqgroup_adjust(qgroup_##name, (cnt), (stride), (intr), (pri)); \ | qgroup_##name = taskqgroup_create(#name); \ | ||||
taskqgroup_set_adjust(qgroup_##name, taskqgroup_adjust_##name); \ | |||||
} \ | } \ | ||||
\ | SYSINIT(taskqgroup_##name, SI_SUB_TASKQ, SI_ORDER_FIRST, \ | ||||
SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY, \ | taskqgroup_define_##name, NULL) | ||||
taskqgroup_adjust_##name, NULL) | |||||
TASKQGROUP_DECLARE(net); | TASKQGROUP_DECLARE(net); | ||||
TASKQGROUP_DECLARE(softirq); | TASKQGROUP_DECLARE(softirq); | ||||
#endif /* !_SYS_GTASKQUEUE_H_ */ | #endif /* !_SYS_GTASKQUEUE_H_ */ |