1
2
3
4
5
6
7
8 #ifndef _ASM_RISCV_THREAD_INFO_H
9 #define _ASM_RISCV_THREAD_INFO_H
10
11 #include <asm/page.h>
12 #include <linux/const.h>
13
14
15 #define THREAD_SIZE_ORDER (1)
16 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
17
18 #ifndef __ASSEMBLY__
19
20 #include <asm/processor.h>
21 #include <asm/csr.h>
22
23 typedef struct {
24 unsigned long seg;
25 } mm_segment_t;
26
27
28
29
30
31
32
33
34
35 struct thread_info {
36 unsigned long flags;
37 int preempt_count;
38 mm_segment_t addr_limit;
39
40
41
42
43
44 long kernel_sp;
45 long user_sp;
46 int cpu;
47 };
48
49
50
51
52
53
54 #define INIT_THREAD_INFO(tsk) \
55 { \
56 .flags = 0, \
57 .preempt_count = INIT_PREEMPT_COUNT, \
58 .addr_limit = KERNEL_DS, \
59 }
60
61 #endif
62
63
64
65
66
67
68
69
70 #define TIF_SYSCALL_TRACE 0
71 #define TIF_NOTIFY_RESUME 1
72 #define TIF_SIGPENDING 2
73 #define TIF_NEED_RESCHED 3
74 #define TIF_RESTORE_SIGMASK 4
75 #define TIF_MEMDIE 5
76 #define TIF_SYSCALL_TRACEPOINT 6
77 #define TIF_SYSCALL_AUDIT 7
78
79 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
80 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
81 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
82 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
83 #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
84 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
85
86 #define _TIF_WORK_MASK \
87 (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED)
88
89 #define _TIF_SYSCALL_WORK \
90 (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT)
91
92 #endif