0001
0002 #ifndef __ASM_SPARC_PERF_EVENT_H
0003 #define __ASM_SPARC_PERF_EVENT_H
0004
0005 #ifdef CONFIG_PERF_EVENTS
0006 #include <asm/ptrace.h>
0007
0008 #define perf_arch_fetch_caller_regs(regs, ip) \
0009 do { \
0010 unsigned long _pstate, _asi, _pil, _i7, _fp; \
0011 __asm__ __volatile__("rdpr %%pstate, %0\n\t" \
0012 "rd %%asi, %1\n\t" \
0013 "rdpr %%pil, %2\n\t" \
0014 "mov %%i7, %3\n\t" \
0015 "mov %%i6, %4\n\t" \
0016 : "=r" (_pstate), \
0017 "=r" (_asi), \
0018 "=r" (_pil), \
0019 "=r" (_i7), \
0020 "=r" (_fp)); \
0021 (regs)->tstate = (_pstate << 8) | \
0022 (_asi << 24) | (_pil << 20); \
0023 (regs)->tpc = (ip); \
0024 (regs)->tnpc = (regs)->tpc + 4; \
0025 (regs)->u_regs[UREG_I6] = _fp; \
0026 (regs)->u_regs[UREG_I7] = _i7; \
0027 } while (0)
0028 #endif
0029
0030 #endif