aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-11-19 05:13:38 -0500
committerPaul Mundt <lethal@linux-sh.org>2008-01-27 23:18:48 -0500
commit600ee240d15e535d51e6c2b2f8475f0aa42885ea (patch)
tree95ca3ee293c43c104172debd3951c8693c27334d /arch
parent061854fd155116ab1f40c39a75e2c641827fd246 (diff)
sh: Move over and enable FPU support for SH-5.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/Kconfig.sh641
-rw-r--r--arch/sh/kernel/cpu/sh5/Makefile1
-rw-r--r--arch/sh/kernel/cpu/sh5/fpu.c (renamed from arch/sh64/kernel/fpu.c)4
-rw-r--r--arch/sh/kernel/process_64.c8
-rw-r--r--arch/sh/kernel/signal_64.c4
5 files changed, 10 insertions, 8 deletions
diff --git a/arch/sh/Kconfig.sh64 b/arch/sh/Kconfig.sh64
index 10f5d30d3184..e37cd8c51e34 100644
--- a/arch/sh/Kconfig.sh64
+++ b/arch/sh/Kconfig.sh64
@@ -83,6 +83,7 @@ choice
83 83
84config CPU_SH5 84config CPU_SH5
85 bool "SH-5" 85 bool "SH-5"
86 select CPU_HAS_FPU
86 87
87endchoice 88endchoice
88 89
diff --git a/arch/sh/kernel/cpu/sh5/Makefile b/arch/sh/kernel/cpu/sh5/Makefile
index 7ea10732b5cc..6d388e8d8991 100644
--- a/arch/sh/kernel/cpu/sh5/Makefile
+++ b/arch/sh/kernel/cpu/sh5/Makefile
@@ -1,3 +1,4 @@
1obj-y := entry.o switchto.o 1obj-y := entry.o switchto.o
2 2
3obj-$(CONFIG_KALLSYMS) += unwind.o 3obj-$(CONFIG_KALLSYMS) += unwind.o
4obj-$(CONFIG_SH_FPU) += fpu.o
diff --git a/arch/sh64/kernel/fpu.c b/arch/sh/kernel/cpu/sh5/fpu.c
index 8ad4ed6a6c9b..d3f5e7468dfe 100644
--- a/arch/sh64/kernel/fpu.c
+++ b/arch/sh/kernel/cpu/sh5/fpu.c
@@ -152,7 +152,7 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs)
152 if (last_task_used_math == current) 152 if (last_task_used_math == current)
153 return; 153 return;
154 154
155 grab_fpu(); 155 enable_fpu();
156 if (last_task_used_math != NULL) { 156 if (last_task_used_math != NULL) {
157 /* Other processes fpu state, save away */ 157 /* Other processes fpu state, save away */
158 fpsave(&last_task_used_math->thread.fpu.hard); 158 fpsave(&last_task_used_math->thread.fpu.hard);
@@ -165,6 +165,6 @@ do_fpu_state_restore(unsigned long ex, struct pt_regs *regs)
165 fpload(&init_fpuregs.hard); 165 fpload(&init_fpuregs.hard);
166 set_used_math(); 166 set_used_math();
167 } 167 }
168 release_fpu(); 168 disable_fpu();
169} 169}
170 170
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index 0761af4d2a42..0c2bc61b66b3 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -469,9 +469,9 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
469 fpvalid = !!tsk_used_math(tsk); 469 fpvalid = !!tsk_used_math(tsk);
470 if (fpvalid) { 470 if (fpvalid) {
471 if (current == last_task_used_math) { 471 if (current == last_task_used_math) {
472 grab_fpu(); 472 enable_fpu();
473 fpsave(&tsk->thread.fpu.hard); 473 fpsave(&tsk->thread.fpu.hard);
474 release_fpu(); 474 disable_fpu();
475 last_task_used_math = 0; 475 last_task_used_math = 0;
476 regs->sr |= SR_FD; 476 regs->sr |= SR_FD;
477 } 477 }
@@ -496,9 +496,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
496 496
497#ifdef CONFIG_SH_FPU 497#ifdef CONFIG_SH_FPU
498 if(last_task_used_math == current) { 498 if(last_task_used_math == current) {
499 grab_fpu(); 499 enable_fpu();
500 fpsave(&current->thread.fpu.hard); 500 fpsave(&current->thread.fpu.hard);
501 release_fpu(); 501 disable_fpu();
502 last_task_used_math = NULL; 502 last_task_used_math = NULL;
503 regs->sr |= SR_FD; 503 regs->sr |= SR_FD;
504 } 504 }
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index 069fb6083646..08f403e23662 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -211,9 +211,9 @@ setup_sigcontext_fpu(struct pt_regs *regs, struct sigcontext __user *sc)
211 return err; 211 return err;
212 212
213 if (current == last_task_used_math) { 213 if (current == last_task_used_math) {
214 grab_fpu(); 214 enable_fpu();
215 fpsave(&current->thread.fpu.hard); 215 fpsave(&current->thread.fpu.hard);
216 release_fpu(); 216 disable_fpu();
217 last_task_used_math = NULL; 217 last_task_used_math = NULL;
218 regs->sr |= SR_FD; 218 regs->sr |= SR_FD;
219 } 219 }