]> git.proxmox.com Git - mirror_spl-debian.git/blob - include/sys/thread.h
8424070e234e91f0d8414a2e995c671f966509c2
[mirror_spl-debian.git] / include / sys / thread.h
1 #ifndef _SPL_THREAD_H
2 #define _SPL_THREAD_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <linux/module.h>
9 #include <linux/mm.h>
10 #include <linux/spinlock.h>
11 #include <linux/kthread.h>
12 #include <sys/types.h>
13 #include <sys/sysmacros.h>
14
15 /*
16 * Thread interfaces
17 */
18 #define TP_MAGIC 0x53535353
19
20 #define TS_SLEEP TASK_INTERRUPTIBLE
21 #define TS_RUN TASK_RUNNING
22 #define TS_ZOMB EXIT_ZOMBIE
23 #define TS_STOPPED TASK_STOPPED
24 #if 0
25 #define TS_FREE 0x00 /* No clean linux mapping */
26 #define TS_ONPROC 0x04 /* No clean linux mapping */
27 #define TS_WAIT 0x20 /* No clean linux mapping */
28 #endif
29
30 typedef void (*thread_func_t)(void *);
31
32 #define thread_create(stk, stksize, func, arg, len, pp, state, pri) \
33 __thread_create(stk, stksize, (thread_func_t)func, \
34 #func, arg, len, pp, state, pri)
35 #define thread_exit() __thread_exit()
36 #define curthread get_current()
37
38 extern kthread_t *__thread_create(caddr_t stk, size_t stksize,
39 thread_func_t func, const char *name,
40 void *args, size_t len, int *pp,
41 int state, pri_t pri);
42 extern void __thread_exit(void);
43
44 #ifdef __cplusplus
45 }
46 #endif
47
48 #endif /* _SPL_THREAD_H */
49