@@ -214,7 +214,7 @@ EXPORT_SYMBOL(start_thread);
* Free current thread data structures etc..
*/
void
-exit_thread(void)
+exit_thread(struct task_struct *me)
{
}
@@ -186,7 +186,7 @@ void flush_thread(void)
/*
* Free any architecture-specific thread data structures, etc.
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
}
@@ -193,9 +193,9 @@ EXPORT_SYMBOL_GPL(thread_notify_head);
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
- thread_notify(THREAD_NOTIFY_EXIT, current_thread_info());
+ thread_notify(THREAD_NOTIFY_EXIT, task_thread_info(me));
}
void flush_thread(void)
@@ -203,7 +203,7 @@ void show_regs(struct pt_regs * regs)
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
}
@@ -62,9 +62,9 @@ void machine_restart(char *cmd)
/*
* Free current thread data structures etc
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
- ocd_disable(current);
+ ocd_disable(me);
}
void flush_thread(void)
@@ -78,7 +78,7 @@ static inline void release_thread(struct task_struct *dead_task)
/*
* Free current thread data structures etc..
*/
-static inline void exit_thread(void)
+static inline void exit_thread(struct task_struct *me)
{
}
@@ -82,7 +82,7 @@ void flush_thread(void)
{
}
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
}
@@ -39,7 +39,7 @@ void default_idle(void)
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
/* Nothing needs to be done. */
}
@@ -33,9 +33,9 @@ void default_idle(void)
*/
extern void deconfigure_bp(long pid);
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
- deconfigure_bp(current->pid);
+ deconfigure_bp(me->pid);
}
/*
@@ -99,7 +99,7 @@ extern asmlinkage void *restore_user_regs(const struct user_context *target, ...
/*
* Free current thread data structures etc..
*/
-static inline void exit_thread(void)
+static inline void exit_thread(struct task_struct *me)
{
}
@@ -113,7 +113,7 @@ static inline void release_thread(struct task_struct *dead_task)
/*
* Free current thread data structures etc..
*/
-static inline void exit_thread(void)
+static inline void exit_thread(struct task_struct *me)
{
}
@@ -139,7 +139,7 @@ void release_thread(struct task_struct *dead_task)
/*
* Free any architecture-specific thread data structures, etc.
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
}
@@ -4542,8 +4542,8 @@ pfm_context_unload(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg
/*
- * called only from exit_thread(): task == current
- * we come here only if current has a context attached (loaded or masked)
+ * called only from exit_thread()
+ * we come here only if the task has a context attached (loaded or masked)
*/
void
pfm_exit_thread(struct task_struct *task)
@@ -570,22 +570,22 @@ flush_thread (void)
}
/*
- * Clean up state associated with current thread. This is called when
+ * Clean up state associated with a thread. This is called when
* the thread calls exit().
*/
void
-exit_thread (void)
+exit_thread (struct task_struct *me)
{
- ia64_drop_fpu(current);
+ ia64_drop_fpu(me);
#ifdef CONFIG_PERFMON
/* if needed, stop monitoring and flush state to perfmon context */
- if (current->thread.pfm_context)
- pfm_exit_thread(current);
+ if (me->thread.pfm_context)
+ pfm_exit_thread(me);
/* free debug register resources */
- if (current->thread.flags & IA64_THREAD_DBG_VALID)
- pfm_release_debug_registers(current);
+ if (me->thread.flags & IA64_THREAD_DBG_VALID)
+ pfm_release_debug_registers(me);
#endif
}
@@ -104,10 +104,10 @@ void show_regs(struct pt_regs * regs)
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
/* Nothing to do. */
- DPRINTK("pid = %d\n", current->pid);
+ DPRINTK("pid = %d\n", me->pid);
}
void flush_thread(void)
@@ -156,7 +156,7 @@ static inline void release_thread(struct task_struct *dead_task)
/*
* Free current thread data structures etc..
*/
-static inline void exit_thread(void)
+static inline void exit_thread(struct task_struct *me)
{
}
@@ -134,7 +134,7 @@ static inline void release_thread(struct task_struct *dead_task)
#define copy_segments(tsk, mm) do { } while (0)
#define release_segments(mm) do { } while (0)
-extern void exit_thread(void);
+extern void exit_thread(struct task_struct *me);
/*
* Return saved PC of a blocked thread.
@@ -345,10 +345,10 @@ void flush_thread(void)
/*
* Free current thread data structures etc.
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
- clear_fpu(¤t->thread);
- clear_dsp(¤t->thread);
+ clear_fpu(&me->thread);
+ clear_dsp(&me->thread);
}
/* TODO: figure out how to unwind the kernel stack here to figure out
@@ -71,7 +71,7 @@ static inline void release_thread(struct task_struct *dead_task)
}
/* Free all resources held by a thread. */
-static inline void exit_thread(void)
+static inline void exit_thread(struct task_struct *me)
{
}
@@ -128,7 +128,7 @@ static inline void release_thread(struct task_struct *dead_task)
}
/* Free current thread data structures etc. */
-static inline void exit_thread(void)
+static inline void exit_thread(struct task_struct *me)
{
}
@@ -73,7 +73,7 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
regs->regs[29] = sp;
}
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
}
@@ -103,9 +103,9 @@ void show_regs(struct pt_regs *regs)
/*
* free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
- exit_fpu(current);
+ exit_fpu(me);
}
void flush_thread(void)
@@ -76,7 +76,7 @@ static inline void release_thread(struct task_struct *dead_task)
}
/* Free current thread data structures etc.. */
-static inline void exit_thread(void)
+static inline void exit_thread(struct task_struct *me)
{
}
@@ -88,7 +88,7 @@ unsigned long get_wchan(struct task_struct *p);
* Free current thread data structures etc..
*/
-extern inline void exit_thread(void)
+extern inline void exit_thread(struct task_struct *me)
{
/* Nothing needs to be done. */
}
@@ -147,7 +147,7 @@ EXPORT_SYMBOL(pm_power_off);
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
}
@@ -1326,7 +1326,7 @@ void show_regs(struct pt_regs * regs)
show_instructions(regs);
}
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
}
@@ -70,9 +70,9 @@ extern void kernel_thread_starter(void);
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
- exit_thread_runtime_instr(current);
+ exit_thread_runtime_instr(me);
}
void flush_thread(void)
@@ -56,7 +56,7 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
regs->regs[0] = sp;
}
-void exit_thread(void) {}
+void exit_thread(struct task_struct *me) {}
/*
* When a process does an "exec", machine state like FPU and debug
@@ -79,7 +79,7 @@ EXPORT_SYMBOL(start_thread);
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
}
@@ -288,7 +288,7 @@ void show_regs(struct pt_regs *regs)
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
/*
* See arch/sparc/kernel/process.c for the precedent for doing
@@ -307,7 +307,7 @@ void exit_thread(void)
* which it would get safely nulled.
*/
#ifdef CONFIG_SH_FPU
- if (last_task_used_math == current) {
+ if (last_task_used_math == me) {
last_task_used_math = NULL;
}
#endif
@@ -184,21 +184,21 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
#ifndef CONFIG_SMP
- if(last_task_used_math == current) {
+ if (last_task_used_math == me) {
#else
- if (test_thread_flag(TIF_USEDFPU)) {
+ if (test_ti_thread_flag(task_thread_info(me), TIF_USEDFPU)) {
#endif
/* Keep process from leaving FPU in a bogon state. */
put_psr(get_psr() | PSR_EF);
- fpsave(¤t->thread.float_regs[0], ¤t->thread.fsr,
- ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth);
+ fpsave(&me->thread.float_regs[0], &me->thread.fsr,
+ &me->thread.fpqueue[0], &me->thread.fpqdepth);
#ifndef CONFIG_SMP
last_task_used_math = NULL;
#else
- clear_thread_flag(TIF_USEDFPU);
+ clear_ti_thread_flag(task_thread_info(me), TIF_USEDFPU);
#endif
}
}
@@ -417,9 +417,9 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
}
/* Free current thread data structures etc.. */
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
- struct thread_info *t = current_thread_info();
+ struct thread_info *t = task_thread_info(me);
if (t->utraps) {
if (t->utraps[0] < 2)
@@ -541,7 +541,7 @@ void flush_thread(void)
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
#ifdef CONFIG_HARDWALL
/*
@@ -550,7 +550,7 @@ void exit_thread(void)
* the last reference to a hardwall fd, it would already have
* been released and deactivated at this point.)
*/
- hardwall_deactivate_all(current);
+ hardwall_deactivate_all(me);
#endif
}
@@ -103,7 +103,7 @@ void interrupt_end(void)
tracehook_notify_resume(regs);
}
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
}
@@ -204,7 +204,7 @@ void show_regs(struct pt_regs *regs)
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
}
@@ -97,9 +97,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
/*
* Free current thread data structures etc..
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
- struct task_struct *me = current;
struct thread_struct *t = &me->thread;
unsigned long *bp = t->io_bitmap_ptr;
struct fpu *fpu = &t->fpu;
@@ -115,10 +115,10 @@ void arch_cpu_idle(void)
/*
* This is called when the thread calls exit().
*/
-void exit_thread(void)
+void exit_thread(struct task_struct *me)
{
#if XTENSA_HAVE_COPROCESSORS
- coprocessor_release_all(current_thread_info());
+ coprocessor_release_all(task_thread_info(me));
#endif
}
@@ -2648,7 +2648,7 @@ static inline int copy_thread_tls(
}
#endif
extern void flush_thread(void);
-extern void exit_thread(void);
+extern void exit_thread(struct task_struct *);
extern void exit_files(struct task_struct *);
extern void __cleanup_sighand(struct sighand_struct *);
@@ -746,7 +746,7 @@ void do_exit(long code)
disassociate_ctty(1);
exit_task_namespaces(tsk);
exit_task_work(tsk);
- exit_thread();
+ exit_thread(tsk);
/*
* Flush inherited counters to the parent - before the parent
We need to call exit_thread from copy_process in a fail path. So make it accept task_struct as a parameter. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no> Cc: Steven Miao <realmz6@gmail.com> Cc: Mark Salter <msalter@redhat.com> Cc: Aurelien Jacquiot <a-jacquiot@ti.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: James Hogan <james.hogan@imgtec.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: David Howells <dhowells@redhat.com> Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com> Cc: Ley Foon Tan <lftan@altera.com> Cc: Jonas Bonn <jonas@southpole.se> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Chen Liqin <liqin.linux@gmail.com> Cc: Lennox Wu <lennox.wu@gmail.com> Cc: Rich Felker <dalias@libc.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: Jeff Dike <jdike@addtoit.com> Cc: Richard Weinberger <richard@nod.at> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: x86@kernel.org Cc: Chris Zankel <chris@zankel.net> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: linux-alpha@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: adi-buildroot-devel@lists.sourceforge.net Cc: linux-c6x-dev@linux-c6x.org Cc: linux-cris-kernel@axis.com Cc: uclinux-h8-devel@lists.sourceforge.jp Cc: linux-hexagon@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-metag@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-am33-list@redhat.com Cc: nios2-dev@lists.rocketboards.org Cc: linux-parisc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-s390@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: sparclinux@vger.kernel.org Cc: user-mode-linux-devel@lists.sourceforge.net Cc: user-mode-linux-user@lists.sourceforge.net Cc: linux-xtensa@linux-xtensa.org --- arch/alpha/kernel/process.c | 2 +- arch/arc/kernel/process.c | 2 +- arch/arm/kernel/process.c | 4 ++-- arch/arm64/kernel/process.c | 2 +- arch/avr32/kernel/process.c | 4 ++-- arch/blackfin/include/asm/processor.h | 2 +- arch/c6x/kernel/process.c | 2 +- arch/cris/arch-v10/kernel/process.c | 2 +- arch/cris/arch-v32/kernel/process.c | 4 ++-- arch/frv/include/asm/processor.h | 2 +- arch/h8300/include/asm/processor.h | 2 +- arch/hexagon/kernel/process.c | 2 +- arch/ia64/kernel/perfmon.c | 4 ++-- arch/ia64/kernel/process.c | 14 +++++++------- arch/m32r/kernel/process.c | 4 ++-- arch/m68k/include/asm/processor.h | 2 +- arch/metag/include/asm/processor.h | 2 +- arch/metag/kernel/process.c | 6 +++--- arch/microblaze/include/asm/processor.h | 4 ++-- arch/mips/kernel/process.c | 2 +- arch/mn10300/kernel/process.c | 4 ++-- arch/nios2/include/asm/processor.h | 2 +- arch/openrisc/include/asm/processor.h | 2 +- arch/parisc/kernel/process.c | 2 +- arch/powerpc/kernel/process.c | 2 +- arch/s390/kernel/process.c | 4 ++-- arch/score/kernel/process.c | 2 +- arch/sh/kernel/process_32.c | 2 +- arch/sh/kernel/process_64.c | 4 ++-- arch/sparc/kernel/process_32.c | 12 ++++++------ arch/sparc/kernel/process_64.c | 4 ++-- arch/tile/kernel/process.c | 4 ++-- arch/um/kernel/process.c | 2 +- arch/unicore32/kernel/process.c | 2 +- arch/x86/kernel/process.c | 3 +-- arch/xtensa/kernel/process.c | 4 ++-- include/linux/sched.h | 2 +- kernel/exit.c | 2 +- 38 files changed, 63 insertions(+), 64 deletions(-)