sh: Fix kernel thread stack corruption with preempt.
authorHideo Saito <saito@densan.co.jp>
Wed, 28 Feb 2007 09:35:42 +0000 (18:35 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 5 Mar 2007 05:13:26 +0000 (14:13 +0900)
commite6bcf562e58662b9765748d346e4c076b20e3aa5
tree0c8982c11cd410f4b654b8fda9a1a1fc6776e4a3
parente523d93c8487667552dd29ff756d6ea6bce30851
sh: Fix kernel thread stack corruption with preempt.

When I run a preemptive kernel-2.6.20 for SH7780, a created
kthread(pdflush) can not exit by do_exit() in kernel_thread_helper. I
think that the created kthread should have a room for 'struct pt_regs'
space on the stack top, because __switch_to() will refer to the space as
follows using 'regs = task_pt_regs(prev)' and next condition may be true.

Signed-off-by: Hideo Saito <saito@densan.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/process.c