]> git.proxmox.com Git - mirror_spl-debian.git/blob - include/spl-thread.h
Minor nit, SOLARIS should be SPL
[mirror_spl-debian.git] / include / spl-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 "spl-types.h"
12 #include "spl-generic.h"
13
14 /*
15 * Thread interfaces
16 */
17 #define TP_MAGIC 0x53535353
18
19 #define TS_SLEEP TASK_INTERRUPTIBLE
20 #define TS_RUN TASK_RUNNING
21 #define TS_ZOMB EXIT_ZOMBIE
22 #define TS_STOPPED TASK_STOPPED
23 #if 0
24 #define TS_FREE 0x00 /* No clean linux mapping */
25 #define TS_ONPROC 0x04 /* No clean linux mapping */
26 #define TS_WAIT 0x20 /* No clean linux mapping */
27 #endif
28
29 #define thread_create(stk, stksize, func, arg, len, pp, state, pri) \
30 __thread_create(stk, stksize, func, arg, len, pp, state, pri)
31 #define thread_exit() __thread_exit()
32 #define curthread get_current()
33
34 /* We just need a valid type to pass around, it's unused */
35 typedef struct proc_s {
36 int foo;
37 } proc_t;
38
39 extern kthread_t *__thread_create(caddr_t stk, size_t stksize,
40 void (*proc)(void *), void *args,
41 size_t len, proc_t *pp, int state,
42 pri_t pri);
43 extern void __thread_exit(void);
44
45 #ifdef __cplusplus
46 }
47 #endif
48
49 #endif /* _SPL_THREAD_H */
50