diff options
author | Michael Trimarchi <trimarchi@gandalf.sssup.it> | 2009-04-03 13:32:33 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-04 11:48:11 -0400 |
commit | 01ab10393c510342ec4ce85df11ccfa3df06bbb2 (patch) | |
tree | ebf0493fa7b53941f830f8b300037f834eb85e59 /arch/sh/kernel/process_32.c | |
parent | a27873cd234b4248dda342721d6262943e5fa235 (diff) |
sh: Fix up DSP context save/restore.
There were a number of issues with the DSP context save/restore code,
mostly left-over relics from when it was introduced on SH3-DSP with
little follow-up testing, resulting in things like task_pt_dspregs()
referencing incorrect state on the stack.
This follows the MIPS convention of tracking the DSP state in the
thread_struct and handling the state save/restore in switch_to() and
finish_arch_switch() respectively. The regset interface is also updated,
which allows us to finally be rid of task_pt_dspregs() and the special
cased task_pt_regs().
Signed-off-by: Michael Trimarchi <michael@evidence.eu.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/process_32.c')
-rw-r--r-- | arch/sh/kernel/process_32.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c index ddafbbbab2ab..0747fabd73a7 100644 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c | |||
@@ -176,14 +176,26 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | |||
176 | { | 176 | { |
177 | struct thread_info *ti = task_thread_info(p); | 177 | struct thread_info *ti = task_thread_info(p); |
178 | struct pt_regs *childregs; | 178 | struct pt_regs *childregs; |
179 | #if defined(CONFIG_SH_FPU) | 179 | #if defined(CONFIG_SH_FPU) || defined(CONFIG_SH_DSP) |
180 | struct task_struct *tsk = current; | 180 | struct task_struct *tsk = current; |
181 | #endif | ||
181 | 182 | ||
183 | #if defined(CONFIG_SH_FPU) | ||
182 | unlazy_fpu(tsk, regs); | 184 | unlazy_fpu(tsk, regs); |
183 | p->thread.fpu = tsk->thread.fpu; | 185 | p->thread.fpu = tsk->thread.fpu; |
184 | copy_to_stopped_child_used_math(p); | 186 | copy_to_stopped_child_used_math(p); |
185 | #endif | 187 | #endif |
186 | 188 | ||
189 | #if defined(CONFIG_SH_DSP) | ||
190 | if (is_dsp_enabled(tsk)) { | ||
191 | /* We can use the __save_dsp or just copy the struct: | ||
192 | * __save_dsp(p); | ||
193 | * p->thread.dsp_status.status |= SR_DSP | ||
194 | */ | ||
195 | p->thread.dsp_status = tsk->thread.dsp_status; | ||
196 | } | ||
197 | #endif | ||
198 | |||
187 | childregs = task_pt_regs(p); | 199 | childregs = task_pt_regs(p); |
188 | *childregs = *regs; | 200 | *childregs = *regs; |
189 | 201 | ||