1#ifndef _LINUX_KTHREAD_H
2#define _LINUX_KTHREAD_H
3
4#include <linux/err.h>
5#include <linux/sched.h>
6
7struct task_struct *kthread_create(int (*threadfn)(void *data),
8 void *data,
9 const char namefmt[], ...)
10 __attribute__((format(printf, 3, 4)));
11
12
13
14
15
16
17
18
19
20
21#define kthread_run(threadfn, data, namefmt, ...) \
22({ \
23 struct task_struct *__k \
24 = kthread_create(threadfn, data, namefmt, ## __VA_ARGS__); \
25 if (!IS_ERR(__k)) \
26 wake_up_process(__k); \
27 __k; \
28})
29
30void kthread_bind(struct task_struct *k, unsigned int cpu);
31int kthread_stop(struct task_struct *k);
32int kthread_should_stop(void);
33
34int kthreadd(void *unused);
35extern struct task_struct *kthreadd_task;
36
37#endif
38