Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This program is free software; you can distribute it and/or modify it |
| 3 | * under the terms of the GNU General Public License (Version 2) as |
| 4 | * published by the Free Software Foundation. |
| 5 | * |
| 6 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 7 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 8 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 9 | * for more details. |
| 10 | * |
| 11 | * You should have received a copy of the GNU General Public License along |
| 12 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 13 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. |
| 14 | * |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 15 | * Further private data for which no space exists in mips_fpu_struct. |
| 16 | * This should be subsumed into the mips_fpu_struct structure as |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | * defined in processor.h as soon as the absurd wired absolute assembler |
| 18 | * offsets become dynamic at compile time. |
| 19 | * |
| 20 | * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com |
| 21 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. |
| 22 | */ |
| 23 | #ifndef _ASM_FPU_EMULATOR_H |
| 24 | #define _ASM_FPU_EMULATOR_H |
| 25 | |
Ralf Baechle | ba3049e | 2008-10-28 17:38:42 +0000 | [diff] [blame] | 26 | #include <asm/break.h> |
| 27 | #include <asm/inst.h> |
David Daney | b6ee75e | 2009-11-05 11:34:26 -0800 | [diff] [blame] | 28 | #include <asm/local.h> |
| 29 | |
| 30 | #ifdef CONFIG_DEBUG_FS |
Ralf Baechle | ba3049e | 2008-10-28 17:38:42 +0000 | [diff] [blame] | 31 | |
Ralf Baechle | 4a99d1e | 2005-05-11 12:02:48 +0000 | [diff] [blame] | 32 | struct mips_fpu_emulator_stats { |
David Daney | b6ee75e | 2009-11-05 11:34:26 -0800 | [diff] [blame] | 33 | local_t emulated; |
| 34 | local_t loads; |
| 35 | local_t stores; |
| 36 | local_t cp1ops; |
| 37 | local_t cp1xops; |
| 38 | local_t errors; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | }; |
| 40 | |
David Daney | b6ee75e | 2009-11-05 11:34:26 -0800 | [diff] [blame] | 41 | DECLARE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats); |
| 42 | |
| 43 | #define MIPS_FPU_EMU_INC_STATS(M) \ |
Ralf Baechle | c948aca | 2010-03-08 19:38:13 +0100 | [diff] [blame] | 44 | do { \ |
| 45 | preempt_disable(); \ |
| 46 | __local_inc(&__get_cpu_var(fpuemustats).M); \ |
| 47 | preempt_enable(); \ |
| 48 | } while (0) |
David Daney | b6ee75e | 2009-11-05 11:34:26 -0800 | [diff] [blame] | 49 | |
| 50 | #else |
| 51 | #define MIPS_FPU_EMU_INC_STATS(M) do { } while (0) |
| 52 | #endif /* CONFIG_DEBUG_FS */ |
Ralf Baechle | 0bd5d2e | 2005-02-28 17:29:15 +0000 | [diff] [blame] | 53 | |
Ralf Baechle | ba3049e | 2008-10-28 17:38:42 +0000 | [diff] [blame] | 54 | extern int mips_dsemul(struct pt_regs *regs, mips_instruction ir, |
| 55 | unsigned long cpc); |
| 56 | extern int do_dsemulret(struct pt_regs *xcp); |
| 57 | |
| 58 | /* |
| 59 | * Instruction inserted following the badinst to further tag the sequence |
| 60 | */ |
| 61 | #define BD_COOKIE 0x0000bd36 /* tne $0, $0 with baggage */ |
| 62 | |
| 63 | /* |
| 64 | * Break instruction with special math emu break code set |
| 65 | */ |
| 66 | #define BREAK_MATH (0x0000000d | (BRK_MEMU << 16)) |
| 67 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | #endif /* _ASM_FPU_EMULATOR_H */ |