sfafsr.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef _SPARC64_SFAFSR_H
  2. #define _SPARC64_SFAFSR_H
  3. #include <linux/const.h>
  4. /* Spitfire Asynchronous Fault Status register, ASI=0x4C VA<63:0>=0x0 */
  5. #define SFAFSR_ME (_AC(1,UL) << SFAFSR_ME_SHIFT)
  6. #define SFAFSR_ME_SHIFT 32
  7. #define SFAFSR_PRIV (_AC(1,UL) << SFAFSR_PRIV_SHIFT)
  8. #define SFAFSR_PRIV_SHIFT 31
  9. #define SFAFSR_ISAP (_AC(1,UL) << SFAFSR_ISAP_SHIFT)
  10. #define SFAFSR_ISAP_SHIFT 30
  11. #define SFAFSR_ETP (_AC(1,UL) << SFAFSR_ETP_SHIFT)
  12. #define SFAFSR_ETP_SHIFT 29
  13. #define SFAFSR_IVUE (_AC(1,UL) << SFAFSR_IVUE_SHIFT)
  14. #define SFAFSR_IVUE_SHIFT 28
  15. #define SFAFSR_TO (_AC(1,UL) << SFAFSR_TO_SHIFT)
  16. #define SFAFSR_TO_SHIFT 27
  17. #define SFAFSR_BERR (_AC(1,UL) << SFAFSR_BERR_SHIFT)
  18. #define SFAFSR_BERR_SHIFT 26
  19. #define SFAFSR_LDP (_AC(1,UL) << SFAFSR_LDP_SHIFT)
  20. #define SFAFSR_LDP_SHIFT 25
  21. #define SFAFSR_CP (_AC(1,UL) << SFAFSR_CP_SHIFT)
  22. #define SFAFSR_CP_SHIFT 24
  23. #define SFAFSR_WP (_AC(1,UL) << SFAFSR_WP_SHIFT)
  24. #define SFAFSR_WP_SHIFT 23
  25. #define SFAFSR_EDP (_AC(1,UL) << SFAFSR_EDP_SHIFT)
  26. #define SFAFSR_EDP_SHIFT 22
  27. #define SFAFSR_UE (_AC(1,UL) << SFAFSR_UE_SHIFT)
  28. #define SFAFSR_UE_SHIFT 21
  29. #define SFAFSR_CE (_AC(1,UL) << SFAFSR_CE_SHIFT)
  30. #define SFAFSR_CE_SHIFT 20
  31. #define SFAFSR_ETS (_AC(0xf,UL) << SFAFSR_ETS_SHIFT)
  32. #define SFAFSR_ETS_SHIFT 16
  33. #define SFAFSR_PSYND (_AC(0xffff,UL) << SFAFSR_PSYND_SHIFT)
  34. #define SFAFSR_PSYND_SHIFT 0
  35. /* UDB Error Register, ASI=0x7f VA<63:0>=0x0(High),0x18(Low) for read
  36. * ASI=0x77 VA<63:0>=0x0(High),0x18(Low) for write
  37. */
  38. #define UDBE_UE (_AC(1,UL) << 9)
  39. #define UDBE_CE (_AC(1,UL) << 8)
  40. #define UDBE_E_SYNDR (_AC(0xff,UL) << 0)
  41. /* The trap handlers for asynchronous errors encode the AFSR and
  42. * other pieces of information into a 64-bit argument for C code
  43. * encoded as follows:
  44. *
  45. * -----------------------------------------------
  46. * | UDB_H | UDB_L | TL>1 | TT | AFSR |
  47. * -----------------------------------------------
  48. * 63 54 53 44 42 41 33 32 0
  49. *
  50. * The AFAR is passed in unchanged.
  51. */
  52. #define SFSTAT_UDBH_MASK (_AC(0x3ff,UL) << SFSTAT_UDBH_SHIFT)
  53. #define SFSTAT_UDBH_SHIFT 54
  54. #define SFSTAT_UDBL_MASK (_AC(0x3ff,UL) << SFSTAT_UDBH_SHIFT)
  55. #define SFSTAT_UDBL_SHIFT 44
  56. #define SFSTAT_TL_GT_ONE (_AC(1,UL) << SFSTAT_TL_GT_ONE_SHIFT)
  57. #define SFSTAT_TL_GT_ONE_SHIFT 42
  58. #define SFSTAT_TRAP_TYPE (_AC(0x1FF,UL) << SFSTAT_TRAP_TYPE_SHIFT)
  59. #define SFSTAT_TRAP_TYPE_SHIFT 33
  60. #define SFSTAT_AFSR_MASK (_AC(0x1ffffffff,UL) << SFSTAT_AFSR_SHIFT)
  61. #define SFSTAT_AFSR_SHIFT 0
  62. /* ESTATE Error Enable Register, ASI=0x4b VA<63:0>=0x0 */
  63. #define ESTATE_ERR_CE 0x1 /* Correctable errors */
  64. #define ESTATE_ERR_NCE 0x2 /* TO, BERR, LDP, ETP, EDP, WP, UE, IVUE */
  65. #define ESTATE_ERR_ISAP 0x4 /* System address parity error */
  66. #define ESTATE_ERR_ALL (ESTATE_ERR_CE | \
  67. ESTATE_ERR_NCE | \
  68. ESTATE_ERR_ISAP)
  69. /* The various trap types that report using the above state. */
  70. #define TRAP_TYPE_IAE 0x09 /* Instruction Access Error */
  71. #define TRAP_TYPE_DAE 0x32 /* Data Access Error */
  72. #define TRAP_TYPE_CEE 0x63 /* Correctable ECC Error */
  73. #endif /* _SPARC64_SFAFSR_H */