From 600ee240d15e535d51e6c2b2f8475f0aa42885ea Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 19 Nov 2007 19:13:38 +0900 Subject: [PATCH] sh: Move over and enable FPU support for SH-5. Signed-off-by: Paul Mundt --- arch/sh/Kconfig.sh64 | 1 + arch/sh/kernel/cpu/sh5/Makefile | 1 + arch/{sh64/kernel => sh/kernel/cpu/sh5}/fpu.c | 4 ++-- arch/sh/kernel/process_64.c | 8 ++++---- arch/sh/kernel/signal_64.c | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) rename arch/{sh64/kernel => sh/kernel/cpu/sh5}/fpu.c (99%) 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 config CPU_SH5 bool "SH-5" + select CPU_HAS_FPU endchoice 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 @@ obj-y := entry.o switchto.o obj-$(CONFIG_KALLSYMS) += unwind.o +obj-$(CONFIG_SH_FPU) += fpu.o diff --git a/arch/sh64/kernel/fpu.c b/arch/sh/kernel/cpu/sh5/fpu.c similarity index 99% rename from arch/sh64/kernel/fpu.c rename to 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) if (last_task_used_math == current) return; - grab_fpu(); + enable_fpu(); if (last_task_used_math != NULL) { /* Other processes fpu state, save away */ 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); set_used_math(); } - release_fpu(); + disable_fpu(); } 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) fpvalid = !!tsk_used_math(tsk); if (fpvalid) { if (current == last_task_used_math) { - grab_fpu(); + enable_fpu(); fpsave(&tsk->thread.fpu.hard); - release_fpu(); + disable_fpu(); last_task_used_math = 0; regs->sr |= SR_FD; } @@ -496,9 +496,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, #ifdef CONFIG_SH_FPU if(last_task_used_math == current) { - grab_fpu(); + enable_fpu(); fpsave(¤t->thread.fpu.hard); - release_fpu(); + disable_fpu(); last_task_used_math = NULL; regs->sr |= SR_FD; } 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) return err; if (current == last_task_used_math) { - grab_fpu(); + enable_fpu(); fpsave(¤t->thread.fpu.hard); - release_fpu(); + disable_fpu(); last_task_used_math = NULL; regs->sr |= SR_FD; } -- 2.20.1