sh: Move over and enable FPU support for SH-5.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
parent
061854fd15
commit
600ee240d1
@ -83,6 +83,7 @@ choice
|
|||||||
|
|
||||||
config CPU_SH5
|
config CPU_SH5
|
||||||
bool "SH-5"
|
bool "SH-5"
|
||||||
|
select CPU_HAS_FPU
|
||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
obj-y := entry.o switchto.o
|
obj-y := entry.o switchto.o
|
||||||
|
|
||||||
obj-$(CONFIG_KALLSYMS) += unwind.o
|
obj-$(CONFIG_KALLSYMS) += unwind.o
|
||||||
|
obj-$(CONFIG_SH_FPU) += fpu.o
|
||||||
|
@ -152,7 +152,7 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs)
|
|||||||
if (last_task_used_math == current)
|
if (last_task_used_math == current)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
grab_fpu();
|
enable_fpu();
|
||||||
if (last_task_used_math != NULL) {
|
if (last_task_used_math != NULL) {
|
||||||
/* Other processes fpu state, save away */
|
/* Other processes fpu state, save away */
|
||||||
fpsave(&last_task_used_math->thread.fpu.hard);
|
fpsave(&last_task_used_math->thread.fpu.hard);
|
||||||
@ -165,6 +165,6 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs)
|
|||||||
fpload(&init_fpuregs.hard);
|
fpload(&init_fpuregs.hard);
|
||||||
set_used_math();
|
set_used_math();
|
||||||
}
|
}
|
||||||
release_fpu();
|
disable_fpu();
|
||||||
}
|
}
|
||||||
|
|
@ -469,9 +469,9 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
|
|||||||
fpvalid = !!tsk_used_math(tsk);
|
fpvalid = !!tsk_used_math(tsk);
|
||||||
if (fpvalid) {
|
if (fpvalid) {
|
||||||
if (current == last_task_used_math) {
|
if (current == last_task_used_math) {
|
||||||
grab_fpu();
|
enable_fpu();
|
||||||
fpsave(&tsk->thread.fpu.hard);
|
fpsave(&tsk->thread.fpu.hard);
|
||||||
release_fpu();
|
disable_fpu();
|
||||||
last_task_used_math = 0;
|
last_task_used_math = 0;
|
||||||
regs->sr |= SR_FD;
|
regs->sr |= SR_FD;
|
||||||
}
|
}
|
||||||
@ -496,9 +496,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
|
|||||||
|
|
||||||
#ifdef CONFIG_SH_FPU
|
#ifdef CONFIG_SH_FPU
|
||||||
if(last_task_used_math == current) {
|
if(last_task_used_math == current) {
|
||||||
grab_fpu();
|
enable_fpu();
|
||||||
fpsave(¤t->thread.fpu.hard);
|
fpsave(¤t->thread.fpu.hard);
|
||||||
release_fpu();
|
disable_fpu();
|
||||||
last_task_used_math = NULL;
|
last_task_used_math = NULL;
|
||||||
regs->sr |= SR_FD;
|
regs->sr |= SR_FD;
|
||||||
}
|
}
|
||||||
|
@ -211,9 +211,9 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc)
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
if (current == last_task_used_math) {
|
if (current == last_task_used_math) {
|
||||||
grab_fpu();
|
enable_fpu();
|
||||||
fpsave(¤t->thread.fpu.hard);
|
fpsave(¤t->thread.fpu.hard);
|
||||||
release_fpu();
|
disable_fpu();
|
||||||
last_task_used_math = NULL;
|
last_task_used_math = NULL;
|
||||||
regs->sr |= SR_FD;
|
regs->sr |= SR_FD;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user