fpu_emulator.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. *
  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
  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. #include <asm/break.h>
  26. #include <asm/inst.h>
  27. #include <asm/local.h>
  28. #ifdef CONFIG_DEBUG_FS
  29. struct mips_fpu_emulator_stats {
  30. local_t emulated;
  31. local_t loads;
  32. local_t stores;
  33. local_t cp1ops;
  34. local_t cp1xops;
  35. local_t errors;
  36. };
  37. DECLARE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats);
  38. #define MIPS_FPU_EMU_INC_STATS(M) \
  39. do { \
  40. preempt_disable(); \
  41. __local_inc(&__get_cpu_var(fpuemustats).M); \
  42. preempt_enable(); \
  43. } while (0)
  44. #else
  45. #define MIPS_FPU_EMU_INC_STATS(M) do { } while (0)
  46. #endif /* CONFIG_DEBUG_FS */
  47. extern int mips_dsemul(struct pt_regs *regs, mips_instruction ir,
  48. unsigned long cpc);
  49. extern int do_dsemulret(struct pt_regs *xcp);
  50. /*
  51. * Instruction inserted following the badinst to further tag the sequence
  52. */
  53. #define BD_COOKIE 0x0000bd36 /* tne $0, $0 with baggage */
  54. /*
  55. * Break instruction with special math emu break code set
  56. */
  57. #define BREAK_MATH (0x0000000d | (BRK_MEMU << 16))
  58. #endif /* _ASM_FPU_EMULATOR_H */