perf_event.h 802 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_SPARC_PERF_EVENT_H
  3. #define __ASM_SPARC_PERF_EVENT_H
  4. #ifdef CONFIG_PERF_EVENTS
  5. #include <asm/ptrace.h>
  6. #define perf_arch_fetch_caller_regs(regs, ip) \
  7. do { \
  8. unsigned long _pstate, _asi, _pil, _i7, _fp; \
  9. __asm__ __volatile__("rdpr %%pstate, %0\n\t" \
  10. "rd %%asi, %1\n\t" \
  11. "rdpr %%pil, %2\n\t" \
  12. "mov %%i7, %3\n\t" \
  13. "mov %%i6, %4\n\t" \
  14. : "=r" (_pstate), \
  15. "=r" (_asi), \
  16. "=r" (_pil), \
  17. "=r" (_i7), \
  18. "=r" (_fp)); \
  19. (regs)->tstate = (_pstate << 8) | \
  20. (_asi << 24) | (_pil << 20); \
  21. (regs)->tpc = (ip); \
  22. (regs)->tnpc = (regs)->tpc + 4; \
  23. (regs)->u_regs[UREG_I6] = _fp; \
  24. (regs)->u_regs[UREG_I7] = _i7; \
  25. } while (0)
  26. #endif
  27. #endif