diff options
Diffstat (limited to 'arch/sh/include/asm/thread_info.h')
-rw-r--r-- | arch/sh/include/asm/thread_info.h | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h index f09ac4806294..c228946926ed 100644 --- a/arch/sh/include/asm/thread_info.h +++ b/arch/sh/include/asm/thread_info.h | |||
@@ -19,6 +19,7 @@ struct thread_info { | |||
19 | struct task_struct *task; /* main task structure */ | 19 | struct task_struct *task; /* main task structure */ |
20 | struct exec_domain *exec_domain; /* execution domain */ | 20 | struct exec_domain *exec_domain; /* execution domain */ |
21 | unsigned long flags; /* low level flags */ | 21 | unsigned long flags; /* low level flags */ |
22 | __u32 status; /* thread synchronous flags */ | ||
22 | __u32 cpu; | 23 | __u32 cpu; |
23 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | 24 | int preempt_count; /* 0 => preemptable, <0 => BUG */ |
24 | mm_segment_t addr_limit; /* thread address space */ | 25 | mm_segment_t addr_limit; /* thread address space */ |
@@ -50,8 +51,9 @@ struct thread_info { | |||
50 | .task = &tsk, \ | 51 | .task = &tsk, \ |
51 | .exec_domain = &default_exec_domain, \ | 52 | .exec_domain = &default_exec_domain, \ |
52 | .flags = 0, \ | 53 | .flags = 0, \ |
54 | .status = 0, \ | ||
53 | .cpu = 0, \ | 55 | .cpu = 0, \ |
54 | .preempt_count = 1, \ | 56 | .preempt_count = INIT_PREEMPT_COUNT, \ |
55 | .addr_limit = KERNEL_DS, \ | 57 | .addr_limit = KERNEL_DS, \ |
56 | .restart_block = { \ | 58 | .restart_block = { \ |
57 | .fn = do_no_restart_syscall, \ | 59 | .fn = do_no_restart_syscall, \ |
@@ -91,14 +93,16 @@ static inline struct thread_info *current_thread_info(void) | |||
91 | 93 | ||
92 | #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) | 94 | #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) |
93 | 95 | ||
94 | #else /* THREAD_SHIFT < PAGE_SHIFT */ | 96 | #endif |
95 | |||
96 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
97 | 97 | ||
98 | extern struct thread_info *alloc_thread_info(struct task_struct *tsk); | 98 | extern struct thread_info *alloc_thread_info(struct task_struct *tsk); |
99 | extern void free_thread_info(struct thread_info *ti); | 99 | extern void free_thread_info(struct thread_info *ti); |
100 | 100 | extern void arch_task_cache_init(void); | |
101 | #endif /* THREAD_SHIFT < PAGE_SHIFT */ | 101 | #define arch_task_cache_init arch_task_cache_init |
102 | extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); | ||
103 | extern void init_thread_xstate(void); | ||
104 | |||
105 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
102 | 106 | ||
103 | #endif /* __ASSEMBLY__ */ | 107 | #endif /* __ASSEMBLY__ */ |
104 | 108 | ||
@@ -111,48 +115,67 @@ extern void free_thread_info(struct thread_info *ti); | |||
111 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ | 115 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ |
112 | #define TIF_SIGPENDING 1 /* signal pending */ | 116 | #define TIF_SIGPENDING 1 /* signal pending */ |
113 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ | 117 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ |
114 | #define TIF_RESTORE_SIGMASK 3 /* restore signal mask in do_signal() */ | ||
115 | #define TIF_SINGLESTEP 4 /* singlestepping active */ | 118 | #define TIF_SINGLESTEP 4 /* singlestepping active */ |
116 | #define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ | 119 | #define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ |
117 | #define TIF_SECCOMP 6 /* secure computing */ | 120 | #define TIF_SECCOMP 6 /* secure computing */ |
118 | #define TIF_NOTIFY_RESUME 7 /* callback before returning to user */ | 121 | #define TIF_NOTIFY_RESUME 7 /* callback before returning to user */ |
119 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ | 122 | #define TIF_SYSCALL_TRACEPOINT 8 /* for ftrace syscall instrumentation */ |
120 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 123 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
121 | #define TIF_MEMDIE 18 | 124 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ |
122 | #define TIF_FREEZE 19 /* Freezing for suspend */ | 125 | #define TIF_FREEZE 19 /* Freezing for suspend */ |
123 | 126 | ||
124 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 127 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
125 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 128 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
126 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | 129 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
127 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | ||
128 | #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) | 130 | #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) |
129 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) | 131 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
130 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) | 132 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) |
131 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 133 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
132 | #define _TIF_USEDFPU (1 << TIF_USEDFPU) | 134 | #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) |
133 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | 135 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) |
134 | #define _TIF_FREEZE (1 << TIF_FREEZE) | 136 | #define _TIF_FREEZE (1 << TIF_FREEZE) |
135 | 137 | ||
136 | /* | 138 | /* |
137 | * _TIF_ALLWORK_MASK and _TIF_WORK_MASK need to fit within a byte, or we | 139 | * _TIF_ALLWORK_MASK and _TIF_WORK_MASK need to fit within 2 bytes, or we |
138 | * blow the tst immediate size constraints and need to fix up | 140 | * blow the tst immediate size constraints and need to fix up |
139 | * arch/sh/kernel/entry-common.S. | 141 | * arch/sh/kernel/entry-common.S. |
140 | */ | 142 | */ |
141 | 143 | ||
142 | /* work to do in syscall trace */ | 144 | /* work to do in syscall trace */ |
143 | #define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \ | 145 | #define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \ |
144 | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP) | 146 | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ |
147 | _TIF_SYSCALL_TRACEPOINT) | ||
145 | 148 | ||
146 | /* work to do on any return to u-space */ | 149 | /* work to do on any return to u-space */ |
147 | #define _TIF_ALLWORK_MASK (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING | \ | 150 | #define _TIF_ALLWORK_MASK (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING | \ |
148 | _TIF_NEED_RESCHED | _TIF_SYSCALL_AUDIT | \ | 151 | _TIF_NEED_RESCHED | _TIF_SYSCALL_AUDIT | \ |
149 | _TIF_SINGLESTEP | _TIF_RESTORE_SIGMASK | \ | 152 | _TIF_SINGLESTEP | _TIF_NOTIFY_RESUME | \ |
150 | _TIF_NOTIFY_RESUME) | 153 | _TIF_SYSCALL_TRACEPOINT) |
151 | 154 | ||
152 | /* work to do on interrupt/exception return */ | 155 | /* work to do on interrupt/exception return */ |
153 | #define _TIF_WORK_MASK (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \ | 156 | #define _TIF_WORK_MASK (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \ |
154 | _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP)) | 157 | _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP)) |
155 | 158 | ||
159 | /* | ||
160 | * Thread-synchronous status. | ||
161 | * | ||
162 | * This is different from the flags in that nobody else | ||
163 | * ever touches our thread-synchronous status, so we don't | ||
164 | * have to worry about atomic accesses. | ||
165 | */ | ||
166 | #define TS_RESTORE_SIGMASK 0x0001 /* restore signal mask in do_signal() */ | ||
167 | #define TS_USEDFPU 0x0002 /* FPU used by this task this quantum */ | ||
168 | |||
169 | #ifndef __ASSEMBLY__ | ||
170 | #define HAVE_SET_RESTORE_SIGMASK 1 | ||
171 | static inline void set_restore_sigmask(void) | ||
172 | { | ||
173 | struct thread_info *ti = current_thread_info(); | ||
174 | ti->status |= TS_RESTORE_SIGMASK; | ||
175 | set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags); | ||
176 | } | ||
177 | #endif /* !__ASSEMBLY__ */ | ||
178 | |||
156 | #endif /* __KERNEL__ */ | 179 | #endif /* __KERNEL__ */ |
157 | 180 | ||
158 | #endif /* __ASM_SH_THREAD_INFO_H */ | 181 | #endif /* __ASM_SH_THREAD_INFO_H */ |