diff options
author | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2019-10-20 23:01:36 +0800 |
---|---|---|
committer | Paul Burton <paulburton@kernel.org> | 2019-11-01 14:31:28 -0700 |
commit | 6fbde6b492dfc761ad60a68fb2cb32b1eb05b786 (patch) | |
tree | 34036144cad92b8209ca0e35e79b48c32b797271 /arch/mips/loongson64/loongson-3/cop2-ex.c | |
parent | 1bdb7b76705a38936e9875950587ea91c9ec0a98 (diff) |
MIPS: Loongson64: Move files to the top-level directory
Current Loongson-3 code can share among all Loongson64 processors.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: chenhc@lemote.com
Cc: paul.burton@mips.com
Diffstat (limited to 'arch/mips/loongson64/loongson-3/cop2-ex.c')
-rw-r--r-- | arch/mips/loongson64/loongson-3/cop2-ex.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/arch/mips/loongson64/loongson-3/cop2-ex.c b/arch/mips/loongson64/loongson-3/cop2-ex.c deleted file mode 100644 index 9efdfe430ff0..000000000000 --- a/arch/mips/loongson64/loongson-3/cop2-ex.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2014 Lemote Corporation. - * written by Huacai Chen <chenhc@lemote.com> - * - * based on arch/mips/cavium-octeon/cpu.c - * Copyright (C) 2009 Wind River Systems, - * written by Ralf Baechle <ralf@linux-mips.org> - */ -#include <linux/init.h> -#include <linux/sched.h> -#include <linux/notifier.h> -#include <linux/ptrace.h> - -#include <asm/fpu.h> -#include <asm/cop2.h> -#include <asm/current.h> -#include <asm/mipsregs.h> - -static int loongson_cu2_call(struct notifier_block *nfb, unsigned long action, - void *data) -{ - int fpu_owned; - int fr = !test_thread_flag(TIF_32BIT_FPREGS); - - switch (action) { - case CU2_EXCEPTION: - preempt_disable(); - fpu_owned = __is_fpu_owner(); - if (!fr) - set_c0_status(ST0_CU1 | ST0_CU2); - else - set_c0_status(ST0_CU1 | ST0_CU2 | ST0_FR); - enable_fpu_hazard(); - KSTK_STATUS(current) |= (ST0_CU1 | ST0_CU2); - if (fr) - KSTK_STATUS(current) |= ST0_FR; - else - KSTK_STATUS(current) &= ~ST0_FR; - /* If FPU is owned, we needn't init or restore fp */ - if (!fpu_owned) { - set_thread_flag(TIF_USEDFPU); - init_fp_ctx(current); - _restore_fp(current); - } - preempt_enable(); - - return NOTIFY_STOP; /* Don't call default notifier */ - } - - return NOTIFY_OK; /* Let default notifier send signals */ -} - -static int __init loongson_cu2_setup(void) -{ - return cu2_notifier(loongson_cu2_call, 0); -} -early_initcall(loongson_cu2_setup); |