]>
Commit | Line | Data |
---|---|---|
09b414e8 | 1 | #ifndef _SPL_THREAD_H |
2 | #define _SPL_THREAD_H | |
f1ca4da6 | 3 | |
4 | #ifdef __cplusplus | |
5 | extern "C" { | |
6 | #endif | |
7 | ||
f1b59d26 | 8 | #include <linux/module.h> |
f1ca4da6 | 9 | #include <linux/mm.h> |
10 | #include <linux/spinlock.h> | |
596e65b4 | 11 | #include "spl-types.h" |
12 | #include "spl-generic.h" | |
f1ca4da6 | 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 | ||
f1b59d26 | 39 | extern kthread_t *__thread_create(caddr_t stk, size_t stksize, |
f1ca4da6 | 40 | void (*proc)(void *), void *args, |
41 | size_t len, proc_t *pp, int state, | |
42 | pri_t pri); | |
f1b59d26 | 43 | extern void __thread_exit(void); |
f1ca4da6 | 44 | |
45 | #ifdef __cplusplus | |
46 | } | |
47 | #endif | |
48 | ||
09b414e8 | 49 | #endif /* _SPL_THREAD_H */ |
f1ca4da6 | 50 |