perf_regs_powerpc.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _ASM_POWERPC_PERF_REGS_H
  3. #define _ASM_POWERPC_PERF_REGS_H
  4. enum perf_event_powerpc_regs {
  5. PERF_REG_POWERPC_R0,
  6. PERF_REG_POWERPC_R1,
  7. PERF_REG_POWERPC_R2,
  8. PERF_REG_POWERPC_R3,
  9. PERF_REG_POWERPC_R4,
  10. PERF_REG_POWERPC_R5,
  11. PERF_REG_POWERPC_R6,
  12. PERF_REG_POWERPC_R7,
  13. PERF_REG_POWERPC_R8,
  14. PERF_REG_POWERPC_R9,
  15. PERF_REG_POWERPC_R10,
  16. PERF_REG_POWERPC_R11,
  17. PERF_REG_POWERPC_R12,
  18. PERF_REG_POWERPC_R13,
  19. PERF_REG_POWERPC_R14,
  20. PERF_REG_POWERPC_R15,
  21. PERF_REG_POWERPC_R16,
  22. PERF_REG_POWERPC_R17,
  23. PERF_REG_POWERPC_R18,
  24. PERF_REG_POWERPC_R19,
  25. PERF_REG_POWERPC_R20,
  26. PERF_REG_POWERPC_R21,
  27. PERF_REG_POWERPC_R22,
  28. PERF_REG_POWERPC_R23,
  29. PERF_REG_POWERPC_R24,
  30. PERF_REG_POWERPC_R25,
  31. PERF_REG_POWERPC_R26,
  32. PERF_REG_POWERPC_R27,
  33. PERF_REG_POWERPC_R28,
  34. PERF_REG_POWERPC_R29,
  35. PERF_REG_POWERPC_R30,
  36. PERF_REG_POWERPC_R31,
  37. PERF_REG_POWERPC_NIP,
  38. PERF_REG_POWERPC_MSR,
  39. PERF_REG_POWERPC_ORIG_R3,
  40. PERF_REG_POWERPC_CTR,
  41. PERF_REG_POWERPC_LINK,
  42. PERF_REG_POWERPC_XER,
  43. PERF_REG_POWERPC_CCR,
  44. PERF_REG_POWERPC_SOFTE,
  45. PERF_REG_POWERPC_TRAP,
  46. PERF_REG_POWERPC_DAR,
  47. PERF_REG_POWERPC_DSISR,
  48. PERF_REG_POWERPC_SIER,
  49. PERF_REG_POWERPC_MMCRA,
  50. /* Extended registers */
  51. PERF_REG_POWERPC_MMCR0,
  52. PERF_REG_POWERPC_MMCR1,
  53. PERF_REG_POWERPC_MMCR2,
  54. PERF_REG_POWERPC_MMCR3,
  55. PERF_REG_POWERPC_SIER2,
  56. PERF_REG_POWERPC_SIER3,
  57. PERF_REG_POWERPC_PMC1,
  58. PERF_REG_POWERPC_PMC2,
  59. PERF_REG_POWERPC_PMC3,
  60. PERF_REG_POWERPC_PMC4,
  61. PERF_REG_POWERPC_PMC5,
  62. PERF_REG_POWERPC_PMC6,
  63. PERF_REG_POWERPC_SDAR,
  64. PERF_REG_POWERPC_SIAR,
  65. /* Max mask value for interrupt regs w/o extended regs */
  66. PERF_REG_POWERPC_MAX = PERF_REG_POWERPC_MMCRA + 1,
  67. /* Max mask value for interrupt regs including extended regs */
  68. PERF_REG_EXTENDED_MAX = PERF_REG_POWERPC_SIAR + 1,
  69. };
  70. #define PERF_REG_PMU_MASK ((1ULL << PERF_REG_POWERPC_MAX) - 1)
  71. /*
  72. * PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_300
  73. * includes 11 SPRS from MMCR0 to SIAR excluding the
  74. * unsupported SPRS MMCR3, SIER2 and SIER3.
  75. */
  76. #define PERF_REG_PMU_MASK_300 \
  77. ((1ULL << PERF_REG_POWERPC_MMCR0) | (1ULL << PERF_REG_POWERPC_MMCR1) | \
  78. (1ULL << PERF_REG_POWERPC_MMCR2) | (1ULL << PERF_REG_POWERPC_PMC1) | \
  79. (1ULL << PERF_REG_POWERPC_PMC2) | (1ULL << PERF_REG_POWERPC_PMC3) | \
  80. (1ULL << PERF_REG_POWERPC_PMC4) | (1ULL << PERF_REG_POWERPC_PMC5) | \
  81. (1ULL << PERF_REG_POWERPC_PMC6) | (1ULL << PERF_REG_POWERPC_SDAR) | \
  82. (1ULL << PERF_REG_POWERPC_SIAR))
  83. /*
  84. * PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_31
  85. * includes 14 SPRs from MMCR0 to SIAR.
  86. */
  87. #define PERF_REG_PMU_MASK_31 \
  88. (PERF_REG_PMU_MASK_300 | (1ULL << PERF_REG_POWERPC_MMCR3) | \
  89. (1ULL << PERF_REG_POWERPC_SIER2) | (1ULL << PERF_REG_POWERPC_SIER3))
  90. #endif /* _ASM_POWERPC_PERF_REGS_H */