summaryrefslogtreecommitdiff
path: root/arch/mips/include/asm/fpu_emulator.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-11-11 08:25:07 +0100
committerIngo Molnar <mingo@kernel.org>2016-11-11 08:25:07 +0100
commit4c8ee71620d734c8ad129fad085167f56f9ce351 (patch)
tree87208b0144aa664c96dd8b43bbcaaf1f25af606b /arch/mips/include/asm/fpu_emulator.h
parentc7faee2109f978f3ef826c48b7e60609061fda4f (diff)
parent27bcd37e0240bbe33f0efe244b5aad52104115b3 (diff)
Merge branch 'linus' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/mips/include/asm/fpu_emulator.h')
-rw-r--r--arch/mips/include/asm/fpu_emulator.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/mips/include/asm/fpu_emulator.h b/arch/mips/include/asm/fpu_emulator.h
index 355dc25172e7..c05369e0b8d6 100644
--- a/arch/mips/include/asm/fpu_emulator.h
+++ b/arch/mips/include/asm/fpu_emulator.h
@@ -63,6 +63,8 @@ do { \
extern int fpu_emulator_cop1Handler(struct pt_regs *xcp,
struct mips_fpu_struct *ctx, int has_fpu,
void *__user *fault_addr);
+void force_fcr31_sig(unsigned long fcr31, void __user *fault_addr,
+ struct task_struct *tsk);
int process_fpemu_return(int sig, void __user *fault_addr,
unsigned long fcr31);
int isBranchInstr(struct pt_regs *regs, struct mm_decoded_insn dec_insn,
@@ -81,4 +83,15 @@ static inline void fpu_emulator_init_fpu(void)
set_fpr64(&t->thread.fpu.fpr[i], 0, SIGNALLING_NAN);
}
+/*
+ * Mask the FCSR Cause bits according to the Enable bits, observing
+ * that Unimplemented is always enabled.
+ */
+static inline unsigned long mask_fcr31_x(unsigned long fcr31)
+{
+ return fcr31 & (FPU_CSR_UNI_X |
+ ((fcr31 & FPU_CSR_ALL_E) <<
+ (ffs(FPU_CSR_ALL_X) - ffs(FPU_CSR_ALL_E))));
+}
+
#endif /* _ASM_FPU_EMULATOR_H */