diff options
Diffstat (limited to 'arch/sh/kernel/process.c')
-rw-r--r-- | arch/sh/kernel/process.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 8a2bea34ddd2..8c0060ce6c02 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c | |||
@@ -191,13 +191,8 @@ void flush_thread(void) | |||
191 | { | 191 | { |
192 | #if defined(CONFIG_SH_FPU) | 192 | #if defined(CONFIG_SH_FPU) |
193 | struct task_struct *tsk = current; | 193 | struct task_struct *tsk = current; |
194 | struct pt_regs *regs = (struct pt_regs *) | ||
195 | ((unsigned long)tsk->thread_info | ||
196 | + THREAD_SIZE - sizeof(struct pt_regs) | ||
197 | - sizeof(unsigned long)); | ||
198 | |||
199 | /* Forget lazy FPU state */ | 194 | /* Forget lazy FPU state */ |
200 | clear_fpu(tsk, regs); | 195 | clear_fpu(tsk, task_pt_regs(tsk)); |
201 | clear_used_math(); | 196 | clear_used_math(); |
202 | #endif | 197 | #endif |
203 | } | 198 | } |
@@ -232,13 +227,7 @@ int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) | |||
232 | { | 227 | { |
233 | struct pt_regs ptregs; | 228 | struct pt_regs ptregs; |
234 | 229 | ||
235 | ptregs = *(struct pt_regs *) | 230 | ptregs = *task_pt_regs(tsk); |
236 | ((unsigned long)tsk->thread_info + THREAD_SIZE | ||
237 | - sizeof(struct pt_regs) | ||
238 | #ifdef CONFIG_SH_DSP | ||
239 | - sizeof(struct pt_dspregs) | ||
240 | #endif | ||
241 | - sizeof(unsigned long)); | ||
242 | elf_core_copy_regs(regs, &ptregs); | 231 | elf_core_copy_regs(regs, &ptregs); |
243 | 232 | ||
244 | return 1; | 233 | return 1; |
@@ -252,11 +241,7 @@ dump_task_fpu (struct task_struct *tsk, elf_fpregset_t *fpu) | |||
252 | #if defined(CONFIG_SH_FPU) | 241 | #if defined(CONFIG_SH_FPU) |
253 | fpvalid = !!tsk_used_math(tsk); | 242 | fpvalid = !!tsk_used_math(tsk); |
254 | if (fpvalid) { | 243 | if (fpvalid) { |
255 | struct pt_regs *regs = (struct pt_regs *) | 244 | unlazy_fpu(tsk, task_pt_regs(tsk)); |
256 | ((unsigned long)tsk->thread_info | ||
257 | + THREAD_SIZE - sizeof(struct pt_regs) | ||
258 | - sizeof(unsigned long)); | ||
259 | unlazy_fpu(tsk, regs); | ||
260 | memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); | 245 | memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); |
261 | } | 246 | } |
262 | #endif | 247 | #endif |
@@ -279,12 +264,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | |||
279 | copy_to_stopped_child_used_math(p); | 264 | copy_to_stopped_child_used_math(p); |
280 | #endif | 265 | #endif |
281 | 266 | ||
282 | childregs = ((struct pt_regs *) | 267 | childregs = task_pt_regs(p); |
283 | (THREAD_SIZE + (unsigned long) p->thread_info) | ||
284 | #ifdef CONFIG_SH_DSP | ||
285 | - sizeof(struct pt_dspregs) | ||
286 | #endif | ||
287 | - sizeof(unsigned long)) - 1; | ||
288 | *childregs = *regs; | 268 | *childregs = *regs; |
289 | 269 | ||
290 | if (user_mode(regs)) { | 270 | if (user_mode(regs)) { |
@@ -333,11 +313,7 @@ ubc_set_tracing(int asid, unsigned long pc) | |||
333 | struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next) | 313 | struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next) |
334 | { | 314 | { |
335 | #if defined(CONFIG_SH_FPU) | 315 | #if defined(CONFIG_SH_FPU) |
336 | struct pt_regs *regs = (struct pt_regs *) | 316 | unlazy_fpu(prev, task_pt_regs(prev)); |
337 | ((unsigned long)prev->thread_info | ||
338 | + THREAD_SIZE - sizeof(struct pt_regs) | ||
339 | - sizeof(unsigned long)); | ||
340 | unlazy_fpu(prev, regs); | ||
341 | #endif | 317 | #endif |
342 | 318 | ||
343 | #ifdef CONFIG_PREEMPT | 319 | #ifdef CONFIG_PREEMPT |
@@ -346,13 +322,7 @@ struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *ne | |||
346 | struct pt_regs *regs; | 322 | struct pt_regs *regs; |
347 | 323 | ||
348 | local_irq_save(flags); | 324 | local_irq_save(flags); |
349 | regs = (struct pt_regs *) | 325 | regs = task_pt_regs(prev); |
350 | ((unsigned long)prev->thread_info | ||
351 | + THREAD_SIZE - sizeof(struct pt_regs) | ||
352 | #ifdef CONFIG_SH_DSP | ||
353 | - sizeof(struct pt_dspregs) | ||
354 | #endif | ||
355 | - sizeof(unsigned long)); | ||
356 | if (user_mode(regs) && regs->regs[15] >= 0xc0000000) { | 326 | if (user_mode(regs) && regs->regs[15] >= 0xc0000000) { |
357 | int offset = (int)regs->regs[15]; | 327 | int offset = (int)regs->regs[15]; |
358 | 328 | ||