aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm
diff options
context:
space:
mode:
authorHuacai Chen <chenhc@lemote.com>2014-06-25 23:41:31 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-07-30 15:47:17 -0400
commitef2f826c8f2ff1e4215968042139604633581a13 (patch)
tree2e2cb70e0a16ade5ea70b0ef00ff67ff902d25d8 /arch/mips/include/asm
parente7841be50fe2b8751a51a068b8cdcdcb6611e354 (diff)
MIPS: Loongson-3: Enable the COP2 usage
Loongson-3 has some specific instructions (MMI/SIMD) in coprocessor 2. COP2 isn't independent because it share COP1 (FPU)'s registers. This patch enable the COP2 usage so user-space programs can use the MMI/SIMD instructions. When COP2 exception happens, we enable both COP1 (FPU) and COP2, only in this way the fp context can be saved and restored correctly. Signed-off-by: Huacai Chen <chenhc@lemote.com> Cc: John Crispin <john@phrozen.org> Cc: Steven J. Hill <Steven.Hill@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang <zhangfx@lemote.com> Cc: Zhangjin Wu <wuzhangjin@gmail.com> Patchwork: https://patchwork.linux-mips.org/patch/7189/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm')
-rw-r--r--arch/mips/include/asm/cop2.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/mips/include/asm/cop2.h b/arch/mips/include/asm/cop2.h
index c1516cc0285f..d0352983b94d 100644
--- a/arch/mips/include/asm/cop2.h
+++ b/arch/mips/include/asm/cop2.h
@@ -32,6 +32,14 @@ extern void nlm_cop2_restore(struct nlm_cop2_state *);
32#define cop2_present 1 32#define cop2_present 1
33#define cop2_lazy_restore 0 33#define cop2_lazy_restore 0
34 34
35#elif defined(CONFIG_CPU_LOONGSON3)
36
37#define cop2_save(r)
38#define cop2_restore(r)
39
40#define cop2_present 1
41#define cop2_lazy_restore 1
42
35#else 43#else
36 44
37#define cop2_present 0 45#define cop2_present 0