diff options
| author | Jiri Slaby <jslaby@suse.cz> | 2016-05-20 20:00:20 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-20 20:58:30 -0400 |
| commit | e64646946ed32902fd597fa6e514b1da84642de3 (patch) | |
| tree | 6e3d618e6e81619f82f809eb9857e2974a3734b8 /arch/sparc/kernel | |
| parent | 5f56a5dfdb9bcb3bca03df59980d4d2f012cbb53 (diff) | |
exit_thread: accept a task parameter to be exited
We need to call exit_thread from copy_process in a fail path. So make it
accept task_struct as a parameter.
[v2]
* s390: exit_thread_runtime_instr doesn't make sense to be called for
non-current tasks.
* arm: fix the comment in vfp_thread_copy
* change 'me' to 'tsk' for task_struct
* now we can change only archs that actually have exit_thread
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chen Liqin <liqin.linux@gmail.com>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: David Howells <dhowells@redhat.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Cc: Lennox Wu <lennox.wu@gmail.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Rich Felker <dalias@libc.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Richard Kuo <rkuo@codeaurora.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Steven Miao <realmz6@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sparc/kernel')
| -rw-r--r-- | arch/sparc/kernel/process_32.c | 12 | ||||
| -rw-r--r-- | arch/sparc/kernel/process_64.c | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index c5113c7ce2fd..b7780a5bef11 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
| @@ -184,21 +184,21 @@ unsigned long thread_saved_pc(struct task_struct *tsk) | |||
| 184 | /* | 184 | /* |
| 185 | * Free current thread data structures etc.. | 185 | * Free current thread data structures etc.. |
| 186 | */ | 186 | */ |
| 187 | void exit_thread(void) | 187 | void exit_thread(struct task_struct *tsk) |
| 188 | { | 188 | { |
| 189 | #ifndef CONFIG_SMP | 189 | #ifndef CONFIG_SMP |
| 190 | if(last_task_used_math == current) { | 190 | if (last_task_used_math == tsk) { |
| 191 | #else | 191 | #else |
| 192 | if (test_thread_flag(TIF_USEDFPU)) { | 192 | if (test_ti_thread_flag(task_thread_info(tsk), TIF_USEDFPU)) { |
| 193 | #endif | 193 | #endif |
| 194 | /* Keep process from leaving FPU in a bogon state. */ | 194 | /* Keep process from leaving FPU in a bogon state. */ |
| 195 | put_psr(get_psr() | PSR_EF); | 195 | put_psr(get_psr() | PSR_EF); |
| 196 | fpsave(¤t->thread.float_regs[0], ¤t->thread.fsr, | 196 | fpsave(&tsk->thread.float_regs[0], &tsk->thread.fsr, |
| 197 | ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth); | 197 | &tsk->thread.fpqueue[0], &tsk->thread.fpqdepth); |
| 198 | #ifndef CONFIG_SMP | 198 | #ifndef CONFIG_SMP |
| 199 | last_task_used_math = NULL; | 199 | last_task_used_math = NULL; |
| 200 | #else | 200 | #else |
| 201 | clear_thread_flag(TIF_USEDFPU); | 201 | clear_ti_thread_flag(task_thread_info(tsk), TIF_USEDFPU); |
| 202 | #endif | 202 | #endif |
| 203 | } | 203 | } |
| 204 | } | 204 | } |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index c16ef1af1843..fa14402b33f9 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
| @@ -417,9 +417,9 @@ unsigned long thread_saved_pc(struct task_struct *tsk) | |||
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | /* Free current thread data structures etc.. */ | 419 | /* Free current thread data structures etc.. */ |
| 420 | void exit_thread(void) | 420 | void exit_thread(struct task_struct *tsk) |
| 421 | { | 421 | { |
| 422 | struct thread_info *t = current_thread_info(); | 422 | struct thread_info *t = task_thread_info(tsk); |
| 423 | 423 | ||
| 424 | if (t->utraps) { | 424 | if (t->utraps) { |
| 425 | if (t->utraps[0] < 2) | 425 | if (t->utraps[0] < 2) |
