1
2
3
4
5
6
7
8 #ifndef _ASM_THREAD_INFO_H
9 #define _ASM_THREAD_INFO_H
10
11 #ifdef __KERNEL__
12
13 #ifndef __ASSEMBLY__
14 #include <asm/processor.h>
15 #include <asm/registers.h>
16 #include <asm/page.h>
17 #endif
18
19 #define THREAD_SHIFT 12
20 #define THREAD_SIZE (1<<THREAD_SHIFT)
21 #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
22
23 #ifndef __ASSEMBLY__
24
25 typedef struct {
26 unsigned long seg;
27 } mm_segment_t;
28
29
30
31
32
33
34
35 struct thread_info {
36 struct task_struct *task;
37 unsigned long flags;
38 __u32 cpu;
39 int preempt_count;
40 mm_segment_t addr_limit;
41
42
43
44
45
46 struct pt_regs *regs;
47
48
49
50
51
52 unsigned long sp;
53 };
54
55 #else
56
57 #include <asm/asm-offsets.h>
58
59 #endif
60
61 #ifndef __ASSEMBLY__
62
63 #define INIT_THREAD_INFO(tsk) \
64 { \
65 .task = &tsk, \
66 .flags = 0, \
67 .cpu = 0, \
68 .preempt_count = 1, \
69 .addr_limit = KERNEL_DS, \
70 .sp = 0, \
71 .regs = NULL, \
72 }
73
74
75 #define qqstr(s) qstr(s)
76 #define qstr(s) #s
77 #define QUOTED_THREADINFO_REG qqstr(THREADINFO_REG)
78
79 register struct thread_info *__current_thread_info asm(QUOTED_THREADINFO_REG);
80 #define current_thread_info() __current_thread_info
81
82 #endif
83
84
85
86
87
88
89
90
91
92 #define TIF_SYSCALL_TRACE 0
93 #define TIF_NOTIFY_RESUME 1
94 #define TIF_SIGPENDING 2
95 #define TIF_NEED_RESCHED 3
96 #define TIF_SINGLESTEP 4
97 #define TIF_RESTORE_SIGMASK 6
98
99 #define TIF_MEMDIE 17
100
101 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
102 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
103 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
104 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
105 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
106
107
108 #define _TIF_WORK_MASK (0x0000FFFF & ~_TIF_SYSCALL_TRACE)
109
110
111 #define _TIF_ALLWORK_MASK 0x0000FFFF
112
113 #endif
114
115 #endif