2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (c) 2014 Imagination Technologies Ltd.
7 * Author: Markos Chandras <markos.chandras@imgtec.com>
10 #ifndef __ASM_MIPS_R2_TO_R6_EMUL_H
11 #define __ASM_MIPS_R2_TO_R6_EMUL_H
13 struct mips_r2_emulator_stats
{
28 struct mips_r2br_emulator_stats
{
44 #ifdef CONFIG_DEBUG_FS
46 #define MIPS_R2_STATS(M) \
52 __this_cpu_inc(mipsr2emustats.M); \
53 err = __get_user(nir, (u32 __user *)regs->cp0_epc); \
55 if (nir == BREAK_MATH) \
56 __this_cpu_inc(mipsr2bdemustats.M); \
61 #define MIPS_R2BR_STATS(M) \
64 __this_cpu_inc(mipsr2bremustats.M); \
70 #define MIPS_R2_STATS(M) do { } while (0)
71 #define MIPS_R2BR_STATS(M) do { } while (0)
73 #endif /* CONFIG_DEBUG_FS */
75 struct r2_decoder_table
{
78 int (*func
)(struct pt_regs
*regs
, u32 inst
);
82 extern void do_trap_or_bp(struct pt_regs
*regs
, unsigned int code
,
85 #ifndef CONFIG_MIPSR2_TO_R6_EMULATOR
86 static int mipsr2_emulation
;
87 static inline int mipsr2_decoder(struct pt_regs
*regs
, u32 inst
,
93 /* MIPS R2 Emulator ON/OFF */
94 extern int mipsr2_emulation
;
95 extern int mipsr2_decoder(struct pt_regs
*regs
, u32 inst
,
96 unsigned long *fcr31
);
97 #endif /* CONFIG_MIPSR2_TO_R6_EMULATOR */
99 #define NO_R6EMU (cpu_has_mips_r6 && !mipsr2_emulation)
101 #endif /* __ASM_MIPS_R2_TO_R6_EMUL_H */