xref: /openbsd/sys/dev/pci/drm/include/linux/kthread.h (revision 73471bf0)
1 /* Public domain. */
2 
3 #ifndef _LINUX_KTHREAD_H
4 #define _LINUX_KTHREAD_H
5 
6 /* both for printf */
7 #include <sys/types.h>
8 #include <sys/systm.h>
9 #include <sys/task.h>
10 
11 struct proc *kthread_run(int (*)(void *), void *, const char *);
12 void 	kthread_park(struct proc *);
13 void 	kthread_unpark(struct proc *);
14 int	kthread_should_park(void);
15 void 	kthread_parkme(void);
16 void	kthread_stop(struct proc *);
17 int	kthread_should_stop(void);
18 
19 struct kthread_work {
20 	struct task	 task;
21 	struct taskq	*tq;
22 };
23 
24 struct kthread_worker {
25 	struct taskq	*tq;
26 };
27 
28 struct kthread_worker *
29 	kthread_create_worker(unsigned int, const char *, ...);
30 void	kthread_destroy_worker(struct kthread_worker *);
31 void	kthread_init_work(struct kthread_work *, void (*)(struct kthread_work *));
32 bool	kthread_queue_work(struct kthread_worker *, struct kthread_work *);
33 bool	kthread_cancel_work_sync(struct kthread_work *);
34 void	kthread_flush_work(struct kthread_work *);
35 void	kthread_flush_worker(struct kthread_worker *);
36 
37 #endif
38