MIPS: Loongson-3: Enable the COP2 usage
authorHuacai Chen <chenhc@lemote.com>
Thu, 26 Jun 2014 03:41:31 +0000 (11:41 +0800)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 30 Jul 2014 19:47:17 +0000 (21:47 +0200)
commitef2f826c8f2ff1e4215968042139604633581a13
tree2e2cb70e0a16ade5ea70b0ef00ff67ff902d25d8
parente7841be50fe2b8751a51a068b8cdcdcb6611e354
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>
arch/mips/include/asm/cop2.h
arch/mips/loongson/loongson-3/Makefile
arch/mips/loongson/loongson-3/cop2-ex.c [new file with mode: 0644]