analysisDataOperation.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* spr-regs.h: special-purpose registers on the FRV
  2. *
  3. * Copyright (C) 2003, 2004 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_SPR_REGS_H
  12. #define _ASM_SPR_REGS_H
  13. /*
  14. * PSR - Processor Status Register
  15. */
  16. #define PSR_ET 0x00000001 /* enable interrupts/exceptions flag */
  17. #define PSR_PS 0x00000002 /* previous supervisor mode flag */
  18. #define PSR_S 0x00000004 /* supervisor mode flag */
  19. #define PSR_PIL 0x00000078 /* processor external interrupt level */
  20. #define PSR_PIL_0 0x00000000 /* - no interrupt in progress */
  21. #define PSR_PIL_13 0x00000068 /* - debugging only */
  22. #define PSR_PIL_14 0x00000070 /* - debugging in progress */
  23. #define PSR_PIL_15 0x00000078 /* - NMI in progress */
  24. #define PSR_EM 0x00000080 /* enable media operation */
  25. #define PSR_EF 0x00000100 /* enable FPU operation */
  26. #define PSR_BE 0x00001000 /* endianness mode */
  27. #define PSR_BE_LE 0x00000000 /* - little endian mode */
  28. #define PSR_BE_BE 0x00001000 /* - big endian mode */
  29. #define PSR_CM 0x00002000 /* conditional mode */
  30. #define PSR_NEM 0x00004000 /* non-excepting mode */
  31. #define PSR_ICE 0x00010000 /* in-circuit emulation mode */
  32. #define PSR_VERSION_SHIFT 24 /* CPU silicon ID */
  33. #define PSR_IMPLE_SHIFT 28 /* CPU core ID */
  34. #define PSR_VERSION(psr) (((psr) >> PSR_VERSION_SHIFT) & 0xf)
  35. #define PSR_IMPLE(psr) (((psr) >> PSR_IMPLE_SHIFT) & 0xf)
  36. #define PSR_IMPLE_FR401 0x2
  37. #define PSR_VERSION_FR401_MB93401 0x0
  38. #define PSR_VERSION_FR401_MB93401A 0x1
  39. #define PSR_VERSION_FR401_MB93403 0x2
  40. #define PSR_IMPLE_FR405 0x4
  41. #define PSR_VERSION_FR405_MB93405 0x0
  42. #define PSR_IMPLE_FR451 0x5
  43. #define PSR_VERSION_FR451_MB93451 0x0
  44. #define PSR_IMPLE_FR501 0x1
  45. #define PSR_VERSION_FR501_MB93501 0x1
  46. #define PSR_VERSION_FR501_MB93501A 0x2
  47. #define PSR_IMPLE_FR551 0x3
  48. #define PSR_VERSION_FR551_MB93555 0x1
  49. #define __get_PSR() ({ unsigned long x; asm volatile("movsg psr,%0" : "=r"(x)); x; })
  50. #define __set_PSR(V) do { asm volatile("movgs %0,psr" : : "r"(V)); } while(0)
  51. /*
  52. * TBR - Trap Base Register
  53. */
  54. #define TBR_TT 0x00000ff0
  55. #define TBR_TT_INSTR_MMU_MISS (0x01 << 4)
  56. #define TBR_TT_INSTR_ACC_ERROR (0x02 << 4)
  57. #define TBR_TT_INSTR_ACC_EXCEP (0x03 << 4)
  58. #define TBR_TT_PRIV_INSTR (0x06 << 4)
  59. #define TBR_TT_ILLEGAL_INSTR (0x07 << 4)
  60. #define TBR_TT_FP_EXCEPTION (0x0d << 4)
  61. #define TBR_TT_MP_EXCEPTION (0x0e << 4)
  62. #define TBR_TT_DATA_ACC_ERROR (0x11 << 4)
  63. #define TBR_TT_DATA_MMU_MISS (0x12 << 4)
  64. #define TBR_TT_DATA_ACC_EXCEP (0x13 << 4)
  65. #define TBR_TT_DATA_STR_ERROR (0x14 << 4)
  66. #define TBR_TT_DIVISION_EXCEP (0x17 << 4)
  67. #define TBR_TT_COMMIT_EXCEP (0x19 << 4)
  68. #define TBR_TT_INSTR_TLB_MISS (0x1a << 4)
  69. #define TBR_TT_DATA_TLB_MISS (0x1b << 4)
  70. #define TBR_TT_DATA_DAT_EXCEP (0x1d << 4)
  71. #define TBR_TT_DECREMENT_TIMER (0x1f << 4)
  72. #define TBR_TT_COMPOUND_EXCEP (0x20 << 4)
  73. #define TBR_TT_INTERRUPT_1 (0x21 << 4)
  74. #define TBR_TT_INTERRUPT_2 (0x22 << 4)
  75. #define TBR_TT_INTERRUPT_3 (0x23 << 4)
  76. #define TBR_TT_INTERRUPT_4 (0x24 << 4)
  77. #define TBR_TT_INTERRUPT_5 (0x25 << 4)
  78. #define TBR_TT_INTERRUPT_6 (0x26 << 4)
  79. #define TBR_TT_INTERRUPT_7 (0x27 << 4)